🌱 Add e2e test for operator workload persistence after catalog deletion#3737
Conversation
221472c to
defba84
Compare
anik120
left a comment
There was a problem hiding this comment.
Curious to know, what motivated this test?
We will remove the marketplace index. Additionally, we should ensure that the installed solution works even if we temporarily cannot reach the catalog—for example, if the registry is unavailable for any reason. |
9bf9eaf to
d70e585
Compare
| return nil | ||
| }, pollDuration, pollInterval).Should(Succeed()) | ||
|
|
||
| By("Verify CSV remains in succeeded state after catalog deletion") |
There was a problem hiding this comment.
Should we also check Subscription behavior here for missing catalogsource?
There was a problem hiding this comment.
That is a great idea 🎉
Adding that thank you
d70e585 to
e71ddf5
Compare
a5e3b9a to
f1a4927
Compare
|
|
||
| defer func() { | ||
| Eventually(func() error { | ||
| return ctx.Ctx().KubeClient().ApiextensionsInterface().ApiextensionsV1().CustomResourceDefinitions().Delete(context.Background(), crd.GetName(), metav1.DeleteOptions{}) |
There was a problem hiding this comment.
Why not use client.IgnoreNotFound here?
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: perdasilva The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Looks good to me, but might want to address Per's comment. |
Assisted-by: Cursor/CLAUDE
f1a4927 to
449588d
Compare
|
/lgtm |
afb9e80
into
operator-framework:master
This PR adds a comprehensive e2e test to verify that installed operators continue functioning normally after their source catalog is deleted. This ensures catalogs are only needed for installation and upgrades, not for runtime operation.
Complete Test Flow
Phase 1: Setup & Installation (WITH Catalog)
- Deployment (with correct replicas)
- ServiceAccount
- Role
- RoleBinding
Phase 2: Catalog Deletion
Phase 3: Passive Health Checks (WITHOUT Catalog)
- CSV remains in Succeeded phase
- Deployment stays healthy with same UID (not recreated)
- Replica counts remain correct
Phase 4: Active OLM Management Tests (WITHOUT Catalog)
- Update subscription to add environment variable
- Verify OLM propagates it to deployment
- Proves: OLM actively manages deployment based on subscription config
- Delete all OLM-managed resources:
- Wait for deletion confirmation
- Verify OLM recreates ALL of them with new UIDs
- Verify recreated deployment still has subscription config (env var)
- Proves: OLM actively reconciles CSV state and recreates the deployment only
Phase 5: Final State Validation
What This Proves
The test validates that after catalog deletion, OLM still:
PS.: ServiceAccount, Role, RoleBinding has not been re-created