code: func (p *YAMLPrinter) PrintObj(obj runtime.Object, w io.Writer) error {
  	// we use reflect.Indirect here in order to obtain the actual value from a pointer.
  	// we need an actual value in order to retrieve the package path for an object.
  	// using reflect.Indirect indiscriminately is valid here, as all runtime.Objects are supposed to be pointers.
  	if InternalObjectPreventer.IsForbidden(reflect.Indirect(reflect.ValueOf(obj)).Type().PkgPath()) {
  		return fmt.Errorf(InternalObjectPrinterErr)
  	}
  
  	switch obj := obj.(type) {
  	case *runtime.Unknown:
  		data, err := yaml.JSONToYAML(obj.Raw)
  		if err != nil {
  			return err
  		}
  		_, err = w.Write(data)
  		return err
  	}
  
  	if obj.GetObjectKind().GroupVersionKind().Empty() {
  		return fmt.Errorf("missing apiVersion or kind; try GetObjectKind().SetGroupVersionKind() if you know the type")
  	}
  
  	output, err := yaml.Marshal(obj)
  	if err != nil {
  		return err
  	}
  	_, err = fmt.Fprint(w, string(output))
  	return err
  }
docs: // PrintObj prints the data as YAML.