From 4f8cbc15ac1870e0f979654c74f18c3d4bb425da Mon Sep 17 00:00:00 2001 From: Alexander Staubo Date: Wed, 10 May 2017 16:17:12 -0400 Subject: [PATCH] kubectl: 'apply view-last-applied' must not use printf(), as this will cause format codes in the YAML/JSON to be interpreted. --- pkg/kubectl/cmd/apply_view_last_applied.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/kubectl/cmd/apply_view_last_applied.go b/pkg/kubectl/cmd/apply_view_last_applied.go index 1461a143a83..4f2b753555e 100644 --- a/pkg/kubectl/cmd/apply_view_last_applied.go +++ b/pkg/kubectl/cmd/apply_view_last_applied.go @@ -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)) } }