Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 30 for PrintObj (0.14 sec)

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

    	expectedErrors := sets.NewString("emptyPodList", "nonEmptyPodList", "endpoints")
    
    	for oName, obj := range objects {
    		b := &bytes.Buffer{}
    		if err := jsonpathPrinter.PrintObj(obj, b); err != nil {
    			if expectedErrors.Has(oName) {
    				// expected error
    				continue
    			}
    			t.Errorf("JSONPathPrinter error object '%v'; error: '%v'", oName, err)
    		}
    	}
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 15 21:58:20 UTC 2020
    - 2.1K bytes
    - Viewed (0)
  2. staging/src/k8s.io/cli-runtime/pkg/printers/yaml.go

    // The input object is assumed to be in the internal version of an API and is converted
    // to the given version first.
    // If PrintObj() is called multiple times, objects are separated with a '---' separator.
    type YAMLPrinter struct {
    	printCount int64
    }
    
    // PrintObj prints the data as YAML.
    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.
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Jun 02 14:15:25 UTC 2022
    - 2.5K bytes
    - Viewed (0)
  3. staging/src/k8s.io/cli-runtime/pkg/printers/managedfields_test.go

    	v1 "k8s.io/api/core/v1"
    	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
    	"k8s.io/apimachinery/pkg/runtime"
    )
    
    type testResourcePrinter func(object runtime.Object, writer io.Writer) error
    
    func (p testResourcePrinter) PrintObj(o runtime.Object, w io.Writer) error {
    	return p(o, w)
    }
    
    func TestOmitManagedFieldsPrinter(t *testing.T) {
    	testCases := []struct {
    		name     string
    		object   runtime.Object
    		expected runtime.Object
    	}{
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Feb 16 14:52:03 UTC 2021
    - 2.6K bytes
    - Viewed (0)
  4. 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)
  5. staging/src/k8s.io/cli-runtime/pkg/genericclioptions/template_flags_test.go

    				}
    				return
    			}
    			if err != nil {
    				t.Fatalf("unexpected error: %v", err)
    			}
    
    			out := bytes.NewBuffer([]byte{})
    			err = p.PrintObj(testObject, out)
    			if err != nil {
    				t.Errorf("unexpected error: %v", err)
    			}
    
    			if len(out.String()) != len(tc.expectedOutput) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Jun 02 09:47:52 UTC 2023
    - 5.9K bytes
    - Viewed (0)
  6. staging/src/k8s.io/cli-runtime/pkg/printers/template.go

    func (p *GoTemplatePrinter) AllowMissingKeys(allow bool) {
    	if allow {
    		p.template.Option("missingkey=default")
    	} else {
    		p.template.Option("missingkey=error")
    	}
    }
    
    // PrintObj formats the obj with the Go Template.
    func (p *GoTemplatePrinter) PrintObj(obj runtime.Object, w io.Writer) error {
    	if InternalObjectPreventer.IsForbidden(reflect.Indirect(reflect.ValueOf(obj)).Type().PkgPath()) {
    		return fmt.Errorf(InternalObjectPrinterErr)
    	}
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Mar 07 23:00:24 UTC 2019
    - 3.4K bytes
    - Viewed (0)
  7. staging/src/k8s.io/cli-runtime/pkg/printers/jsonpath.go

    	if err := j.Parse(tmpl); err != nil {
    		return nil, err
    	}
    	return &JSONPathPrinter{
    		rawTemplate: tmpl,
    		JSONPath:    j,
    	}, nil
    }
    
    // PrintObj formats the obj with the JSONPath Template.
    func (j *JSONPathPrinter) PrintObj(obj runtime.Object, w io.Writer) error {
    	// we use reflect.Indirect here in order to obtain the actual value from a pointer.
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat Jun 25 16:23:43 UTC 2022
    - 4.3K bytes
    - Viewed (0)
  8. 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)
  9. 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)
  10. 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)
Back to top