-
-
Notifications
You must be signed in to change notification settings - Fork 727
feat: K8S KYAML output format support #2560
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
base: master
Are you sure you want to change the base?
Conversation
Reference: https://github.com/kubernetes/enhancements/blob/master/keps/sig-cli/5295-kyaml/README.md Co-authored-by: Codex <codex@openai.com> Generated-with: OpenAI Codex CLI (partial) Signed-off-by: Robin H. Johnson <rjohnson@coreweave.com>
Signed-off-by: Robin H. Johnson <rjohnson@coreweave.com>
| edwinjhlee | ||
| flox | ||
| flox | ||
| unlabeled |
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.
unlabelled (double l) for UK english, which this project's locale
| } | ||
|
|
||
| for _, s := range scenarios { | ||
| testKYamlScenario(t, s) |
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.
Add 'documentScenarios' here so we can generate docs based off these tests :)
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.
You'll also need to add a header/kyaml.md (see the other formats for examples 👍🏼 )
|
|
||
| .PHONY: build/dev | ||
| build/dev: test *.go | ||
| build/dev: *.go |
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.
this accidental? pls revert
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.
will revert for now; but I was finding it hindered rapid development. I do want to test - but the slow test targets in the Makefile shouldn't be a pre-req for a quick development build.
| return nil | ||
| } | ||
|
|
||
| func (ke *kyamlEncoder) PrintLeadingContent(writer io.Writer, content string) error { |
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.
is this the same logic as the yaml encoder? Could it be pulled out into a common function?
| " ],\n" + | ||
| " # trailing\n" + | ||
| "}\n", | ||
| }, |
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.
good to add some more tests in here, plain scalars, maybe converting from yaml to kyaml to show the difference (particularly when you add documentScenarios in.
|
Nice work codex + @robbat2 - couple of comments to resolve |
|
Oh other thing to add are the compiler directives to allow for minimal builds (e..g |
Reference: https://github.com/kubernetes/enhancements/blob/master/keps/sig-cli/5295-kyaml/README.md
Co-authored-by: Codex codex@openai.com
Generated-with: OpenAI Codex CLI (partial)
Signed-off-by: Robin H. Johnson rjohnson@coreweave.com