kubectl: 'apply view-last-applied' must not use printf(), as this will cause format codes in the YAML/JSON to be interpreted.

This commit is contained in:
Alexander Staubo 2017-05-10 16:17:12 -04:00
parent 3ddbed969b
commit 4f8cbc15ac

View File

@ -143,13 +143,13 @@ func (o *ViewLastAppliedOptions) RunApplyViewLastApplied() error {
if err != nil {
return err
}
fmt.Fprintf(o.Out, string(jsonBuffer.Bytes()))
fmt.Fprint(o.Out, string(jsonBuffer.Bytes()))
case "yaml":
yamlOutput, err := yaml.JSONToYAML([]byte(str))
if err != nil {
return err
}
fmt.Fprintf(o.Out, string(yamlOutput))
fmt.Fprint(o.Out, string(yamlOutput))
}
}