Skip to content

Commit 4ef26ef

Browse files
authored
Modify labels for controller resources (#1621)
* Change labels for controller resources * Fix Label in test
1 parent f42c6cc commit 4ef26ef

File tree

3 files changed

+7
-13
lines changed

3 files changed

+7
-13
lines changed

pkg/controller.v1beta1/consts/const.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ const (
5050
ConfigTrialResources = "trial-resources"
5151

5252
// LabelExperimentName is the label of experiment name.
53-
LabelExperimentName = "experiment"
53+
LabelExperimentName = "katib.kubeflow.org/experiment"
5454
// LabelSuggestionName is the label of suggestion name.
55-
LabelSuggestionName = "suggestion"
55+
LabelSuggestionName = "katib.kubeflow.org/suggestion"
5656
// LabelDeploymentName is the label of deployment name.
57-
LabelDeploymentName = "deployment"
57+
LabelDeploymentName = "katib.kubeflow.org/deployment"
5858

5959
// ContainerSuggestion is the container name to run Suggestion service.
6060
ContainerSuggestion = "suggestion"

pkg/controller.v1beta1/suggestion/composer/composer_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ var (
6969
}
7070

7171
deploymentLabels = map[string]string{
72-
"custom-label": "test",
73-
"deployment": suggestionName + "-" + suggestionAlgorithm,
74-
"experiment": suggestionName,
75-
"suggestion": suggestionName,
72+
"custom-label": "test",
73+
consts.LabelDeploymentName: suggestionName + "-" + suggestionAlgorithm,
74+
consts.LabelExperimentName: suggestionName,
75+
consts.LabelSuggestionName: suggestionName,
7676
}
7777

7878
podAnnotations = map[string]string{

pkg/controller.v1beta1/util/annotations.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,10 @@ limitations under the License.
1717
package util
1818

1919
import (
20-
logf "sigs.k8s.io/controller-runtime/pkg/log"
21-
2220
suggestionsv1beta1 "github.com/kubeflow/katib/pkg/apis/controller/suggestions/v1beta1"
2321
"github.com/kubeflow/katib/pkg/controller.v1beta1/consts"
2422
)
2523

26-
var (
27-
log = logf.Log.WithName("util-annotations")
28-
)
29-
3024
// SuggestionAnnotations returns the expected suggestion annotations.
3125
func SuggestionAnnotations(instance *suggestionsv1beta1.Suggestion) map[string]string {
3226
return appendAnnotation(

0 commit comments

Comments
 (0)