From cd71486cfb8de660c92ecd92bc204ecefc9e64e6 Mon Sep 17 00:00:00 2001 From: kannon92 Date: Thu, 2 Mar 2023 13:33:40 +0000 Subject: [PATCH] update documentation on generateSelector for manual selector case --- pkg/registry/batch/job/strategy.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pkg/registry/batch/job/strategy.go b/pkg/registry/batch/job/strategy.go index 2dfae56c236..3b2d102a0b4 100644 --- a/pkg/registry/batch/job/strategy.go +++ b/pkg/registry/batch/job/strategy.go @@ -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) }