Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 17 of 17 for PrepareForUpdate (0.3 sec)

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

    	}
    
    	podutil.DropDisabledPodFields(pod, nil)
    
    	applySchedulingGatedCondition(pod)
    	mutatePodAffinity(pod)
    	applyAppArmorVersionSkew(ctx, pod)
    }
    
    // PrepareForUpdate clears fields that are not allowed to be set by end users on update.
    func (podStrategy) PrepareForUpdate(ctx context.Context, obj, old runtime.Object) {
    	newPod := obj.(*api.Pod)
    	oldPod := old.(*api.Pod)
    	newPod.Status = oldPod.Status
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Mar 07 17:51:48 UTC 2024
    - 29.8K bytes
    - Viewed (0)
  2. pkg/registry/core/persistentvolume/strategy_test.go

    			featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.PersistentVolumeLastPhaseTransitionTime, tc.fg)
    
    			obj := tc.newObj.DeepCopy()
    			StatusStrategy.PrepareForUpdate(context.TODO(), obj, tc.oldObj.DeepCopy())
    			if !reflect.DeepEqual(obj, tc.expectedObj) {
    				t.Errorf("object diff: %s", cmp.Diff(obj, tc.expectedObj))
    			}
    		})
    	}
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 24 18:25:29 UTC 2024
    - 11K bytes
    - Viewed (0)
  3. pkg/apis/storage/validation/validation.go

    	allErrs := ValidateVolumeAttachment(new)
    
    	// Spec is read-only
    	// If this ever relaxes in the future, make sure to increment the Generation number in PrepareForUpdate
    	if !apiequality.Semantic.DeepEqual(old.Spec, new.Spec) {
    		allErrs = append(allErrs, field.Invalid(field.NewPath("spec"), new.Spec, "field is immutable"))
    	}
    	return allErrs
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Feb 28 00:47:13 UTC 2024
    - 25.5K bytes
    - Viewed (0)
  4. pkg/registry/core/persistentvolumeclaim/strategy_test.go

    			newPvcHasConditions, newPvc := newPvcInfo.hasConditions, newPvcInfo.pvc()
    
    			t.Run(fmt.Sprintf("old pvc %s, new pvc %s", oldPvcInfo.description, newPvcInfo.description), func(t *testing.T) {
    				StatusStrategy.PrepareForUpdate(ctx, newPvc, oldPvc)
    
    				// old pvc should never be changed
    				if !reflect.DeepEqual(oldPvc, oldPvcInfo.pvc()) {
    					t.Errorf("old pvc changed: %v", cmp.Diff(oldPvc, oldPvcInfo.pvc()))
    				}
    
    				switch {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 24 18:25:29 UTC 2024
    - 11.2K bytes
    - Viewed (0)
  5. pkg/registry/core/service/strategy_test.go

    				},
    			},
    		},
    	}
    	StatusStrategy.PrepareForUpdate(ctx, newService, oldService)
    	if newService.Status.LoadBalancer.Ingress[0].IP != "127.0.0.2" {
    		t.Errorf("Service status updates should allow change of status fields")
    	}
    	if newService.Spec.SessionAffinity != "None" {
    		t.Errorf("PrepareForUpdate should have preserved old spec")
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 24 18:25:29 UTC 2024
    - 32.4K bytes
    - Viewed (0)
  6. pkg/api/pod/util.go

    }
    
    // DropDisabledTemplateFields removes disabled fields from the pod template metadata and spec.
    // This should be called from PrepareForCreate/PrepareForUpdate for all resources containing a PodTemplateSpec
    func DropDisabledTemplateFields(podTemplate, oldPodTemplate *api.PodTemplateSpec) {
    	var (
    		podSpec           *api.PodSpec
    		podAnnotations    map[string]string
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 29 22:40:29 UTC 2024
    - 41.3K bytes
    - Viewed (0)
  7. pkg/registry/discovery/endpointslice/strategy_test.go

    				},
    				Endpoints: []discovery.Endpoint{{
    					Addresses: []string{"1.2.3.4"},
    				}},
    			},
    		},
    	}
    
    	for _, tc := range testCases {
    		t.Run(tc.name, func(t *testing.T) {
    			Strategy.PrepareForUpdate(context.TODO(), tc.newEPS, tc.oldEPS)
    			if !apiequality.Semantic.DeepEqual(tc.newEPS, tc.expectedEPS) {
    				t.Errorf("Expected %+v\nGot: %+v", tc.expectedEPS, tc.newEPS)
    			}
    		})
    	}
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 24 18:25:29 UTC 2024
    - 27.3K bytes
    - Viewed (0)
Back to top