Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify labels for controller resources #1621

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pkg/controller.v1beta1/consts/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will it be released in next version?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's fine to release it in 0.12, since it's not breaking change.
These labels are used internally in Katib Controller.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM.

/lgtm


// ContainerSuggestion is the container name to run Suggestion service.
ContainerSuggestion = "suggestion"
Expand Down
8 changes: 4 additions & 4 deletions pkg/controller.v1beta1/suggestion/composer/composer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
6 changes: 0 additions & 6 deletions pkg/controller.v1beta1/util/annotations.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down