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

Handle parsing of bare sequence yaml nodes #4189

Merged

Conversation

phanimarupaka
Copy link
Contributor

kyaml uses reader annotations to track resources for reading and writing back, it is not possible to add reader annotations to bare sequence nodes, this PR introduces a way to wrap/unwrap such nodes for smooth yaml processing.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Sep 17, 2021
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Sep 17, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: phanimarupaka

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 17, 2021
@natasha41575
Copy link
Contributor

/cc @KnVerey

@natasha41575
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 20, 2021
@k8s-ci-robot k8s-ci-robot merged commit 1cb9312 into kubernetes-sigs:master Sep 20, 2021
Copy link
Contributor

@droot droot left a comment

Choose a reason for hiding this comment

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

Mostly looking good, have a few comments.

kyaml/kio/byteio_reader.go Show resolved Hide resolved
kyaml/kio/byteio_reader.go Show resolved Hide resolved
kyaml/kio/byteio_readwriter_test.go Show resolved Hide resolved
@KnVerey
Copy link
Contributor

KnVerey commented Sep 21, 2021

Could you provide an example to illustrate in what contexts this is needed? How could a resource be a bare sequence node?

@phanimarupaka
Copy link
Contributor Author

phanimarupaka commented Sep 21, 2021

Could you provide an example to illustrate in what contexts this is needed? How could a resource be a bare sequence node?

Here is an example valid YAML node(Kustomization patch) https://github.com/kubeflow/manifests/blob/master/apps/jupyter/notebook-controller/upstream/crd/patches/old_crd.yaml

@KnVerey
Copy link
Contributor

KnVerey commented Sep 21, 2021

Thanks! I still don't quite understand the use case though--the description says "kyaml uses reader annotations to track resources for reading and writing back" and that inability to annotate bare sequence nodes is a problem, but your example is a JSON patch not a resource. What reader annotations do you need to apply to a patch like that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants