-
Notifications
You must be signed in to change notification settings - Fork 158
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
Add support for custom subscription config #446
Add support for custom subscription config #446
Conversation
main.go
Outdated
Monitoring: dsci.Monitoring{ | ||
Enabled: false, | ||
// Check if Auto configuration is enabled | ||
if os.Getenv("ENABLE_AUTO_CONFIG") == "" || os.Getenv("ENABLE_AUTO_CONFIG") != "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.
I wonder if it wouldn't be better to check == "true" for proceeding, == "false" for disabling and failing if it is not true or false? it would make intent explicit and avoid silent failures on this critical flag?
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 a user installs the operator through OperatorHub, subscription is created for the user by default. That will not include this config. In that case, if we set up failure for not defining the flag, it will result in operator install failure
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.
Sorry, what I mean is if the user makes a typo like: ENABLE_AUTO_CONFIG=flse . With the current code, although the user intended to disable auto-config, it will silently proceed with the configuration.
I completely agree with you that in the absence of the flag, it should use the default behaviour of configuring everything.
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.
will that be easier to just have a flag in subscritipion, rather than set to "true" or "false".
so, if install from opendatahub, this flag (say, ENABLE_AUTO_CONFIG) does not exist. then do as-is
if subsciption created by user and set this flag ENABLE_AUTO_CONFIG then proceed without create DSCI instance.
.spec.config.env
Description
Env is a list of environment variables to set in the container. Cannot be updated.
instead of using
.spec.config.env[]
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.
btw, can we change the name to something more specific,
the final catalogsource image can have different operators in it.
if others have a logic check on env ENABLE_AUTO_CONFIG as well.
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.
Updated
1c94bae
to
e8bb313
Compare
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 a comment, but I think we can merge as address that later.
LGTM
main.go
Outdated
Monitoring: dsci.Monitoring{ | ||
Enabled: false, | ||
// Check if Auto configuration is enabled | ||
if os.Getenv("ENABLE_AUTO_CONFIG") == "" || os.Getenv("ENABLE_AUTO_CONFIG") != "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.
will that be easier to just have a flag in subscritipion, rather than set to "true" or "false".
so, if install from opendatahub, this flag (say, ENABLE_AUTO_CONFIG) does not exist. then do as-is
if subsciption created by user and set this flag ENABLE_AUTO_CONFIG then proceed without create DSCI instance.
.spec.config.env
Description
Env is a list of environment variables to set in the container. Cannot be updated.
instead of using
.spec.config.env[]
main.go
Outdated
Monitoring: dsci.Monitoring{ | ||
Enabled: false, | ||
// Check if Auto configuration is enabled | ||
if os.Getenv("ENABLE_AUTO_CONFIG") == "" || os.Getenv("ENABLE_AUTO_CONFIG") != "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.
btw, can we change the name to something more specific,
the final catalogsource image can have different operators in it.
if others have a logic check on env ENABLE_AUTO_CONFIG as well.
e8bb313
to
d97ced0
Compare
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: etirelli, zdtsw 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 |
Fixes #436
Description
How Has This Been Tested?
DataScienceCluster
CR is created, it goes into Error phaseTo Enable Components
5. Create
DSCInitialization
CRDataScienceCluster
CRMerge criteria: