-
Notifications
You must be signed in to change notification settings - Fork 6.3k
fix: kustomize components + monorepos #23486
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: kustomize components + monorepos #23486
Conversation
❌ Preview Environment deleted from BunnyshellAvailable commands (reply to this comment):
|
dfcbd24
to
186d8ed
Compare
With argoproj#21674 the ability to ignore Kustomize component directories if they do not exist got introduced. This generally works fine, but the `securejoin` check is a bit too strict - we want to ensure that no-one can break out of the repo, but the current implementation doesn't allow for breaking outside the kustomization folder. This breaks the usage of this feature when using it for a monorepo. This PR loosens the check to allow for traversals up to the repo root. We use the new `os.Root` functionality to ensure that users can't break outside the repo. Path traversals are still relative from the kustomize repo. Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
186d8ed
to
49adac8
Compare
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #23486 +/- ##
==========================================
+ Coverage 59.96% 60.27% +0.30%
==========================================
Files 342 344 +2
Lines 58807 59089 +282
==========================================
+ Hits 35263 35613 +350
+ Misses 20671 20598 -73
- Partials 2873 2878 +5 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
The cherry-pick might be tough since os.Root is new, but worth trying.
Let's find out :) |
/cherry-pick release-3.0 |
/cherry-pick release-3.1 |
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Following argoproj#21674 which allowed ignoring components and argoproj#23486 which allowed having components specified in a monorepo, this allows specifying components by reference the same way that helm values files can be specified. This is useful for people that store components in branches or are doing testing by using branches against the main application components. Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
) This is an implmentation of argoproj#23873. Following argoproj#21674 which allowed ignoring components and argoproj#23486 which allowed having components specified in a monorepo, this allows specifying components by reference the same way that helm values files can be specified. Today kustomize supports having URL references to components but ArgoCD has no concept of this and does not detect that the component might have changed. Using the reference form ArgoCD is aware of the changes to components and can re-run any sync that is configured. This is useful for people that store components in branches or are doing testing by using branches against the main application components. Fixes argoproj#23872 Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
) This is an implmentation of argoproj#23873. Following argoproj#21674 which allowed ignoring components and argoproj#23486 which allowed having components specified in a monorepo, this allows specifying components by reference the same way that helm values files can be specified. Today kustomize supports having URL references to components but ArgoCD has no concept of this and does not detect that the component might have changed. Using the reference form ArgoCD is aware of the changes to components and can re-run any sync that is configured. This is useful for people that store components in branches or are doing testing by using branches against the main application components. Fixes argoproj#23872 Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
) This is an implmentation of argoproj#23873. Following argoproj#21674 which allowed ignoring components and argoproj#23486 which allowed having components specified in a monorepo, this allows specifying components by reference the same way that helm values files can be specified. Today kustomize supports having URL references to components but ArgoCD has no concept of this and does not detect that the component might have changed. Using the reference form ArgoCD is aware of the changes to components and can re-run any sync that is configured. This is useful for people that store components in branches or are doing testing by using branches against the main application components. Fixes argoproj#23872 Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
) This is an implmentation of argoproj#23873. Following argoproj#21674 which allowed ignoring components and argoproj#23486 which allowed having components specified in a monorepo, this allows specifying components by reference the same way that helm values files can be specified. Today kustomize supports having URL references to components but ArgoCD has no concept of this and does not detect that the component might have changed. Using the reference form ArgoCD is aware of the changes to components and can re-run any sync that is configured. This is useful for people that store components in branches or are doing testing by using branches against the main application components. Fixes argoproj#23872 Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com> Signed-off-by: enneitex <etienne.divet@gmail.com>
With #21674 the ability to ignore Kustomize component directories if they do not exist got introduced. This generally works fine, but the
securejoin
check is a bit too strict - we want to ensure that no-one can break out of the repo, but the current implementation doesn't allow for breaking outside the kustomization folder. This breaks the usage of this feature when using it for a monorepo.This PR loosens the check to allow for traversals up to the repo root. We use the new
os.Root
functionality to ensure that users can't break outside the repo. Path traversals are still relative from the path where the kustomize source is located.This should be cherry-picked for 3.0 and 3.1.
Checklist: