-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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: allow resolving repo root as jsonnt lib path #11119
fix: allow resolving repo root as jsonnt lib path #11119
Conversation
5a65e06
to
71df2e8
Compare
Signed-off-by: shuai-zh <shuaiz8023@gmail.com>
Signed-off-by: CI <ci@argoproj.com> Signed-off-by: CI <ci@argoproj.com> Co-authored-by: CI <ci@argoproj.com> Signed-off-by: shuai-zh <shuaiz8023@gmail.com>
Signed-off-by: shuai-zh <shuaiz8023@gmail.com>
186928c
to
203d3e2
Compare
Codecov ReportBase: 45.64% // Head: 45.65% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #11119 +/- ##
==========================================
+ Coverage 45.64% 45.65% +0.01%
==========================================
Files 239 239
Lines 28991 29003 +12
==========================================
+ Hits 13233 13242 +9
- Misses 13939 13941 +2
- Partials 1819 1820 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
different jsonnet fix
Signed-off-by: shuai-zh <shuaiz8023@gmail.com>
Signed-off-by: shuai-zh <shuaiz8023@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.
LGTM!
@jessesuen can you take a look as well?
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.
LGTM, great refactoring work which addressed our concerns about jsonnet requirements leaking into the helm code path.
Signed-off-by: shuai-zh <shuaiz8023@gmail.com> Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: shuai-zh <shuaiz8023@gmail.com> Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: shuai-zh <shuaiz8023@gmail.com> Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Cherry-picked onto release-2.5 for 2.5.3, release-2.4 for 2.4.18, and release-2.3 for 2.3.12. |
Signed-off-by: shuai-zh <shuaiz8023@gmail.com> Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: shuai-zh <shuaiz8023@gmail.com> Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> Signed-off-by: emirot <emirot.nolan@gmail.com>
When testing with the below app setup,
rpc error: code = Unknown desc = value file '.' resolved to outside repository root
error was thrown unexpectedly (if not by design) during the sync process.Setup
Folder structure
main.jsonnet
ArgoCD Application
Simulated jsonnet command
The following command work well locally:
jsonnet -J . app/main.jsonnet
Troubleshoot
Looking through the code and it seems the related code block is https://github.com/argoproj/argo-cd/blob/master/util/io/path/resolved.go#L146-L156 where the
value file '.' resolved to outside repository root
error was thrown.The
path
assigned by the abovefilepath.Abs(path)
only ends in a slash only if it represents a root directory, such as "/" on Unix orC:\
on Windows.When
.
is provided as thevalueFile
, the check at https://github.com/argoproj/argo-cd/blob/master/util/io/path/resolved.go#L154 effectively compares if/github/repo-root
has/github/repo-root/
as a prefix which apparently is not the case.Proposed fix
Add an additional condition to allow this case.
Note on DCO:
If the DCO action in the integration test fails, one or more of your commits are not signed off. Please click on the Details link next to the DCO action for instructions on how to resolve this.
Checklist: