-
Notifications
You must be signed in to change notification settings - Fork 17
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 deprecations #335
base: master
Are you sure you want to change the base?
Fix Kustomize deprecations #335
Conversation
Hi @benwh, thanks for this PR. It seems though that integration test fails after this change. From what I can see, since we are no longer defining the environment variable We still need to define the I don't think reading the # ...
args:
- --theatre-image=theatre:latest
- --metrics-address=0.0.0.0
# ... I see the tests are failing in your fork as well, though the logs have timed out, I assume the reason is the same. |
62d067d
to
8ed20a3
Compare
When running `kustomize build`, we currently see some warnings. Get rid of these by using the more modern replacements. See [docs][0]. ``` Warning: 'commonLabels' is deprecated. Please use 'labels' instead. Warning: 'vars' is deprecated. Please use 'replacements' instead. ``` [0]: https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/
8ed20a3
to
dc1684f
Compare
@0x0013 thanks for the pointers! I've rebased to drop the superseded commit, and updated the acceptance kustomization to fix what I suspect are the issues there (I've been somewhat ignoring the |
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.
@benwh Interesting way to solve the acceptance tests issue, by repeating the whole replacement. Though it produces more overlay code, I agree that it's a better approach than just hardcoding the acceptance image in the overlay (- --theatre-image=theatre:latest
) as now we use the same replacement pattern in tests as well.
I've left a small suggestion which would hopefully help avoid divergent code in the future.
@@ -22,16 +24,27 @@ resources: | |||
- rbac/leader-election.yaml | |||
- cert-manager/certificate.yaml | |||
|
|||
vars: | |||
replacements: |
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.
with the new approach of repeating this replacement in overlay kustomization, there is a slight risk of someone modifying this replacement code, but forgetting to mirror the modification in overlay, in which case the replacement could be buggy, and the tests would still pass.
I don't think there's an elegant way to solve this, but could you add a code comment that the replacement code needs to be mirrored in config/acceptance/kustomization.yaml
?
Here's a couple of fixes that we've got in our fork. Details in commit messages.