Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 for UnmarshalStrict (0.25 sec)

  1. operator/pkg/apis/istio/v1alpha1/deepcopy_test.go

    func TestIstioOperatorSpec_DeepCopy(t *testing.T) {
    	x := &v1alpha12.ResourceMetricSource{}
    	err := yaml.UnmarshalStrict([]byte("targetAverageValue: 100m"), x)
    	t.Log(x)
    	if err != nil {
    		t.Fatal(err)
    	}
    	y := &v1alpha12.MetricSpec{}
    	err = yaml.UnmarshalStrict([]byte(`
    type: Resource
    resource:
      targetAverageValue: 100m`), y)
    	t.Log(y)
    	if err != nil {
    		t.Fatal(err)
    	}
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Dec 05 23:34:13 UTC 2022
    - 3.4K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/objectmeta/coerce.go

    // throwing away fields which lead to errors.
    // If opts.ReturnedUnknownFields is true, it will UnmarshalStrict instead, returning the paths of any unknown fields
    // it encounters (i.e. paths returned as strict errs from UnmarshalStrict)
    func GetObjectMetaWithOptions(obj map[string]interface{}, opts ObjectMetaOptions) (*metav1.ObjectMeta, bool, []string, error) {
    	metadata, found := obj["metadata"]
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Jul 18 14:55:12 UTC 2022
    - 5.4K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apimachinery/pkg/util/yaml/decoder.go

    		return yaml.Unmarshal(data, v)
    	}
    }
    
    // UnmarshalStrict unmarshals the given data
    // strictly (erroring when there are duplicate fields).
    func UnmarshalStrict(data []byte, v interface{}) error {
    	preserveIntFloat := func(d *json.Decoder) *json.Decoder {
    		d.UseNumber()
    		return d
    	}
    	switch v := v.(type) {
    	case *map[string]interface{}:
    		if err := yaml.UnmarshalStrict(data, v, preserveIntFloat); err != nil {
    			return err
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Nov 19 21:24:36 UTC 2021
    - 10.2K bytes
    - Viewed (0)
  4. operator/pkg/apis/istio/common.go

    	if allowUnknownField {
    		if err := yaml.Unmarshal([]byte(iopYAML), iop); err != nil {
    			return nil, fmt.Errorf("could not unmarshal: %v", err)
    		}
    	} else {
    		if err := yaml.UnmarshalStrict([]byte(iopYAML), iop); err != nil {
    			return nil, fmt.Errorf("could not unmarshal: %v", err)
    		}
    	}
    	return iop, nil
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Mar 23 17:19:38 UTC 2022
    - 2K bytes
    - Viewed (0)
  5. cmd/batch-expire_test.go

      
      retry:
        attempts: 10 # number of retries for the job before giving up
        delay: 500ms # least amount of delay between each retry
    `
    	var job BatchJobRequest
    	err := yaml.UnmarshalStrict([]byte(expireYaml), &job)
    	if err != nil {
    		t.Fatal("Failed to parse batch-job-expire yaml", err)
    	}
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Thu Jan 18 07:03:17 UTC 2024
    - 3K bytes
    - Viewed (0)
  6. operator/pkg/helmreconciler/prune_test.go

    		// init two custom gateways with revision
    		gateways := [][]byte{iopTestGwData1, iopTestGwData2}
    		for i, data := range gateways {
    			iop := &v1alpha1.IstioOperator{}
    			err := yaml.UnmarshalStrict(data, iop)
    			assert.NoError(t, err)
    			h := &HelmReconciler{
    				client:     cl,
    				kubeClient: kube.NewFakeClientWithVersion("24"),
    				opts: &Options{
    					ProgressLog: progress.NewLog(),
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri Dec 15 12:13:37 UTC 2023
    - 5.2K bytes
    - Viewed (0)
  7. staging/src/k8s.io/apiserver/pkg/endpoints/handlers/patch.go

    	case types.JSONPatchType:
    		if p.validationDirective == metav1.FieldValidationStrict || p.validationDirective == metav1.FieldValidationWarn {
    			var v []jsonPatchOp
    			var err error
    			if strictErrors, err = kjson.UnmarshalStrict(p.patchBytes, &v); err != nil {
    				return nil, nil, errors.NewBadRequest(fmt.Sprintf("error decoding patch: %v", err))
    			}
    			for i, e := range strictErrors {
    				strictErrors[i] = fmt.Errorf("json patch %v", e)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue May 28 08:48:22 UTC 2024
    - 28.5K bytes
    - Viewed (0)
  8. staging/src/k8s.io/apimachinery/pkg/runtime/serializer/json/json.go

    		// to, so in order to detect strict JSON errors we need
    		// to unmarshal directly into the object.
    		m := map[string]interface{}{}
    		strictJSONErrs, err = kjson.UnmarshalStrict(data, &m)
    		u.SetUnstructuredContent(m)
    	} else {
    		strictJSONErrs, err = kjson.UnmarshalStrict(data, into)
    	}
    	if err != nil {
    		// fatal decoding error, not due to strictness
    		return nil, err
    	}
    	strictErrs = append(strictErrs, strictJSONErrs...)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Mar 25 16:08:07 UTC 2022
    - 12K bytes
    - Viewed (0)
  9. staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/validation/validation_test.go

    		openAPIJSON, err := json.Marshal(openAPITypes)
    		if err != nil {
    			t.Fatal(err)
    		}
    
    		// JSON -> in-memory JSON => convertNullTypeToNullable => JSON
    		var j interface{}
    		if strictErrs, err := kjson.UnmarshalStrict(openAPIJSON, &j); err != nil {
    			t.Fatal(err)
    		} else if len(strictErrs) > 0 {
    			t.Fatal(strictErrs)
    		}
    		j = stripIntOrStringType(j)
    		openAPIJSON, err = json.Marshal(j)
    		if err != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Jul 18 04:49:59 UTC 2023
    - 24.8K bytes
    - Viewed (0)
  10. operator/pkg/validate/common.go

    		un.SetCreationTimestamp(metav1.Time{}) // UnmarshalIstioOperator chokes on these
    		iopYAML = util.ToYAML(un)
    	}
    	iop := &v1alpha1.IstioOperator{}
    
    	if err := yaml.UnmarshalStrict([]byte(iopYAML), iop); err != nil {
    		return nil, fmt.Errorf("%s:\n\nYAML:\n%s", err, iopYAML)
    	}
    	return iop, nil
    }
    
    // ValidIOP validates the given IstioOperator object.
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Aug 10 15:35:03 UTC 2023
    - 11K bytes
    - Viewed (0)
Back to top