From 8d3e733bacad820ad4b3312f5c3ee765ded4e5f6 Mon Sep 17 00:00:00 2001 From: avelichk Date: Fri, 13 Aug 2021 20:51:26 +0100 Subject: [PATCH 1/2] Change labels for controller resources --- pkg/controller.v1beta1/consts/const.go | 6 +++--- pkg/controller.v1beta1/util/annotations.go | 6 ------ 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/pkg/controller.v1beta1/consts/const.go b/pkg/controller.v1beta1/consts/const.go index 0ac309ddbdc..56c690a55ab 100644 --- a/pkg/controller.v1beta1/consts/const.go +++ b/pkg/controller.v1beta1/consts/const.go @@ -50,11 +50,11 @@ const ( ConfigTrialResources = "trial-resources" // LabelExperimentName is the label of experiment name. - LabelExperimentName = "experiment" + LabelExperimentName = "katib.kubeflow.org/experiment" // LabelSuggestionName is the label of suggestion name. - LabelSuggestionName = "suggestion" + LabelSuggestionName = "katib.kubeflow.org/suggestion" // LabelDeploymentName is the label of deployment name. - LabelDeploymentName = "deployment" + LabelDeploymentName = "katib.kubeflow.org/deployment" // ContainerSuggestion is the container name to run Suggestion service. ContainerSuggestion = "suggestion" diff --git a/pkg/controller.v1beta1/util/annotations.go b/pkg/controller.v1beta1/util/annotations.go index ccd5a378747..a5017eef3bf 100644 --- a/pkg/controller.v1beta1/util/annotations.go +++ b/pkg/controller.v1beta1/util/annotations.go @@ -17,16 +17,10 @@ limitations under the License. package util import ( - logf "sigs.k8s.io/controller-runtime/pkg/log" - suggestionsv1beta1 "github.com/kubeflow/katib/pkg/apis/controller/suggestions/v1beta1" "github.com/kubeflow/katib/pkg/controller.v1beta1/consts" ) -var ( - log = logf.Log.WithName("util-annotations") -) - // SuggestionAnnotations returns the expected suggestion annotations. func SuggestionAnnotations(instance *suggestionsv1beta1.Suggestion) map[string]string { return appendAnnotation( From b218b7a99d23a6cbe414c31c05544988a1910135 Mon Sep 17 00:00:00 2001 From: avelichk Date: Fri, 13 Aug 2021 21:46:26 +0100 Subject: [PATCH 2/2] Fix Label in test --- .../suggestion/composer/composer_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/controller.v1beta1/suggestion/composer/composer_test.go b/pkg/controller.v1beta1/suggestion/composer/composer_test.go index ba49cb52b6e..7f5e8168bf8 100644 --- a/pkg/controller.v1beta1/suggestion/composer/composer_test.go +++ b/pkg/controller.v1beta1/suggestion/composer/composer_test.go @@ -69,10 +69,10 @@ var ( } deploymentLabels = map[string]string{ - "custom-label": "test", - "deployment": suggestionName + "-" + suggestionAlgorithm, - "experiment": suggestionName, - "suggestion": suggestionName, + "custom-label": "test", + consts.LabelDeploymentName: suggestionName + "-" + suggestionAlgorithm, + consts.LabelExperimentName: suggestionName, + consts.LabelSuggestionName: suggestionName, } podAnnotations = map[string]string{