Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 117 for ValidateUpdate (0.2 sec)

  1. pkg/registry/networking/ipaddress/strategy_test.go

    	if len(errs) != 0 {
    		t.Errorf("Unexpected error from validation for ipAddress: %v", errs)
    	}
    
    	newIPAddress := ipAddress.DeepCopy()
    	Strategy.PrepareForUpdate(ctx, newIPAddress, &ipAddress)
    	errs = Strategy.ValidateUpdate(ctx, newIPAddress, &ipAddress)
    	if len(errs) != 0 {
    		t.Errorf("Unexpected error from update validation for ipAddress: %v", errs)
    	}
    
    	invalidIPAddress := newIPAddress.DeepCopy()
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Jun 19 02:12:34 UTC 2023
    - 2.4K bytes
    - Viewed (0)
  2. pkg/registry/resource/podschedulingcontext/strategy_test.go

    		schedulingCtx := schedulingCtx.DeepCopy()
    		newSchedulingCtx := schedulingCtx.DeepCopy()
    		newSchedulingCtx.ResourceVersion = "4"
    
    		Strategy.PrepareForUpdate(ctx, newSchedulingCtx, schedulingCtx)
    		errs := Strategy.ValidateUpdate(ctx, newSchedulingCtx, schedulingCtx)
    		if len(errs) != 0 {
    			t.Errorf("unexpected validation errors: %v", errs)
    		}
    	})
    
    	t.Run("name-change-not-allowed", func(t *testing.T) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Mar 14 09:18:08 UTC 2023
    - 2.5K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apiserver/pkg/registry/rest/create_update.go

    	// whose presence would be considered a validation error.
    	PrepareForUpdate(ctx context.Context, obj, old runtime.Object)
    	// ValidateUpdate is invoked after default fields in the object have been
    	// filled in before the object is persisted.  This method should not mutate
    	// the object.
    	ValidateUpdate(ctx context.Context, obj, old runtime.Object) field.ErrorList
    	// WarningsOnUpdate returns warnings to the client performing the update.
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue May 18 14:42:36 UTC 2021
    - 3.4K bytes
    - Viewed (0)
  4. pkg/registry/resource/resourceclaimparameters/strategy_test.go

    		newObj := resourceClaimParameters.DeepCopy()
    		newObj.ResourceVersion = "4"
    
    		Strategy.PrepareForUpdate(ctx, newObj, resourceClaimParameters)
    		errs := Strategy.ValidateUpdate(ctx, newObj, resourceClaimParameters)
    		if len(errs) != 0 {
    			t.Errorf("unexpected validation errors: %v", errs)
    		}
    	})
    
    	t.Run("name-change-not-allowed", func(t *testing.T) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Mar 07 15:15:31 UTC 2024
    - 2.5K bytes
    - Viewed (0)
  5. pkg/registry/coordination/lease/strategy.go

    }
    
    // AllowCreateOnUpdate is true for Lease; this means you may create one with a PUT request.
    func (leaseStrategy) AllowCreateOnUpdate() bool {
    	return true
    }
    
    // ValidateUpdate is the default update validation for an end user.
    func (leaseStrategy) ValidateUpdate(ctx context.Context, obj, old runtime.Object) field.ErrorList {
    	return validation.ValidateLeaseUpdate(obj.(*coordination.Lease), old.(*coordination.Lease))
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue May 18 14:42:36 UTC 2021
    - 2.8K bytes
    - Viewed (0)
  6. pkg/registry/core/resourcequota/strategy.go

    }
    
    // AllowCreateOnUpdate is false for resourcequotas.
    func (resourcequotaStrategy) AllowCreateOnUpdate() bool {
    	return false
    }
    
    // ValidateUpdate is the default update validation for an end user.
    func (resourcequotaStrategy) ValidateUpdate(ctx context.Context, obj, old runtime.Object) field.ErrorList {
    	newObj, oldObj := obj.(*api.ResourceQuota), old.(*api.ResourceQuota)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Feb 18 17:07:29 UTC 2022
    - 4.7K bytes
    - Viewed (0)
  7. pkg/registry/core/namespace/strategy_test.go

    	if len(invalidNamespace.Spec.Finalizers) != 1 || invalidNamespace.Spec.Finalizers[0] != api.FinalizerKubernetes {
    		t.Errorf("PrepareForUpdate should have preserved old.spec.finalizers")
    	}
    	errs = Strategy.ValidateUpdate(ctx, invalidNamespace, namespace)
    	if len(errs) == 0 {
    		t.Errorf("Expected a validation error")
    	}
    	if invalidNamespace.ResourceVersion != "4" {
    		t.Errorf("Incoming resource version on update should not be mutated")
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Dec 07 08:51:17 UTC 2021
    - 6K bytes
    - Viewed (0)
  8. pkg/registry/apps/statefulset/strategy.go

    // AllowCreateOnUpdate is false for StatefulSet; this means POST is needed to create one.
    func (statefulSetStrategy) AllowCreateOnUpdate() bool {
    	return false
    }
    
    // ValidateUpdate is the default update validation for an end user.
    func (statefulSetStrategy) ValidateUpdate(ctx context.Context, obj, old runtime.Object) field.ErrorList {
    	newStatefulSet := obj.(*apps.StatefulSet)
    	oldStatefulSet := old.(*apps.StatefulSet)
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Nov 08 15:48:10 UTC 2022
    - 8.8K bytes
    - Viewed (0)
  9. pkg/registry/apiserverinternal/storageversion/strategy.go

    }
    
    // Does not allow creating a StorageVersion object with a PUT request.
    func (storageVersionStrategy) AllowCreateOnUpdate() bool {
    	return false
    }
    
    // ValidateUpdate is the default update validation for an end user.
    func (storageVersionStrategy) ValidateUpdate(ctx context.Context, obj, old runtime.Object) field.ErrorList {
    	newStorageVersion := obj.(*apiserverinternal.StorageVersion)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Jul 26 17:14:05 UTC 2022
    - 5.2K bytes
    - Viewed (0)
  10. pkg/registry/resource/resourceclaimtemplate/strategy_test.go

    		newClaimTemplate := resourceClaimTemplate.DeepCopy()
    		newClaimTemplate.ResourceVersion = "4"
    
    		Strategy.PrepareForUpdate(ctx, newClaimTemplate, resourceClaimTemplate)
    		errs := Strategy.ValidateUpdate(ctx, newClaimTemplate, resourceClaimTemplate)
    		if len(errs) != 0 {
    			t.Errorf("unexpected validation errors: %v", errs)
    		}
    	})
    
    	t.Run("name-change-not-allowed", func(t *testing.T) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Nov 10 19:08:24 UTC 2022
    - 2.7K bytes
    - Viewed (0)
Back to top