code: func (a customResourceStrategy) PrepareForUpdate(ctx context.Context, obj, old runtime.Object) {
  	newCustomResourceObject := obj.(*unstructured.Unstructured)
  	oldCustomResourceObject := old.(*unstructured.Unstructured)
  
  	newCustomResource := newCustomResourceObject.UnstructuredContent()
  	oldCustomResource := oldCustomResourceObject.UnstructuredContent()
  
  	// If the /status subresource endpoint is installed, update is not allowed to set status.
  	if utilfeature.DefaultFeatureGate.Enabled(apiextensionsfeatures.CustomResourceSubresources) && a.status != nil {
  		_, ok1 := newCustomResource["status"]
  		_, ok2 := oldCustomResource["status"]
  		switch {
  		case ok2:
  			newCustomResource["status"] = oldCustomResource["status"]
  		case ok1:
  			delete(newCustomResource, "status")
  		}
  	}
  
  	// except for the changes to `metadata`, any other changes
  	// cause the generation to increment.
  	newCopyContent := copyNonMetadata(newCustomResource)
  	oldCopyContent := copyNonMetadata(oldCustomResource)
  	if !apiequality.Semantic.DeepEqual(newCopyContent, oldCopyContent) {
  		oldAccessor, _ := meta.Accessor(oldCustomResourceObject)
  		newAccessor, _ := meta.Accessor(newCustomResourceObject)
  		newAccessor.SetGeneration(oldAccessor.GetGeneration() + 1)
  	}
  }
docs: // PrepareForUpdate clears fields that are not allowed to be set by end users on update.