mirror of https://github.com/k3s-io/k3s
kubectl: 'apply view-last-applied' must not use printf(), as this will cause format codes in the YAML/JSON to be interpreted.
parent
3ddbed969b
commit
4f8cbc15ac
|
@ -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))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue