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

pull/6/head
Alexander Staubo 2017-05-10 16:17:12 -04:00
parent 3ddbed969b
commit 4f8cbc15ac
1 changed files with 2 additions and 2 deletions

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))
}
}