code: func (deploymentStrategy) PrepareForUpdate(ctx context.Context, obj, old runtime.Object) {
  	newDeployment := obj.(*apps.Deployment)
  	oldDeployment := old.(*apps.Deployment)
  	newDeployment.Status = oldDeployment.Status
  
  	pod.DropDisabledTemplateFields(&newDeployment.Spec.Template, &oldDeployment.Spec.Template)
  
  	// Spec updates bump the generation so that we can distinguish between
  	// scaling events and template changes, annotation updates bump the generation
  	// because annotations are copied from deployments to their replica sets.
  	if !apiequality.Semantic.DeepEqual(newDeployment.Spec, oldDeployment.Spec) ||
  		!apiequality.Semantic.DeepEqual(newDeployment.Annotations, oldDeployment.Annotations) {
  		newDeployment.Generation = oldDeployment.Generation + 1
  	}
  }
docs: // PrepareForUpdate clears fields that are not allowed to be set by end users on update.