-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
feat: add skipCrds flag for helm charts #8012
Conversation
* replace additionalTemplateArgs with includeCrds flag * add testcase for skip crds Signed-off-by: patst <patrick.steinig@googlemail.com>
afc638f
to
2620784
Compare
* replace additionalTemplateArgs with includeCrds flag * add testcase for skip crds Signed-off-by: patst <patrick.steinig@googlemail.com>
# Conflicts: # cmd/util/app.go # pkg/apis/application/v1alpha1/generated.pb.go # pkg/apis/application/v1alpha1/generated.proto # pkg/apis/application/v1alpha1/openapi_generated.go # pkg/apis/application/v1alpha1/types.go
* replace additionalTemplateArgs with includeCrds flag * add testcase for skip crds Signed-off-by: patst <patrick.steinig@googlemail.com>
The folks over at |
@jplanza-gr Yes. But the correct fix is more #2267. |
Thanks, I'll keep an eye on that issue. |
Even though the correct fix for kube-prometheus-stack case would be different I feel like this PR in itself would have value as well. I myself like to manage CRDs separately from applications and would love to see this merged. Some other valid uses have been raised in #4723 |
I agree with @poksiala . This is not completely related to the prometheus helm chart. I would like to have a separate application to maintain the CRD version and therefore have the possibility to skip the installation via the helm3 The |
util/helm/cmd.go
Outdated
@@ -330,8 +331,8 @@ func (c *Cmd) template(chartPath string, opts *TemplateOpts) (string, error) { | |||
for _, v := range opts.APIVersions { | |||
args = append(args, "--api-versions", v) | |||
} | |||
if c.HelmVer.additionalTemplateArgs != nil { | |||
args = append(args, c.HelmVer.additionalTemplateArgs...) | |||
if !opts.SkipCrds { |
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.
Nice, thank you for keeping backward compatible behavior!
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. Thank you!
Codecov Report
@@ Coverage Diff @@
## master #8012 +/- ##
==========================================
- Coverage 41.54% 41.53% -0.01%
==========================================
Files 174 174
Lines 22696 22711 +15
==========================================
+ Hits 9430 9434 +4
+ Misses 11925 11923 -2
- Partials 1341 1354 +13
Continue to review full report at Codecov.
|
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.
E2E tests have caught an issue: we still support helm2 . The --skip-crds
flag should be added only for Helm3. @patst , can you please fix it.
* make sure include crds is not added for helm2 Signed-off-by: patst <patrick.steinig@googlemail.com>
@alexmt : thanks for your feedback. I missed the one condition which makes sure |
the Lint docs failed due to an unrelated issue because
|
Closes #6252
Checklist:
This PR allows to skip the CRD creation for helm charts by providing a flag
skipCrds
.I removed the
additionalTemplateArgs
array in the template options. There was only on entry and it was conflicting in turning crd application off.Helm provides a
skip-crds
command line argument. But argo-cd useshelm template
to generate rendered YAML files which are applied then. Imhoskip-crds
only works forhelm install
.I am unsure if a better name for the flag would be
include-crds
which is true by default. This would reflect the current behaviour.From an end user perspective used to the
helm install
command theskip-crds
flag is what we want to have.