Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 13 for DropDisabledFields (0.28 sec)

  1. pkg/registry/core/configmap/strategy.go

    var _ rest.RESTUpdateStrategy = Strategy
    
    func (strategy) NamespaceScoped() bool {
    	return true
    }
    
    func (strategy) PrepareForCreate(ctx context.Context, obj runtime.Object) {
    	configMap := obj.(*api.ConfigMap)
    	dropDisabledFields(configMap, nil)
    }
    
    func (strategy) Validate(ctx context.Context, obj runtime.Object) field.ErrorList {
    	cfg := obj.(*api.ConfigMap)
    
    	return validation.ValidateConfigMap(cfg)
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Feb 27 20:38:11 UTC 2023
    - 3.7K bytes
    - Viewed (0)
  2. pkg/registry/core/secret/strategy.go

    var _ = rest.RESTUpdateStrategy(Strategy)
    
    func (strategy) NamespaceScoped() bool {
    	return true
    }
    
    func (strategy) PrepareForCreate(ctx context.Context, obj runtime.Object) {
    	secret := obj.(*api.Secret)
    	dropDisabledFields(secret, nil)
    }
    
    func (strategy) Validate(ctx context.Context, obj runtime.Object) field.ErrorList {
    	return validation.ValidateSecret(obj.(*api.Secret))
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Feb 27 20:38:11 UTC 2023
    - 4.2K bytes
    - Viewed (0)
  3. pkg/registry/policy/poddisruptionbudget/strategy.go

    	}
    	return false
    }
    
    // dropDisabledFields removes disabled fields from the pod disruption budget spec.
    // This should be called from PrepareForCreate/PrepareForUpdate for all resources containing a pod disruption budget spec.
    func dropDisabledFields(pdbSpec, oldPDBSpec *policy.PodDisruptionBudgetSpec) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Nov 10 22:25:42 UTC 2022
    - 8.1K bytes
    - Viewed (0)
  4. staging/src/k8s.io/apiextensions-apiserver/pkg/registry/customresourcedefinition/strategy.go

    	return generic.ObjectMetaFieldsSet(&obj.ObjectMeta, true)
    }
    
    // dropDisabledFields drops disabled fields that are not used if their associated feature gates
    // are not enabled.
    func dropDisabledFields(newCRD *apiextensions.CustomResourceDefinition, oldCRD *apiextensions.CustomResourceDefinition) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Feb 28 19:06:46 UTC 2024
    - 10.3K bytes
    - Viewed (0)
  5. pkg/registry/core/node/strategy.go

    	node := obj.(*api.Node)
    	dropDisabledFields(node, nil)
    }
    
    // PrepareForUpdate clears fields that are not allowed to be set by end users on update.
    func (nodeStrategy) PrepareForUpdate(ctx context.Context, obj, old runtime.Object) {
    	newNode := obj.(*api.Node)
    	oldNode := old.(*api.Node)
    	newNode.Status = oldNode.Status
    
    	dropDisabledFields(newNode, oldNode)
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Mar 13 23:06:39 UTC 2024
    - 9K bytes
    - Viewed (0)
  6. pkg/api/persistentvolumeclaim/util.go

    	deprecatedStorageClassAnnotationsMsg        = `deprecated since v1.8; use "storageClassName" attribute instead`
    )
    
    // DropDisabledFields removes disabled fields from the pvc spec.
    // This should be called from PrepareForCreate/PrepareForUpdate for all resources containing a pvc spec.
    func DropDisabledFields(pvcSpec, oldPVCSpec *core.PersistentVolumeClaimSpec) {
    	// Drop the contents of the volumeAttributesClassName if the VolumeAttributesClass
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Oct 31 03:18:56 UTC 2023
    - 8.3K bytes
    - Viewed (0)
  7. pkg/registry/core/persistentvolumeclaim/strategy.go

    func (persistentvolumeclaimStrategy) PrepareForCreate(ctx context.Context, obj runtime.Object) {
    	pvc := obj.(*api.PersistentVolumeClaim)
    	pvc.Status = api.PersistentVolumeClaimStatus{}
    	pvcutil.DropDisabledFields(&pvc.Spec, nil)
    
    	// For data sources, we need to do 2 things to implement KEP 1495
    
    	// First drop invalid values from spec.dataSource (anything other than PVC or
    	// VolumeSnapshot) if certain conditions are met.
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Nov 09 20:58:25 UTC 2022
    - 7.8K bytes
    - Viewed (0)
  8. pkg/api/pod/util_test.go

    					var oldPodSpec *api.PodSpec
    					if oldPod != nil {
    						oldPodSpec = &oldPod.Spec
    					}
    					dropDisabledFields(&newPod.Spec, nil, oldPodSpec, nil)
    
    					// old pod should never be changed
    					if !reflect.DeepEqual(oldPod, oldPodInfo.pod()) {
    						t.Errorf("old pod changed: %v", cmp.Diff(oldPod, oldPodInfo.pod()))
    					}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 29 22:40:29 UTC 2024
    - 108.8K bytes
    - Viewed (0)
  9. pkg/api/persistentvolumeclaim/util_test.go

    				if !reflect.DeepEqual(newpvc, newpvcInfo.pvc()) {
    					t.Errorf("new pvc changed: %v", cmp.Diff(newpvc, newpvcInfo.pvc()))
    				}
    			})
    		}
    	}
    }
    
    // TestPVCDataSourceSpecFilter checks to ensure the DropDisabledFields function behaves correctly for PVCDataSource featuregate
    func TestPVCDataSourceSpecFilter(t *testing.T) {
    	apiGroup := ""
    	validSpec := core.PersistentVolumeClaimSpec{
    		DataSource: &core.TypedLocalObjectReference{
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 24 18:25:29 UTC 2024
    - 27.9K bytes
    - Viewed (0)
  10. pkg/registry/core/node/strategy_test.go

    			node:        makeNode(nil, true, true),
    			oldNode:     makeNode(nil, false, true),
    			compareNode: makeNode(nil, false, true),
    		},
    	}
    
    	for _, tc := range testCases {
    		func() {
    			dropDisabledFields(tc.node, tc.oldNode)
    
    			old := tc.oldNode.DeepCopy()
    			// old node  should never be changed
    			if !reflect.DeepEqual(tc.oldNode, old) {
    				t.Errorf("%v: old node changed: %v", tc.name, cmp.Diff(tc.oldNode, old))
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 12 15:48:03 UTC 2023
    - 9.7K bytes
    - Viewed (0)
Back to top