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

Update go-yaml with changes to indentation style #182

Merged
merged 1 commit into from Jun 9, 2021

Conversation

stefanprodan
Copy link
Member

@stefanprodan stefanprodan commented Jun 9, 2021

This PR updates the YAML packages (used by the controller to patch Kubernetes manifests) to fix long standing issues like panics that make the controller unusable for many users.

Dependencies changes:

Breaking change

The gopkg.in/yaml.v3 update means that the indentation style changed:

From:

spec:
  containers:
  - name: one
    image: image1:v1.0.0 # {"$imagepolicy": "automation-ns:policy1"}
  - name: two
    image: image2:v1.0.0 # {"$imagepolicy": "automation-ns:policy2"}

To:

spec:
  containers:
    - name: one
      image: image1:v1.0.0 # {"$imagepolicy": "automation-ns:policy1"}
    - name: two
      image: image2:v1.0.0 # {"$imagepolicy": "automation-ns:policy2"}

While Kustomize kyaml is using an older version of go-yaml we can't hold onto this forever. I find it unacceptable for Flux to keep crashing due to bugs fixed upstream in go-yaml. Kustomize may chose to delay this update (see kubernetes-sigs/kustomize#3789 and kubernetes-sigs/kustomize#3946) but this doesn't mean we are obliged to do the same. The image automation is alpha and breaking changes like this are acceptable considering the tradeoffs. I hope at some point, go-yaml will be able to detect and preserve the original indentation but it seems unlikely go-yaml/yaml#661 (comment)

Closes #92

gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
Copy link
Member

@hiddeco hiddeco left a comment

Choose a reason for hiding this comment

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

While Kustomize kyaml is using an older version of go-yaml we can't hold onto this forever. I find it unacceptable for Flux to keep crashing due to bugs fixed upstream in go-yaml.

I do agree, and think that the number of issues it resolves outweigh the breaking change introduces.

👍 from me.

Copy link
Member

@squaremo squaremo left a comment

Choose a reason for hiding this comment

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

Meta-approval (I trust the other reviewer(s)): I am fine with the breaking change, so long as we flag it prominently, of course.

@stefanprodan stefanprodan merged commit 9ed4051 into main Jun 9, 2021
@stefanprodan stefanprodan deleted the go-yaml-update branch June 9, 2021 12:59
@stefanprodan stefanprodan mentioned this pull request Jun 10, 2021
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.

controller crash when patching YAMLs with non-ASCII characters kyaml upstream bugs
3 participants