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

Simplify Plan resource #3182

Merged
merged 1 commit into from Jun 2, 2022
Merged

Simplify Plan resource #3182

merged 1 commit into from Jun 2, 2022

Conversation

mortent
Copy link
Contributor

@mortent mortent commented May 16, 2022

Follow up on some of the comments from #3123:

  • The property containing the resource from before the apply operation has been renamed from before to original, and the one containing the resource after the apply (i.e. the resource returned by the APIServer on a dry-run) is renamed from after to updated.
  • The original and updated properties no longer contains a nested object property (as a result of marshaling an Unstructured object), but contains the resources directly underneath.
  • The KRM output is generated directly with kyaml and we no longer provide an exported Plan type.

ioStreams genericclioptions.IOStreams,
) error {
planResource, err := yaml.Parse(strings.TrimSpace(`
apiVersion: config.google.com/v1alpha1
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we use kpt.dev :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree. Updated to use kpt.dev/v1alpha1.

Copy link
Contributor

@justinsb justinsb left a comment

Choose a reason for hiding this comment

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

One question about why we're not doing normal marshalling, but LGTM

}
rn, err := yaml.Parse(string(b))

sNode, err := planResource.Pipe(yaml.LookupCreate(yaml.SequenceNode, "spec", "actions"))
Copy link
Contributor

Choose a reason for hiding this comment

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

Q: Why not use "normal" marshalling? Is it because we want to preserve comments in the yaml? Can we add a (code) comment?

@mortent mortent merged commit f44fdf1 into kptdev:main Jun 2, 2022
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.

None yet

3 participants