-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
DO NOT MERGE: demonstrate required changes for yaml update #4004
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: natasha41575 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@natasha41575: This PR has multiple commits, and the default merge method is: merge. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
kyaml/kio/filters/testdata/dataset1-expected/java/java-deployment.resource.yaml
Show resolved
Hide resolved
Are any changes required outside kyaml? Can you push the replace statement so that we can see the test suite state too? |
a04296e
to
9d3235f
Compare
/retest |
ddd5399
to
a2e7623
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.
Having examined all the changes in this PR, here's what I conclude so far.
There are two things that need to be addressed on @mikebz PR:
- Non-indent style sequences don't seem to be respecting custom indent. To see this, write a test with
SetIndent(4)
as well asSetIndentSequences(false)
. - Something very strange happens with nested lists, per https://github.com/kubernetes-sigs/kustomize/pull/4004/files?file-filters%5B%5D=.go&file-filters%5B%5D=.yaml#r653803898.
There are also two potentially concerning changes from the intermediate diff:
- Feature (v3): set the default line length to infinity (-1) go-yaml/yaml#572. I think this is a desirable improvement, and some may even consider it a bug fix. But is is a change that will cause a diff for some users, and we will need to make a judgement call on whether that warrants a major version bump for the CLI.
- The apparent loss of a newline from the source file here: https://github.com/kubernetes-sigs/kustomize/pull/4004/files?file-filters%5B%5D=.go&file-filters%5B%5D=.yaml#diff-a497b67d0a86cac8b63450bff25432f185a5bab7413ba04f67212a7d36241cffL185. Still need to dig further into this one.
9f2bbfc
to
9377267
Compare
Examples of what happens now:
Note: the above is the same output that you get if you use yaml.v3 at head with
Note: the above is the same output that you get if you use yaml.v3 at head with |
f838e1c
to
95a6b76
Compare
40d721f
to
c63d7a3
Compare
Awesome work on this! No concerns with what's left in the diff now. |
@@ -169,8 +169,8 @@ items: | |||
name: test | |||
app: nginx | |||
ports: | |||
# This i the port. |
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.
Comments are reordered here. Why?
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.
I think this is a bug fix. If you look at the input fixture above, the comments are in the new position, not the old:
- apiVersion: v1
kind: Service
metadata:
name: test
labels:
app: nginx
name: test
spec:
ports:
# This i the port.
- port: 8080
targetPort: 8080
name: http
selector:
app: nginx
name: test
@natasha41575 I tried your fork and here are the couple of issues I noticed.
Can you please verify and confirm? |
Are you referring to the changes visible in this PR? If so, the strings are not multi-line in the input. Previously, go-yaml wrapped after a certain string length, and the change is that it intentionally stopped doing that: go-yaml/yaml#572. Natasha and I discussed whether this means we need a new major version of Kustomize, but she found a previous case where essentially the same thing changed in a minor release in the past. If you're referring to something else, please provide an example.
I agree that's what I'd expect: if there are comments before a |
The commits here were merged in #4013 |
used the fork of yaml from this PR go-yaml/yaml#750 and updated the kyaml tests so that they pass
EDIT: Now points to the fork in go-yaml/yaml#753
tracking issue: #3946
this PR demonstrates what impact the change would have in kyaml
cc @mikebz
ALLOW_MODULE_SPAN