Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: check overlapping paths separately for directories and contents #342

Closed
wants to merge 1 commit into from

Conversation

Zebradil
Copy link
Member

This PR fixes the logic of the overlapping paths check. In the original versions, paths of directories were joined with paths of their contents before the check. This allowed the following configuration to be accepted:

apiVersion: vendir.k14s.io/v1alpha1
kind: Config
directories:
  - path: charts
    contents:
      - path: foo
        inline:
          paths:
            foo.txt: file-content
  - path: charts
    contents:
      - path: bar
        inline:
          paths:
            bar.txt: file-content

The result of vendir sync would be:

❯ vendir sync
Fetching: charts + foo (inline)

Fetching: charts + bar (inline)

Lock config

apiVersion: vendir.k14s.io/v1alpha1
directories:
- contents:
  - inline: {}
    path: foo
  path: charts
- contents:
  - inline: {}
    path: bar
  path: charts
kind: LockConfig

Succeeded

❯ exa -T
.
├── charts
│  └── bar
│     └── bar.txt
├── vendir.lock.yml
└── vendir.yml

One of the contents is overwritten by the other.

With this PR, having the same paths for two directories will result in an error.

@Zebradil
Copy link
Member Author

Zebradil commented Dec 24, 2023

Wrong branch, will create a new PR (#343).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

1 participant