-
Notifications
You must be signed in to change notification settings - Fork 104
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
Add --output parameter to plan status to allow json/yaml output #1634
Conversation
Signed-off-by: Andreas Neumann <aneumann@mesosphere.com>
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.
One nit but otherwise lgtm
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 would like to see a test here :) at least I can see how the output actually look like
pkg/kudoctl/cmd/plan/plan_status.go
Outdated
|
||
var o []byte | ||
if strings.ToLower(options.Output) == "yaml" { | ||
o, err = yaml.Marshal(instance.Status) |
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.
shouldn't we aim for something more user friendly then just serialized CRD status? 🤔
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.
That's a good question. I'm not sure what would be more user friendly though...
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.
the rest of k8s simply outputs the resource yaml - why would we convert? I'd rather leave it as is
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 would like to see a test here :) at least I can see how the output actually look like
@alenkacz Added tests :) And ended up refactoring this quite a bit. The output for yaml/json plan status is still the instance.status though.
It might be a good idea to use a separate data structure so we don't break clients if we end up changing the instance.status....
Add json output for kudo init Add tests for plan status with json/yaml output Signed-off-by: Andreas Neumann <aneumann@mesosphere.com>
…pe is given Signed-off-by: Andreas Neumann <aneumann@mesosphere.com>
Signed-off-by: Andreas Neumann <aneumann@mesosphere.com>
Signed-off-by: Andreas Neumann <aneumann@mesosphere.com>
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.
beautiful 🤟
Signed-off-by: Andreas Neumann aneumann@mesosphere.com
What this PR does / why we need it:
Add
--output
parameter tokudo plan status
to allow json/yaml output instead of human readable formatFixes #