Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for PrintObj (0.13 sec)

  1. staging/src/k8s.io/cli-runtime/pkg/printers/tableprinter_test.go

    		table := &metav1.Table{
    			ColumnDefinitions: test.columns,
    			Rows:              test.rows,
    		}
    		// Print the table
    		out := bytes.NewBuffer([]byte{})
    		printer := NewTablePrinter(test.options)
    		printer.PrintObj(table, out)
    
    		// Validate the printed table is empty.
    		if len(out.String()) > 0 {
    			t.Errorf("Error Printing Table. Should be empty; got (%s)", out.String())
    		}
    	}
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sun Oct 30 15:08:43 UTC 2022
    - 24.4K bytes
    - Viewed (0)
  2. cmd/kubeadm/app/cmd/config.go

    	cfg *kubeadmapi.InitConfiguration
    }
    
    // imageTextPrinter prints image info in a text form
    type imageTextPrinter struct {
    	output.TextPrinter
    }
    
    // PrintObj is an implementation of ResourcePrinter.PrintObj for plain text output
    func (itp *imageTextPrinter) PrintObj(obj runtime.Object, writer io.Writer) error {
    	var err error
    	if imgs, ok := obj.(*outputapiv1alpha3.Images); ok {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 29 06:58:01 UTC 2024
    - 18.9K bytes
    - Viewed (0)
  3. cmd/kubeadm/app/cmd/upgrade/plan.go

    }
    
    // upgradePlanTextPrinter prints upgrade plan in a text form
    type upgradePlanTextPrinter struct {
    	output.TextPrinter
    }
    
    // PrintObj is an implementation of ResourcePrinter.PrintObj for upgrade plan plain text output
    func (printer *upgradePlanTextPrinter) PrintObj(obj runtime.Object, writer io.Writer) error {
    	plan, ok := obj.(*outputapiv1alpha3.UpgradePlan)
    	if !ok {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sun Mar 03 03:03:29 UTC 2024
    - 14.9K bytes
    - Viewed (0)
  4. cmd/kubeadm/app/cmd/token.go

    type tokenTextPrinter struct {
    	output.TextPrinter
    	columns         []string
    	headerIsPrinted bool
    }
    
    // PrintObj is an implementation of ResourcePrinter.PrintObj for plain text output
    func (ttp *tokenTextPrinter) PrintObj(obj runtime.Object, writer io.Writer) error {
    	tabw := tabwriter.NewWriter(writer, 10, 4, 3, ' ', 0)
    
    	// Print header
    	if !ttp.headerIsPrinted {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Apr 23 05:47:48 UTC 2024
    - 15.9K bytes
    - Viewed (0)
  5. staging/src/k8s.io/cli-runtime/pkg/printers/tableprinter.go

    func NewTablePrinter(options PrintOptions) ResourcePrinter {
    	printer := &HumanReadablePrinter{
    		options: options,
    	}
    	return printer
    }
    
    func printHeader(columnNames []string, w io.Writer) error {
    	if _, err := fmt.Fprintf(w, "%s\n", strings.Join(columnNames, "\t")); err != nil {
    		return err
    	}
    	return nil
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sun Oct 30 15:08:43 UTC 2022
    - 16.7K bytes
    - Viewed (0)
  6. cmd/kubeadm/app/cmd/certs.go

    }
    
    // certsTextPrinter prints all certificates in a text form
    type certTextPrinter struct {
    	output.TextPrinter
    }
    
    // PrintObj is an implementation of ResourcePrinter.PrintObj for plain text output
    func (p *certTextPrinter) PrintObj(obj runtime.Object, writer io.Writer) error {
    	info, ok := obj.(*outputapiv1alpha3.CertificateExpirationInfo)
    	if !ok {
    		return errors.New("unexpected type")
    	}
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 01 16:01:49 UTC 2024
    - 19.4K bytes
    - Viewed (0)
  7. cmd/kubeadm/app/cmd/upgrade/plan_test.go

    			printer, err := outputFlags.ToPrinter()
    			if err != nil {
    				t.Errorf("failed ToPrinter, err: %+v", err)
    			}
    
    			plan := genUpgradePlan(rt.upgrades, rt.versionStates)
    			if err := printer.PrintObj(plan, rt.buf); err != nil {
    				t.Errorf("unexpected error when print object: %v", err)
    			}
    
    			actualBytes := rt.buf.Bytes()
    			if !bytes.Equal(actualBytes, rt.expectedBytes) {
    				t.Errorf(
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sun Mar 03 03:03:29 UTC 2024
    - 27.3K bytes
    - Viewed (0)
  8. cmd/kubeadm/app/cmd/token_test.go

    			printer, err := outputFlags.ToPrinter()
    			if err != nil {
    				t.Errorf("can't create printer for output format %s: %+v", tc.outputFormat, err)
    			}
    
    			if err := printer.PrintObj(&token, &buf); err != nil {
    				t.Errorf("unable to print token %s: %+v", token.Token, err)
    			}
    
    			actual := buf.String()
    			if actual != tc.expected {
    				t.Errorf(
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Apr 23 05:47:48 UTC 2024
    - 13.6K bytes
    - Viewed (0)
Back to top