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

[SDK] Fix namespace label #2493

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

helenxie-bit
Copy link
Contributor

What this PR does / why we need it:
Fix the error the namespace lacks label \"katib.kubeflow.org/metrics-collector-injection: enabled\" when using Katib SDK to create Experiment.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #2492

Checklist:

  • Docs included if any changes are user facing

Signed-off-by: helenxie-bit <[email protected]>
@google-oss-prow google-oss-prow bot requested a review from anencore94 January 17, 2025 04:28
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign andreyvelich for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Signed-off-by: helenxie-bit <[email protected]>
@helenxie-bit
Copy link
Contributor Author

/cc @kubeflow/wg-automl-leads @Electronic-Waste @tariq-hasan

@google-oss-prow google-oss-prow bot requested a review from a team January 17, 2025 04:38
Copy link

@helenxie-bit: GitHub didn't allow me to request PR reviews from the following users: tariq-hasan.

Note that only kubeflow members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc @kubeflow/wg-automl-leads @Electronic-Waste @tariq-hasan

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Copy link
Member

@Electronic-Waste Electronic-Waste left a comment

Choose a reason for hiding this comment

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

Basically LGTM. Just a question:)

Comment on lines +379 to +386
namespace_labels = client.CoreV1Api().read_namespace(namespace).metadata.labels
if "katib.kubeflow.org/metrics-collector-injection" not in namespace_labels:
namespace_labels["katib.kubeflow.org/metrics-collector-injection"] = (
"enabled"
)
client.CoreV1Api().patch_namespace(
namespace, {"metadata": {"labels": namespace_labels}}
)
Copy link
Member

Choose a reason for hiding this comment

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

I also encountered this error and fixed it with kubectl label command. Is this label designed on purpose for users who want to enable sidecar container injection? I'm curious about this👀 @kubeflow/wg-automl-leads

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SDK Error: the namespace lacks label \"katib.kubeflow.org/metrics-collector-injection: enabled\"
2 participants