mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	Merge pull request #33686 from ymqytw/format_json_printer_for_runtime.Unknown
Automatic merge from submit-queue formatting json printer for runtime.Unknown Formatting JSONPrinter. It prints everything in one single line before. Now it prints in well-formatted way.
This commit is contained in:
		@@ -275,7 +275,13 @@ func (p *JSONPrinter) AfterPrint(w io.Writer, res string) error {
 | 
			
		||||
func (p *JSONPrinter) PrintObj(obj runtime.Object, w io.Writer) error {
 | 
			
		||||
	switch obj := obj.(type) {
 | 
			
		||||
	case *runtime.Unknown:
 | 
			
		||||
		_, err := w.Write(obj.Raw)
 | 
			
		||||
		var buf bytes.Buffer
 | 
			
		||||
		err := json.Indent(&buf, obj.Raw, "", "    ")
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			return err
 | 
			
		||||
		}
 | 
			
		||||
		buf.WriteRune('\n')
 | 
			
		||||
		_, err = buf.WriteTo(w)
 | 
			
		||||
		return err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user