code: func (deploymentStrategy) ValidateUpdate(ctx context.Context, obj, old runtime.Object) field.ErrorList {
  	newDeployment := obj.(*apps.Deployment)
  	oldDeployment := old.(*apps.Deployment)
  	allErrs := validation.ValidateDeploymentUpdate(newDeployment, oldDeployment)
  	allErrs = append(allErrs, corevalidation.ValidateConditionalPodTemplate(&newDeployment.Spec.Template, &oldDeployment.Spec.Template, field.NewPath("spec.template"))...)
  
  	// Update is not allowed to set Spec.Selector for all groups/versions except extensions/v1beta1.
  	// If RequestInfo is nil, it is better to revert to old behavior (i.e. allow update to set Spec.Selector)
  	// to prevent unintentionally breaking users who may rely on the old behavior.
  	// TODO(#50791): after apps/v1beta1 and extensions/v1beta1 are removed,
  	// move selector immutability check inside ValidateDeploymentUpdate().
  	if requestInfo, found := genericapirequest.RequestInfoFrom(ctx); found {
  		groupVersion := schema.GroupVersion{Group: requestInfo.APIGroup, Version: requestInfo.APIVersion}
  		switch groupVersion {
  		case appsv1beta1.SchemeGroupVersion, extensionsv1beta1.SchemeGroupVersion:
  			// no-op for compatibility
  		default:
  			// disallow mutation of selector
  			allErrs = append(allErrs, apivalidation.ValidateImmutableField(newDeployment.Spec.Selector, oldDeployment.Spec.Selector, field.NewPath("spec").Child("selector"))...)
  		}
  	}
  
  	return allErrs
  }
docs: // ValidateUpdate is the default update validation for an end user.