-
Notifications
You must be signed in to change notification settings - Fork 151
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
feat: option to disable create default userGroup on ODH and self-managed #1278
Conversation
- this only works if user create subscription and pass in variable Signed-off-by: Wen Zhou <wenzhou@redhat.com>
Skipping CI for Draft Pull Request. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
return reconcile.Result{}, err | ||
// Check if user opted for disabling creating user groups | ||
disableUserGroup, exist := os.LookupEnv("DISABLE_USERGROUP") | ||
if exist && disableUserGroup != "false" { |
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.
nit: since we don't need to distinguish between an empty value and an unset value, the check can probably simplified with os.Getenv("DISABLE_USERGROUP") == "true"
return reconcile.Result{}, err | ||
// Check if user opted for disabling creating user groups | ||
disableUserGroup, exist := os.LookupEnv("DISABLE_USERGROUP") | ||
if exist && disableUserGroup != "false" { |
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.
nit: since we don't need to distinguish between an empty value and an unset value, the check can probably simplified with os.Getenv("DISABLE_USERGROUP") == "true"
if err != nil { | ||
return reconcile.Result{}, err | ||
// Check if user opted for disabling creating user groups | ||
disableUserGroup, exist := os.LookupEnv("DISABLE_USERGROUP") |
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.
Ideally the env var name should be defined as a constant and better to add a prefix i.e. ODH_
to avoid any risk with env vars automatically injected in the pod or defined by the container.
- update README Signed-off-by: Wen Zhou <wenzhou@redhat.com>
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.
@zdtsw @lburgazzoli i wonder if we should make this config closer to what we want to things to be in future. Disabling group is only one aspect, but things like secret generation is also broken with external oidc because it uses OauthClient CR. Would renaming the environment to point to why we are making this change help, for example ODH_USE_EXTERNAL_AUTH? This would be closer to what we eventually want to add to the DSCI API like Luca was suggesting.
@lphiri yep that make sense |
Signed-off-by: Wen Zhou <wenzhou@redhat.com>
/test opendatahub-operator-e2e |
if err != nil { | ||
return reconcile.Result{}, err | ||
// Check if user opted for disabling creating user groups | ||
if os.Getenv("ODH_USE_EXTERNAL_AUTH") == "true" { |
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.
When upgrading, what is the default value for this env variable?
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 e value is set in the subscription, it will persist even later upgrade to new Operator version. Subscription should not get changed.
/lgtm Just a small request to keep the env name platform agnostic. |
I might actually prefer the environment variable name to be very explicit about what effect it has on the functionally. If at the very end of some revamp we say "now adding |
close it in favor of #1297 |
Description
user env variable
ODH_USE_EXTERNAL_AUTH
to disable user group creation.this works by manually create subscritpon and set value to "true"
by install operator from Operatorhub will still ,by default, to create group
(a different soltuion than #1276)
https://issues.redhat.com/browse/RHOAIENG-14214
How Has This Been Tested?
and
Screenshot or short clip
Merge criteria