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: Allow per-version kustomize options (#5533) #5967
Conversation
de16b75
to
26919ed
Compare
Codecov Report
@@ Coverage Diff @@
## master #5967 +/- ##
==========================================
+ Coverage 40.91% 40.96% +0.04%
==========================================
Files 147 147
Lines 19635 19655 +20
==========================================
+ Hits 8033 8051 +18
- Misses 10497 10498 +1
- Partials 1105 1106 +1
Continue to review full report at Codecov.
|
Thank you! Perfect timing. I thought it won't make it into v2.0 |
util/settings/settings.go
Outdated
if source.Kustomize != nil && source.Kustomize.Version != "" { | ||
for _, ver := range ks.Versions { | ||
if ver.Name == source.Kustomize.Version { | ||
binaryPath = ver.Path | ||
// append version specific build options to global build options |
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.
The options specified in kustomize.buildOptions
is default version build options, not global options. So instead of appending, we should just replace version-specific build options. If version specific build option is empty then we need to use empty build options.
Imagine the following use case. Everyone is org is using kustomize v3.9.x with --load_restrictor none
build options.
In order to migrate to v4.x the admin would have to register new v4.0.x version with v4.0 specific build options
( v4.x does not support --load_restrictor none
). Migrate all apps to v4.0.x and them change default to v4.0.x
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.
Good point. With appending, there is really no way to change the default build options.
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.
That makes sense. I've updated the PR with the below logic
- Use
kustomize.buildOptions
only for the default version and don't include it for version-specific options. - Use
kustomize.buildOptions.<version>
for version-specific options. If this field is absent, this version will have no build options.
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.
@alexmt The PR is updated, please take a look
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.
Hi guys,
Is this tested with kustomize v.4.0.5
?
I'm getting the following kustomize version v4.0.5 is not registered
error.
I checked that the argocd-cm
is defined and the tool is in the specified path in the container as well.
Any ideas?
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.
Hi, could you try setting the path for v4.0.5 kustomize.path.v4.0.5: <path>
in the argocd-cm
. I think we get this error when there's no path specified for the kustomize version.
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.
Of course, I have correct path in configmap and the container has the tool under same path.
Updating my Argo installation from '1.8.7' to '2.0.1' made it work!
Allow adding build options that are specific to a kustomize version instead of using the same default options for each version. Signed-off-by: Chetan Banavikalmutt <chetanrns1997@gmail.com>
26919ed
to
fb66eaf
Compare
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!
Allow adding build options that are specific to a kustomize version instead of using the same default options for each version. Signed-off-by: Chetan Banavikalmutt <chetanrns1997@gmail.com>
Question, these options get acknowledged if the specific version of kustomize is available? ( Assuming upstream may not necessarily be bundling any of the specific versions ) |
@sbose78 It does get acknowledged. However, the kustomize build will fail later if the binary doesn't exist at the given path. |
* 4f9c500 (upstream/master) docs: k8s version in Ingress Configuration documentation (argoproj#5727) * 7c88ac8 feat: Allow to pass Kubernetes configuration overrides (argoproj#5906) * 834a5fa chore: Change grammar in high_availability.md (argoproj#5964) * 2a2b81f fix: Improvements to mobile UI (argoproj#5965) * f06fc0d feat: allow per-version kustomize options (argoproj#5967) * 92c7ca0 chore: make argocd gitpod friendly (argoproj#5973) * 1bc3348 Upgrade gitops-engine (argoproj#5972) * a686f12 fix: run dex as nonroot (argoproj#5815) * ed5c5b6 chore: Update go-git to v5 (argoproj#5520) * ac3d4cc fix: correct package name in Makefile (argoproj#5960) * 24b2cac chore: fix incorrect image name in 'publish' CI job (argoproj#5956) * b37eee1 chore: fix invalid IMAGE_NAMESPACE in image 'publish' CI job (argoproj#5953) * dc4eaff chore: Remove specification of user id for the Redis workload (argoproj#5863) * 8eeb9a0 chore: use clusterrolebinding v1 (argoproj#5939) * 7945286 docs: clarify that the certificate must be in PEM format (argoproj#5946) * de522bf chore: migrate argocd dev images to ghcr.io (argoproj#5948) * 0a53fb1 chore(deps): bump y18n from 4.0.0 to 4.0.1 in /ui (argoproj#5919) * ae49b45 chore: Upgrade Go module to v2 (argoproj#5931) * a2ebe15 add user (argoproj#5938) * 7f5a23d Update USERS.md (argoproj#5835) * 24218b4 docs: Propose an enhancement proposal process (argoproj#5771)
Allow adding build options that are specific to a kustomize version instead of using the same default options for each version. Signed-off-by: Chetan Banavikalmutt <chetanrns1997@gmail.com>
Allow adding build options that are specific to a kustomize version instead of using the same default option for each version.
This PR also changes the conventions for adding kustomize paths from
kustomize.version.<version>
tokustomize.buildOptions.<version>
.Example:
In the above example, the final build command looks like
/kustomize_4.0.5 build --load_restrictor none
Closes: #5533
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: