Git Product home page Git Product logo

Comments (6)

joaopapereira avatar joaopapereira commented on August 22, 2024 4

I was looking into this issue and I was a little bit confused by the names. My suggestion of a possible UX is:

renamePath:
  - origin: resources/crds-v1/ # all files under resources/crds-v1/ will be flattened, removing all the folder structure
    flatten: true
  - origin: resources/crds-v1alpha1/ # Move all files and folders from resources/crds-v1alpha1 to the "root" directory
    destination: /   
  - origin: resources/operator
    destination: resources       # To relocate everything under resources folder (rename folder)
  - origin: resources/operator/example.yaml
    destination: resources/my-example.yaml   # rename file

I feel like giving a little bit more structure to the configuration, at least to me, helped better understand what each option was. What do yll think?

from vendir.

jorgemoralespou avatar jorgemoralespou commented on August 22, 2024 2

It would maybe make sense to add a relocation/fail strategy. An example would be:

- path: vendor/k8s
  contents:
  - path: eduk8s
    git:
      url: https://github.com/eduk8s/eduk8s
      ref: 20.08.04.1
    includePaths:
    - resources/crds-v1/**/*
    - resources/crds-v1alpha1/**/*
    - resources/operator/**/*
    relocatePath:  # Apply this relocation rules in order, fail if one don't succeed
    - resources/crds-v1/**/*=/**/*                          # To strip path
    - resources/crds-v1alpha1/=/                            # To strip path (as it ends with / is a dir. Fail if a file)
    - resources/operator/**/*=resources/**/*       # To relocate everything under resources folder (rename folder)
    - resources/operator/example.yaml=resources/my-example.yaml   # rename file

from vendir.

cppforlife avatar cppforlife commented on August 22, 2024

one of the reasons why its is like that at this moment is because its not clear what should happen when there are conflicts between file names, directory name vs file name, etc. any suggestions?

from vendir.

StevenLocke avatar StevenLocke commented on August 22, 2024

We can definitely see how this need is really valid!

For further discussion, what aspects of directory shaping fit within vendir's responsibilities?
How much of that is intrinsic to vendoring in software?

from vendir.

cppforlife avatar cppforlife commented on August 22, 2024

https://github.com/k14s/vendir/releases/tag/v0.11.0 includes newRootPath configuration that changes "root" directory for the source.

from vendir.

jorgemoralespou avatar jorgemoralespou commented on August 22, 2024

Example (and discussion) demonstrating why this could be helpful: https://kubernetes.slack.com/archives/CH8KCCKA5/p1625843954329600?thread_ts=1625811418.324700&cid=CH8KCCKA5

from vendir.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.