-
Notifications
You must be signed in to change notification settings - Fork 48
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
Use the namespace of the service account #282
Conversation
/cc @kerthcet |
@@ -70,3 +76,13 @@ func SortByIndex[T appsv1.StatefulSet | corev1.Pod | int](indexFunc func(T) (int | |||
|
|||
return result | |||
} | |||
|
|||
// GetOperatorNamespace will pick the namespace based on the serviceaccount | |||
func GetOperatorNamespace() string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is doing this a common pattern? what other controllers does this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kueue and Jobset both use this for the default namespace on the component config.
/lgtm Thanks |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ahg-g, kannon92 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tried with the new commit? Seems failed to me @kannon92 I mean install in a different ns.
cd lws | ||
``` | ||
|
||
Then change the [kustomization.yaml](../../config/default/kustomization.yaml) _namespace_ field as: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we want to install in another namespace, I guess this is still needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added that back. I did test by changing this before I opened this up for review.
What type of PR is this?
/kind feature
What this PR does / why we need it
Users should not need to specify namespace in the deployment of the LWS operator.
We want to default the namespace to where the serviceaccount of LWS lives. This allows us to avoid configuration problems where a user specifies the wrong namespace for the CLI and the deployment went to other namespace. In this case, the pod is non functional.
Which issue(s) this PR fixes
Fixes #
Special notes for your reviewer
Does this PR introduce a user-facing change?