type RESTUpdateStrategy … // TODO: add other common fields that require global validation. func validateCommonFields(obj, old runtime.Object, strategy RESTUpdateStrategy) (field.ErrorList, error) { … } // BeforeUpdate ensures that common operations for all resources are performed on update. It only returns // errors that can be converted to api.Status. It will invoke update validation with the provided existing // and updated objects. // It sets zero values only if the object does not have a zero value for the respective field. func BeforeUpdate(strategy RESTUpdateStrategy, ctx context.Context, obj, old runtime.Object) error { … } type TransformFunc … type defaultUpdatedObjectInfo … // DefaultUpdatedObjectInfo returns an UpdatedObjectInfo impl based on the specified object. func DefaultUpdatedObjectInfo(obj runtime.Object, transformers ...TransformFunc) UpdatedObjectInfo { … } // Preconditions satisfies the UpdatedObjectInfo interface. func (i *defaultUpdatedObjectInfo) Preconditions() *metav1.Preconditions { … } // UpdatedObject satisfies the UpdatedObjectInfo interface. // It returns a copy of the held obj, passed through any configured transformers. func (i *defaultUpdatedObjectInfo) UpdatedObject(ctx context.Context, oldObj runtime.Object) (runtime.Object, error) { … } type wrappedUpdatedObjectInfo … // WrapUpdatedObjectInfo returns an UpdatedObjectInfo impl that delegates to // the specified objInfo, then calls the passed transformers func WrapUpdatedObjectInfo(objInfo UpdatedObjectInfo, transformers ...TransformFunc) UpdatedObjectInfo { … } // Preconditions satisfies the UpdatedObjectInfo interface. func (i *wrappedUpdatedObjectInfo) Preconditions() *metav1.Preconditions { … } // UpdatedObject satisfies the UpdatedObjectInfo interface. // It delegates to the wrapped objInfo and passes the result through any configured transformers. func (i *wrappedUpdatedObjectInfo) UpdatedObject(ctx context.Context, oldObj runtime.Object) (runtime.Object, error) { … } // AdmissionToValidateObjectUpdateFunc converts validating admission to a rest validate object update func func AdmissionToValidateObjectUpdateFunc(admit admission.Interface, staticAttributes admission.Attributes, o admission.ObjectInterfaces) ValidateObjectUpdateFunc { … }