-
Notifications
You must be signed in to change notification settings - Fork 157
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: add check on 2 MultiKueue CRD if v1alpha1 version in the cluster and not in termination, error out #1616
feat: add check on 2 MultiKueue CRD if v1alpha1 version in the cluster and not in termination, error out #1616
Conversation
bundle/manifests/opendatahub-operator.clusterserviceversion.yaml
Outdated
Show resolved
Hide resolved
bundle/manifests/opendatahub-operator.clusterserviceversion.yaml
Outdated
Show resolved
Hide resolved
// For the case when user manually delete old MultiKueueConfig/MultiKueueCluster CRDs v1alpha1 | ||
predicate.Funcs{ | ||
DeleteFunc: func(e event.DeleteEvent) bool { | ||
return e.Object.GetName() == gvk.MultiKueueConfigV1Alpha1.Kind || e.Object.GetName() == gvk.MultikueueClusterV1Alpha1.Kind |
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.
this should probably already covered by the component.ForLabel
predicate (https://github.com/opendatahub-io/opendatahub-operator/blob/main/pkg/controller/predicates/component/component.go#L15-L17), unless the crd were not deployed by the operator.
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.
right, if the CRD has app.opendatahub.io/kueue: 'true'
i dont know if we should cover it or not, for the case, kueue team can run "make deploy" to get CRD into cluster but these wont have labels/annotations.
maybe we can remove DeleteFuncs
here
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'd be strict here and only support what the operator expects, if you do something outside of the operator, I guess there's not so much we can do/support
…r, error out - DSC condition on kueueReady: reason: MultiKueueCRDV1Alpah1Exist message: MultiKueue CRDs MultiKueueConfig v1alpha1 and MultiKueueCluster v1alpah1 exist, please remove them before proceed - reconcile gets triggered by user's deletion on these 2 CRD Signed-off-by: Wen Zhou <[email protected]>
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.
Thanks @zdtsw , I've tested this and works as expected:
- Old version of Kueue deployed with v1alpha1 CRDs.
- Deleted deployment, and checked that the v1alpha1 CRDs remained.
- Installed this version of opendatahub-operator.
- Kueue pods were blocked from creation, and found the message in the DSC resource.
- After deletion of both v1alpha1 CRDs, the Kueue pod starts and installs newer v1beta1 CRDs.
- rename function to postive - remove prediate on non-operator created CRD Signed-off-by: Wen Zhou <[email protected]>
Signed-off-by: Wen Zhou <[email protected]>
@zdtsw it looks good to me, we'd need an e2e test for this I guess |
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.
Tested a new clean installation of opendatahub-operator when cluster has none of the 2 CRDs. Kueue pods came up as expected and installed the new CRDs.
i will add one on that |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1616 +/- ##
==========================================
- Coverage 20.35% 20.28% -0.08%
==========================================
Files 163 163
Lines 11096 11137 +41
==========================================
Hits 2259 2259
- Misses 8597 8638 +41
Partials 240 240 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Wen Zhou <[email protected]>
/test opendatahub-operator-e2e |
I think we probably need a test to validate that the component goes into a non ready state if v1alpha1 is installed, and then gets back to ready when the CRD is deleted & reinstalled |
Signed-off-by: Wen Zhou <[email protected]>
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lburgazzoli 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 |
/test opendatahub-operator-e2e |
/test image-build |
@zdtsw: The specified target(s) for
Use In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/test all |
/test opendatahub-operator-e2e |
…r and not in termination, error out (opendatahub-io#1616) * feat: add check on 2 MultiKueue CRD if v1alpha1 version in the cluster, error out - DSC condition on kueueReady: reason: MultiKueueCRDV1Alpah1Exist message: MultiKueue CRDs MultiKueueConfig v1alpha1 and MultiKueueCluster v1alpah1 exist, please remove them before proceed - reconcile gets triggered by user's deletion on these 2 CRD Signed-off-by: Wen Zhou <[email protected]> * update: - rename function to postive - remove prediate on non-operator created CRD Signed-off-by: Wen Zhou <[email protected]> * update: message Signed-off-by: Wen Zhou <[email protected]> * update: add test to check muttikueue api version Signed-off-by: Wen Zhou <[email protected]> * update: add e2e test to mimic CRD API version Signed-off-by: Wen Zhou <[email protected]> --------- Signed-off-by: Wen Zhou <[email protected]> (cherry picked from commit b1c2524)
reason: MultiKueueCRDV1Alpah1Exist
message: MultiKueue CRDs MultiKueueConfig v1alpha1 and MultiKueueCluster v1alpah1 exist, please remove them before proceed
Description
ref: https://issues.redhat.com/browse/RHOAIENG-18251
How Has This Been Tested?
local build: quay.io/wenzhou/opendatahub-operator-catalog:v2.23.205
Screenshot or short clip
Merge criteria