Merge pull request #105980 from ahg-g/ahg-mutable

Make job pod template annotations and labels mutable for suspended jobs that never started
This commit is contained in:
Kubernetes Prow Robot
2021-10-29 13:15:23 -07:00
committed by GitHub
2 changed files with 68 additions and 0 deletions

View File

@@ -263,6 +263,8 @@ func validatePodTemplateUpdate(spec, oldSpec batch.JobSpec, fldPath *field.Path,
}
oldTemplate.Spec.NodeSelector = template.Spec.NodeSelector // +k8s:verify-mutation:reason=clone
oldTemplate.Spec.Tolerations = template.Spec.Tolerations // +k8s:verify-mutation:reason=clone
oldTemplate.Annotations = template.Annotations // +k8s:verify-mutation:reason=clone
oldTemplate.Labels = template.Labels // +k8s:verify-mutation:reason=clone
}
allErrs = append(allErrs, apivalidation.ValidateImmutableField(template, oldTemplate, fldPath.Child("template"))...)
return allErrs