Merge pull request #116215 from kannon92/comment-manual-selector

update documentation on generateSelector for manual selector case
This commit is contained in:
Kubernetes Prow Robot 2023-03-02 12:48:56 -08:00 committed by GitHub
commit 2898a044d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -211,9 +211,8 @@ func generateSelector(obj *batch.Job) {
// a label.
_, found := obj.Spec.Template.Labels["job-name"]
if found {
// User asked us to not automatically generate a selector and labels,
// but set a possibly conflicting value. If there is a conflict,
// we will reject in validation.
// User asked us to automatically generate a selector, but set manual labels.
// If there is a conflict, we will reject in validation.
} else {
obj.Spec.Template.Labels["job-name"] = string(obj.ObjectMeta.Name)
}
@ -221,9 +220,8 @@ func generateSelector(obj *batch.Job) {
// only match this job.
_, found = obj.Spec.Template.Labels["controller-uid"]
if found {
// User asked us to automatically generate a selector and labels,
// but set a possibly conflicting value. If there is a conflict,
// we will reject in validation.
// User asked us to automatically generate a selector, but set manual labels.
// If there is a conflict, we will reject in validation.
} else {
obj.Spec.Template.Labels["controller-uid"] = string(obj.ObjectMeta.UID)
}