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(dspv2): label should be check on existance and value as well #967

Merged

Conversation

zdtsw
Copy link
Member

@zdtsw zdtsw commented Apr 13, 2024

  • when label has value "true" means Argo CDR is from DSPv2
  • if label has value "false" could be a pre-exist cluster CRD

Description

https://issues.redhat.com/browse/RHOAIENG-4570
based on #955

How Has This Been Tested?

Merge criteria:

  • The commits are squashed in a cohesive manner and have meaningful messages.
  • 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

@openshift-ci openshift-ci bot requested review from dimakis and etirelli April 13, 2024 16:16
@zdtsw zdtsw removed the request for review from dimakis April 13, 2024 16:17
@ykaliuta
Copy link
Contributor

Out of curiosity, where this logic comes from? I checked Jira, slack thread, the referenced commit message, but missed it somehow.

@zdtsw
Copy link
Member Author

zdtsw commented Apr 15, 2024

Out of curiosity, where this logic comes from? I checked Jira, slack thread, the referenced commit message, but missed it somehow.

for all the resource deployed by ODH operator, we set the label and "true" on these resource, this is by the "plugin"
two cases on Argo CRD which might not be from us but done by the user themselves:

  • no such label on the Argo CRD
  • has such label but it is set to "false"

the original PR for DSPv2 with Argo, does check, but only if this CRD has label on it, but not for the 2nd case "check value is true"

- when label has value "true" means Argo CDR is from DSPv2
- if label has value "false" could be a pre-exist cluster CRD
Signed-off-by: Wen Zhou <wenzhou@redhat.com>
Signed-off-by: Wen Zhou <wenzhou@redhat.com>
Co-authored-by: Bartosz Majsak <bartosz.majsak@gmail.com>
// Verify if existing workflow is deployed by ODH with label
odhLabelValue, odhLabelExists := workflowCRD.Labels[labels.ODH.Component(ComponentName)]
if odhLabelExists && odhLabelValue != "true" {
return fmt.Errorf(" %v CRD already exists but not deployed by this operator. Remove existing Argo workflows or set datasciencepipelines to Removed to proceed ",
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe use the full path for clarity? spec.components.datasciencepipelines.managedState

Copy link
Member Author

Choose a reason for hiding this comment

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

.... it got merged the same time i made this update 🤣

Copy link
Member Author

Choose a reason for hiding this comment

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

fix in #970

Copy link
Contributor

@etirelli etirelli left a comment

Choose a reason for hiding this comment

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

minor suggestion, but other than that LGTM

Copy link

openshift-ci bot commented Apr 15, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: etirelli, 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 ef977c2 into opendatahub-io:incubation Apr 15, 2024
8 checks passed
zdtsw added a commit to VaishnaviHire/opendatahub-operator that referenced this pull request Apr 17, 2024
…ndatahub-io#967)

* fix(dspv2): label should be check on existance and value as well

- when label has value "true" means Argo CDR is from DSPv2
- if label has value "false" could be a pre-exist cluster CRD
Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* update(naming): code review from previous PR

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* Update controllers/datasciencecluster/datasciencecluster_controller.go

Co-authored-by: Bartosz Majsak <bartosz.majsak@gmail.com>

---------

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
Co-authored-by: Bartosz Majsak <bartosz.majsak@gmail.com>
Signed-off-by: Wen Zhou <wenzhou@redhat.com>
zdtsw added a commit to VaishnaviHire/opendatahub-operator that referenced this pull request Apr 17, 2024
…ndatahub-io#967)

* fix(dspv2): label should be check on existance and value as well

- when label has value "true" means Argo CDR is from DSPv2
- if label has value "false" could be a pre-exist cluster CRD
Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* update(naming): code review from previous PR

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* Update controllers/datasciencecluster/datasciencecluster_controller.go

Co-authored-by: Bartosz Majsak <bartosz.majsak@gmail.com>

---------

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
Co-authored-by: Bartosz Majsak <bartosz.majsak@gmail.com>
Signed-off-by: Wen Zhou <wenzhou@redhat.com>
zdtsw added a commit to zdtsw-forking/rhods-operator that referenced this pull request Apr 23, 2024
…ndatahub-io#967)

* fix(dspv2): label should be check on existance and value as well

- when label has value "true" means Argo CDR is from DSPv2
- if label has value "false" could be a pre-exist cluster CRD
Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* update(naming): code review from previous PR

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* Update controllers/datasciencecluster/datasciencecluster_controller.go

Co-authored-by: Bartosz Majsak <bartosz.majsak@gmail.com>

---------

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
Co-authored-by: Bartosz Majsak <bartosz.majsak@gmail.com>
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.

None yet

4 participants