Skip to content

use sigs.k8s.io/yaml for edit sub commands to retain camel case - #390

Draft
TLINDEN wants to merge 1 commit into
masterfrom
fix-postgres-edit-validate-yaml
Draft

TLINDEN wants to merge 1 commit into
masterfrom
fix-postgres-edit-validate-yaml

Conversation

@TLINDEN

@TLINDEN TLINDEN commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

When using subcommands like cloudctl postgres edit .. all camelcased yaml fields were converted to lowercase. This was consistent insofar as this worked in both directions. However, cloudctl postgres describe -o yaml .. produced camelcased yaml output, which one could not copy/paste into an edit session because the marshaller expected lower case yaml fields.

This PR proposes to use sigs.k8s.io/yaml for the edit subcommands. This yaml module converts to JSON before converting that to Yaml and due to the JSON-tags on our structs camelcase will be preserved this way.

In order for this to work, I also had to modify helpers.ReadFrom(). Since sigs.k8s.io/yaml has no Decoder I had to change it so, that it splits the input into separate yaml documents directly using bufio.Scanner and bytes.Split().

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.

1 participant