Closed Zebradil closed 7 months ago
@Zebradil I think you are trying to do the same thing what @fritzduchardt has done in this PR https://github.com/carvel-dev/vendir/pull/325
I have added a solution as well there if that fulfil your requirements. Else we will have more discussion on this in next community meeting to have a final decision wether we want this change or not. Thanks
Hi @kumaritanushree, thank you for looking into this.
I saw #325 before creating this PR, but my proposal differs. The PR from @fritzduchardt proposes to allow the same paths to be managed by different directory
entities in the vendir configuration. My PR proposes to disallow duplicated paths.
I've been using vendir for more than three years and I always was sure that one path could be managed only by one directory
. I can be wrong about that. Maybe @cppforlife can share the initial idea behind this.
Let us talk about this in tomorrow's community meeting @fritzduchardt @Zebradil if yll can attend
@joaopapereira as we agreed in the community meeting, I went ahead and:
I'm unsure about the last point, but I don't see much value in having an example of incorrect configuration (I bet, code copilots learn from it 😄).
Changes looks good to me. Tested, error message also looks good.
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:
The result of
vendir sync
would be:One of the contents is overwritten by the other.
With this PR, having the same paths for two directories will result in an error.