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

fix: only replace/set default model reg namespace by webhook if comnent is enabled #1249

Merged

Conversation

zdtsw
Copy link
Member

@zdtsw zdtsw commented Sep 18, 2024

Description

these two cases should not block operation, for backwards compataible

  • when modelreg is not set in DSC
  • when modelreg is set to be Removed

https://issues.redhat.com/browse/RHOAIENG-13052

How Has This Been Tested?

local build: quay.io/wenzhou/opendatahub-operator-catalog:v2.18.13052

Screenshot or short clip

Merge criteria

  • You have read the contributors guide.
  • Commit messages are meaningful - have a clear and concise summary and detailed explanation of what was changed and why.
  • Pull Request contains a description of the solution, a link to the JIRA issue, and to any dependent or related Pull Request.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work

…nent is enabled

- when modelreg is not set in DSC
- when modelreg is set to be Removed
these two cases should not block operation, for backwards compataible

Signed-off-by: Wen Zhou <[email protected]>
@zdtsw zdtsw requested review from jstourac and CFSNM and removed request for mattmahoneyrh and AjayJagan September 18, 2024 09:49
@ykaliuta
Copy link
Contributor

So back to my question do we really need that webhook when there is default value? Is it against explicit "" value?

@zdtsw
Copy link
Member Author

zdtsw commented Sep 18, 2024

So back to my question do we really need that webhook when there is default value? Is it against explicit "" value?

better to have an example for this question.
e.g modelreg has a default namespace set but to value "" ? and it is in Managed?

@ykaliuta
Copy link
Contributor

So back to my question do we really need that webhook when there is default value? Is it against explicit "" value?

better to have an example for this question. e.g modelreg has a default namespace set but to value "" ? and it is in Managed?

modelregistry has // +kubebuilder:default="odh-model-registries". So, if I put no RegistriesNamespace in the DSC, I see odh-model-registries there. The only case when len can be 0, IIUC, is setting it explicitly to "".

@zdtsw
Copy link
Member Author

zdtsw commented Sep 18, 2024

So back to my question do we really need that webhook when there is default value? Is it against explicit "" value?

better to have an example for this question. e.g modelreg has a default namespace set but to value "" ? and it is in Managed?

modelregistry has // +kubebuilder:default="odh-model-registries". So, if I put no RegistriesNamespace in the DSC, I see odh-model-registries there. The only case when len can be 0, IIUC, is setting it explicitly to "".

yep, see
#1221 (comment)
#1221 (comment)

Copy link

openshift-ci bot commented Sep 18, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CFSNM, ykaliuta

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit c87dc1c into opendatahub-io:incubation Sep 18, 2024
8 checks passed
@ykaliuta
Copy link
Contributor

So back to my question do we really need that webhook when there is default value? Is it against explicit "" value?

better to have an example for this question. e.g modelreg has a default namespace set but to value "" ? and it is in Managed?

modelregistry has // +kubebuilder:default="odh-model-registries". So, if I put no RegistriesNamespace in the DSC, I see odh-model-registries there. The only case when len can be 0, IIUC, is setting it explicitly to "".

yep, see #1221 (comment) #1221 (comment)

It sounds as a pretty weird case. I can understand that user can forget to set some value. But why user should explicitly set it to a wrong value? Is it the only value like that (that user can break the system)? What about applicationNamespace in DSCI?

@zdtsw
Copy link
Member Author

zdtsw commented Sep 19, 2024

So back to my question do we really need that webhook when there is default value? Is it against explicit "" value?

better to have an example for this question. e.g modelreg has a default namespace set but to value "" ? and it is in Managed?

modelregistry has // +kubebuilder:default="odh-model-registries". So, if I put no RegistriesNamespace in the DSC, I see odh-model-registries there. The only case when len can be 0, IIUC, is setting it explicitly to "".

yep, see #1221 (comment) #1221 (comment)

It sounds as a pretty weird case. I can understand that user can forget to set some value. But why user should explicitly set it to a wrong value? Is it the only value like that (that user can break the system)? What about applicationNamespace in DSCI?

in theory, if explictily set "" for applicationnamespace in DSCI
say, in a clean installed cluster, no "opendatahu" namesapce exist,
it will be a problem for component: applicationamespace has a default value "opendatahub" but the namespace is not crated by createOdhNamespace due to "" string.
thats why in the downstream, we are creating DSCI on the fly for user upon installation.
but yes, this is a tricky question

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants