diff --git a/staging/src/k8s.io/cli-runtime/pkg/printers/yaml.go b/staging/src/k8s.io/cli-runtime/pkg/printers/yaml.go index 1d636ba7404..9c444bdc265 100644 --- a/staging/src/k8s.io/cli-runtime/pkg/printers/yaml.go +++ b/staging/src/k8s.io/cli-runtime/pkg/printers/yaml.go @@ -17,7 +17,6 @@ limitations under the License. package printers import ( - "encoding/json" "fmt" "io" "reflect" @@ -58,11 +57,7 @@ func (p *YAMLPrinter) PrintObj(obj runtime.Object, w io.Writer) error { if InternalObjectPreventer.IsForbidden(reflect.Indirect(reflect.ValueOf(obj.Object.Object)).Type().PkgPath()) { return fmt.Errorf(InternalObjectPrinterErr) } - data, err := json.Marshal(obj) - if err != nil { - return err - } - data, err = yaml.JSONToYAML(data) + data, err := yaml.Marshal(obj) if err != nil { return err }