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

Breaking changes when using kustomize v5 with rollout-transform.yaml #3105

Closed
1 of 2 tasks
dlemfh opened this issue Oct 14, 2023 · 3 comments · Fixed by #3775
Closed
1 of 2 tasks

Breaking changes when using kustomize v5 with rollout-transform.yaml #3105

dlemfh opened this issue Oct 14, 2023 · 3 comments · Fixed by #3775
Labels
bug Something isn't working

Comments

@dlemfh
Copy link
Contributor

dlemfh commented Oct 14, 2023

Checklist:

  • I've included steps to reproduce the bug.
  • I've included the version of argo rollouts.
    • → This issue is not tied to any specific argo rollouts version.

Describe the bug

Using kustomize v5.x.x with rollout-transform.yaml causes breaking changes.

A kustomization.yaml that uses rollout-transform.yaml along with the labels directive (with includeSelectors: false and includeTemplates: true) stops working correctly when upgrading kustomize to v5.

Example of kustomization.yaml that breaks:

# Adapted snippet from `test/kustomize/rollout/kustomization.yaml`
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

configurations:
- ../../../docs/features/kustomize/rollout-transform.yaml

resources:
- rollout.yaml

labels:
- includeSelectors: false
  includeTemplates: true
  pairs:
    baz: qux

openapi:
  path: https://raw.githubusercontent.com/argoproj/argo-schema-generator/main/schema/argo_all_k8s_kustomize_schema.json

To Reproduce

I've forked and updated the kustomize test here: dlemfh@ffe1f7f#diff-e3c72800a3ccfbc82af00dd308fa4dd944d5e1702ed5e3ff5e807e91e39b2e23

Here you can check that running make test-kustomize with kustomize@v5 fails the test.

git clone [email protected]:dlemfh/argo-rollouts.git
cd argo-rollouts
git checkout edit-kustomize-test
brew install kustomize  # install latest kustomize (v5.x.x)

make test-kustomize
# check that test fails

# Note that if you run the test using kustomize v4, the test will pass.

Expected behavior

Using kustomize with rollout-transform.yaml + labels with includeSelectors: false and includeTemplates: true should patch the specified label into both the rollout's /metadata/labels and /spec/template/metadata/labels.

However, using kustomize@v5 the same kustomization.yaml fails to patch the specified label into the /spec/template/metadata/labels field.

The reason is because starting kustomize@v5, using labels with includeSelectors: false and includeTemplates: true takes its configuration from a new transformer configuration directive named templateLabels,
which is not currently accounted for in rollout-transform.yaml.

Screenshots

Version

Logs

# Paste the logs from the rollout controller

# Logs for the entire controller:
kubectl logs -n argo-rollouts deployment/argo-rollouts

# Logs for a specific rollout:
kubectl logs -n argo-rollouts deployment/argo-rollouts | grep rollout=<ROLLOUTNAME

Message from the maintainers:

Impacted by this bug? Give it a 👍. We prioritize the issues with the most 👍.

@dlemfh dlemfh added the bug Something isn't working label Oct 14, 2023
@dlemfh
Copy link
Contributor Author

dlemfh commented Oct 14, 2023

The fix itself is simple: dlemfh@48adcd7 (= Add templateLabels configuration to rollout-transform.yaml).

Although I'm not sure whether you want to proceed by updating the rollout-transform.yaml file directly (= dlemfh@48adcd7), or by releasing a new version of the file (= dlemfh@31a8971).

@zachaller
Copy link
Collaborator

Could probably add a new transform file rollout-transform-kustomize-v5.yaml and document the usage for kustomize v5+

@dlemfh
Copy link
Contributor Author

dlemfh commented Oct 16, 2023

@zachaller Awesome!

Do you think we should update the docs to instruct users to use the new rollout-transform-kustomize-v5.yaml as well?

configurations:
-  - https://argoproj.github.io/argo-rollouts/features/kustomize/rollout-transform.yaml
+  - https://argoproj.github.io/argo-rollouts/features/kustomize/rollout-transform-kustomize-v5.yaml

because as far as I know, the new transformer configuration file will work correctly with both kustomize v4 & v5 (i.e. it's backwards-compatible).

zachaller pushed a commit that referenced this issue Aug 7, 2024
* feat: add rollout-transform-2023-10-09.yaml which has been adapted for kustomize v5

Signed-off-by: Jethro Lee <[email protected]>

* Rename to rollout-transform-kustomize-v5.yaml

Signed-off-by: Hidetake Iwata <[email protected]>

* Add link to doc

Signed-off-by: Hidetake Iwata <[email protected]>

---------

Signed-off-by: Jethro Lee <[email protected]>
Signed-off-by: Hidetake Iwata <[email protected]>
Co-authored-by: Jethro Lee <[email protected]>
meeech pushed a commit to CircleCI-Public/argo-rollouts that referenced this issue Feb 10, 2025
…goproj#3775)

* feat: add rollout-transform-2023-10-09.yaml which has been adapted for kustomize v5

Signed-off-by: Jethro Lee <[email protected]>

* Rename to rollout-transform-kustomize-v5.yaml

Signed-off-by: Hidetake Iwata <[email protected]>

* Add link to doc

Signed-off-by: Hidetake Iwata <[email protected]>

---------

Signed-off-by: Jethro Lee <[email protected]>
Signed-off-by: Hidetake Iwata <[email protected]>
Co-authored-by: Jethro Lee <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants