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

Fixes non-escaped comma bug on Helm command arguments #1720

Merged
merged 3 commits into from
Jun 10, 2019

Conversation

simster7
Copy link
Member

Fixes #1660, pretty self explanatory

@codecov
Copy link

codecov bot commented Jun 10, 2019

Codecov Report

Merging #1720 into master will increase coverage by 0.09%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1720      +/-   ##
==========================================
+ Coverage   34.17%   34.26%   +0.09%     
==========================================
  Files          77       77              
  Lines       11433    11437       +4     
==========================================
+ Hits         3907     3919      +12     
+ Misses       6985     6973      -12     
- Partials      541      545       +4
Impacted Files Coverage Δ
util/helm/helm.go 63.04% <100%> (+1.1%) ⬆️
server/server.go 46.74% <0%> (-0.24%) ⬇️
controller/appcontroller.go 39.72% <0%> (+1.39%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3f14f75...4d004ba. Read the comment docs.

@codecov
Copy link

codecov bot commented Jun 10, 2019

Codecov Report

Merging #1720 into master will increase coverage by 0.09%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1720      +/-   ##
==========================================
+ Coverage   34.17%   34.26%   +0.09%     
==========================================
  Files          77       77              
  Lines       11433    11437       +4     
==========================================
+ Hits         3907     3919      +12     
+ Misses       6985     6973      -12     
- Partials      541      545       +4
Impacted Files Coverage Δ
util/helm/helm.go 63.04% <100%> (+1.1%) ⬆️
server/server.go 46.74% <0%> (-0.24%) ⬇️
controller/appcontroller.go 39.72% <0%> (+1.39%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3f14f75...cd34ce9. Read the comment docs.

Copy link
Contributor

@alexec alexec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

Looks good - I think we need at least one test please.

Thank you,

Alex

@simster7
Copy link
Member Author

@alexec Done. Seems like the linter ran out of memory on the workflow check, but a local run of golangci-lint run --fix --verbose confirms there are no problems.

@jannfis
Copy link
Member

jannfis commented Jun 10, 2019

Hm, I was wondering whether this will break existing parameters that have been given with an escaped comma already, i.e. if somebody had manually worked around this issue "the Helm way" already.
Would that change actually escape the backslash? For example, if there'd be a parameter such as 'foo\,bar', would it turn it into 'foo\\,bar'?

Also, what will happen once Helm changes this behaviour (as they have indicated in their bug reports, that they will change it one day)?

@simster7
Copy link
Member Author

@jannfis, fair point. I will add a check to ensure that commas don't get double-escaped.

@simster7
Copy link
Member Author

simster7 commented Jun 10, 2019

@jannfis Fixed the double-escaping issue. The failed test is seems unrelated.

As for your other point, it seems like Helm won't break backwards compatibility without a major version bump (helm/helm#1556 (comment)). Until that decision is announced, there is no way to know how to move forward.

Unless the issue here is whether this should be fixed from our end at all. If we provide a superset to helm and we provide this fix for them, then we could run into the scenario where users using ArgoCD with what they think are valid helm configs are not actually valid. By forcing users to escape their own commas, and it is made clear that the issue comes from helm, there is no such divergence.

@alexec alexec added this to the v1.1 milestone Jun 10, 2019
@alexec alexec merged commit 1d9cd06 into argoproj:master Jun 10, 2019
olivierlemasle added a commit to olivierlemasle/argo-cd that referenced this pull request Sep 19, 2019
This commit fixes Helm parsing of parameters values containing a comma.

The issue was first found as argoproj#1660, and fixed in argoproj#1720. However, commit
4e9772e, in argoproj#1865 removed the call to `cleanHelmParameters`, hence the
regression.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

failed parsing on parameters with comma
3 participants