Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 for NewSerializer (0.18 sec)

  1. staging/src/k8s.io/apiserver/pkg/endpoints/filters/request_deadline_test.go

    			withDeadline := WithRequestDeadline(handler, fakeSink, fakeRuleEvaluator,
    				func(_ *http.Request, _ *request.RequestInfo) bool { return test.longRunning },
    				newSerializer(), requestTimeoutMaximum)
    			withDeadline = WithRequestInfo(withDeadline, &fakeRequestResolver{})
    
    			testRequest := newRequest(t, test.requestURL)
    
    			// make sure a default request does not have any deadline set
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Oct 14 23:04:34 UTC 2022
    - 16.7K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apimachinery/pkg/runtime/serializer/cbor/cbor_test.go

    			recognizes: true,
    		},
    		{
    			in:         []byte{0xff, 0xff, 0xff, 0x01, 0x02, 0x03},
    			recognizes: false,
    		},
    	} {
    		t.Run(hex.EncodeToString(tc.in), func(t *testing.T) {
    			s := NewSerializer(nil, nil)
    			recognizes, unknown, err := s.RecognizesData(tc.in)
    			if recognizes != tc.recognizes {
    				t.Errorf("expected recognized to be %t, got %t", tc.recognizes, recognizes)
    			}
    			if unknown {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon May 13 14:57:12 UTC 2024
    - 20.1K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apimachinery/pkg/api/apitesting/roundtrip/roundtrip.go

    	typeAcc.SetKind(externalGVK.Kind)
    	typeAcc.SetAPIVersion(externalGVK.GroupVersion().String())
    
    	roundTrip(t, scheme, json.NewSerializer(json.DefaultMetaFactory, scheme, scheme, false), object)
    
    	// TODO remove this hack after we're past the intermediate steps
    	if !skipProtobuf {
    		roundTrip(t, scheme, protobuf.NewSerializer(scheme, scheme), object)
    	}
    }
    
    // roundTrip applies a single round-trip test to the given runtime object
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 12 15:48:03 UTC 2023
    - 16.8K bytes
    - Viewed (0)
  4. staging/src/k8s.io/apimachinery/pkg/runtime/serializer/json/json.go

    	utilyaml "k8s.io/apimachinery/pkg/util/yaml"
    	"k8s.io/klog/v2"
    )
    
    // NewSerializer creates a JSON serializer that handles encoding versioned objects into the proper JSON form. If typer
    // is not nil, the object has the group, version, and kind fields set.
    // Deprecated: use NewSerializerWithOptions instead.
    func NewSerializer(meta MetaFactory, creater runtime.ObjectCreater, typer runtime.ObjectTyper, pretty bool) *Serializer {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Mar 25 16:08:07 UTC 2022
    - 12K bytes
    - Viewed (0)
  5. staging/src/k8s.io/apimachinery/pkg/api/apitesting/roundtrip/compatibility.go

    			t.Fatal(err)
    		}
    		c.FilledObjects[gvk] = obj
    	}
    
    	if c.JSON == nil {
    		c.JSON = json.NewSerializer(json.DefaultMetaFactory, c.Scheme, c.Scheme, true)
    	}
    	if c.YAML == nil {
    		c.YAML = json.NewYAMLSerializer(json.DefaultMetaFactory, c.Scheme, c.Scheme)
    	}
    	if c.Proto == nil {
    		c.Proto = protobuf.NewSerializer(c.Scheme, c.Scheme)
    	}
    
    	return c
    }
    
    func (c *CompatibilityTestOptions) Run(t *testing.T) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Mar 08 16:38:32 UTC 2023
    - 17.8K bytes
    - Viewed (0)
  6. staging/src/k8s.io/apimachinery/pkg/runtime/serializer/protobuf/protobuf.go

    	return err != nil && ok
    }
    
    // NewSerializer creates a Protobuf serializer that handles encoding versioned objects into the proper wire form. If a typer
    // is passed, the encoded object will have group, version, and kind fields set. If typer is nil, the objects will be written
    // as-is (any type info passed with the object will be used).
    func NewSerializer(creater runtime.ObjectCreater, typer runtime.ObjectTyper) *Serializer {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Feb 23 13:38:23 UTC 2022
    - 17.8K bytes
    - Viewed (0)
  7. staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/objectmeta/coerce_test.go

    	clientgoscheme "k8s.io/client-go/kubernetes/scheme"
    )
    
    func TestRoundtripObjectMeta(t *testing.T) {
    	scheme := runtime.NewScheme()
    	codecs := serializer.NewCodecFactory(scheme)
    	codec := json.NewSerializer(json.DefaultMetaFactory, scheme, scheme, false)
    	seed := rand.Int63()
    	fuzzer := fuzzer.FuzzerFor(metafuzzer.Funcs, rand.NewSource(seed), codecs)
    
    	N := 1000
    	for i := 0; i < N; i++ {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 12 15:48:03 UTC 2023
    - 12.7K bytes
    - Viewed (0)
  8. staging/src/k8s.io/apimachinery/pkg/runtime/serializer/codec_factory.go

    	)
    	strictYAMLSerializer := json.NewSerializerWithOptions(
    		mf, scheme, scheme,
    		json.SerializerOptions{Yaml: true, Pretty: false, Strict: true},
    	)
    	protoSerializer := protobuf.NewSerializer(scheme, scheme)
    	protoRawSerializer := protobuf.NewRawSerializer(scheme, scheme)
    
    	serializers := []serializerType{
    		jsonSerializerType,
    		{
    			AcceptContentTypes: []string{runtime.ContentTypeYAML},
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sun Dec 18 04:27:38 UTC 2022
    - 12.6K bytes
    - Viewed (0)
  9. pkg/api/testing/unstructured_test.go

    				jsonSerializer := jsonserializer.NewSerializerWithOptions(jsonserializer.DefaultMetaFactory, legacyscheme.Scheme, legacyscheme.Scheme, jsonserializer.SerializerOptions{})
    				cborSerializer := cborserializer.NewSerializer(legacyscheme.Scheme, legacyscheme.Scheme)
    
    				// original->JSON->Unstructured
    				buf.Reset()
    				if err := jsonSerializer.Encode(item, &buf); err != nil {
    					t.Fatalf("error encoding native to json: %v", err)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 29 21:48:10 UTC 2024
    - 16.9K bytes
    - Viewed (0)
  10. staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/mutating/dispatcher.go

    		return false, apierrors.NewInternalError(fmt.Errorf("admission webhook %q attempted to modify the object, which is not supported for this operation", h.Name))
    	}
    
    	var patchedJS []byte
    	jsonSerializer := json.NewSerializer(json.DefaultMetaFactory, o.GetObjectCreater(), o.GetObjectTyper(), false)
    	switch result.PatchType {
    	// VerifyAdmissionResponse normalizes to v1 patch types, regardless of the AdmissionReview version used
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue May 28 08:48:22 UTC 2024
    - 19.6K bytes
    - Viewed (0)
Back to top