Skip to content

Comments

🌱 Add e2e test for operator workload persistence after catalog deletion#3737

Merged
openshift-merge-bot[bot] merged 1 commit intooperator-framework:masterfrom
camilamacedo86:add-e2e-test-res
Jan 20, 2026
Merged

🌱 Add e2e test for operator workload persistence after catalog deletion#3737
openshift-merge-bot[bot] merged 1 commit intooperator-framework:masterfrom
camilamacedo86:add-e2e-test-res

Conversation

@camilamacedo86
Copy link
Contributor

@camilamacedo86 camilamacedo86 commented Jan 13, 2026

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)

  1. Create CRD and CSV with permissions (ServiceAccount, Role, RoleBinding)
  2. Create catalog source
  3. Create subscription to install operator from catalog
  4. Verify CSV reaches Succeeded state
  5. Verify all OLM-managed resources exist:
    - Deployment (with correct replicas)
    - ServiceAccount
    - Role
    - RoleBinding
  6. Record UIDs of all resources

Phase 2: Catalog Deletion

  1. Delete catalog source
  2. Verify catalog source and its pod are completely removed

Phase 3: Passive Health Checks (WITHOUT Catalog)

  1. Consistently verify for 3 minutes:
    - 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)

  1. Config Management Test:
    - Update subscription to add environment variable
    - Verify OLM propagates it to deployment
    - Proves: OLM actively manages deployment based on subscription config
  2. Reconciliation Test:
    - Delete all OLM-managed resources:
    • Deployment
      - 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

  1. Verify subscription still tracks the installed CSV
  2. Verify CRD still exists and is functional

What This Proves

The test validates that after catalog deletion, OLM still:

  • ✅ Keeps CSV in healthy state
  • ✅ Manages deployment configuration via subscription
  • ✅ Reconciles and recreates deleted OLM-managed resources (Deployment ONLY)
  • ✅ Maintains subscription tracking
  • ✅ Preserves all installed CRDs

PS.: ServiceAccount, Role, RoleBinding has not been re-created

@openshift-ci openshift-ci bot requested review from dtfranz and grokspawn January 13, 2026 14:35
@camilamacedo86 camilamacedo86 changed the title 🌱 Add e2e test for operator workload persistence after catalog deletion WIP 🌱 Add e2e test for operator workload persistence after catalog deletion Jan 13, 2026
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 13, 2026
@camilamacedo86 camilamacedo86 force-pushed the add-e2e-test-res branch 3 times, most recently from 221472c to defba84 Compare January 13, 2026 19:14
@camilamacedo86 camilamacedo86 changed the title WIP 🌱 Add e2e test for operator workload persistence after catalog deletion 🌱 Add e2e test for operator workload persistence after catalog deletion Jan 13, 2026
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 13, 2026
Copy link
Member

@anik120 anik120 left a comment

Choose a reason for hiding this comment

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

Curious to know, what motivated this test?

@camilamacedo86
Copy link
Contributor Author

camilamacedo86 commented Jan 16, 2026

Curious to know, what motivated this test?

We will remove the marketplace index.
The motivation is to ensure that if any catalog is removed, everything continues to work correctly (except for upgrades that explicitly require that catalog).

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.

@camilamacedo86 camilamacedo86 force-pushed the add-e2e-test-res branch 3 times, most recently from 9bf9eaf to d70e585 Compare January 19, 2026 14:24
ankitathomas
ankitathomas previously approved these changes Jan 19, 2026
Copy link
Contributor

@ankitathomas ankitathomas left a comment

Choose a reason for hiding this comment

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

Looks good!

return nil
}, pollDuration, pollInterval).Should(Succeed())

By("Verify CSV remains in succeeded state after catalog deletion")
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we also check Subscription behavior here for missing catalogsource?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is a great idea 🎉
Adding that thank you

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 19, 2026
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Jan 19, 2026
@camilamacedo86 camilamacedo86 force-pushed the add-e2e-test-res branch 3 times, most recently from a5e3b9a to f1a4927 Compare January 19, 2026 17:56

defer func() {
Eventually(func() error {
return ctx.Ctx().KubeClient().ApiextensionsInterface().ApiextensionsV1().CustomResourceDefinitions().Delete(context.Background(), crd.GetName(), metav1.DeleteOptions{})
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why not use client.IgnoreNotFound here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done thx

@perdasilva
Copy link
Collaborator

/approve

@openshift-ci
Copy link

openshift-ci bot commented Jan 20, 2026

[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

Details 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-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 20, 2026
@tmshort
Copy link
Contributor

tmshort commented Jan 20, 2026

Looks good to me, but might want to address Per's comment.

@tmshort
Copy link
Contributor

tmshort commented Jan 20, 2026

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 20, 2026
@openshift-merge-bot openshift-merge-bot bot merged commit afb9e80 into operator-framework:master Jan 20, 2026
19 of 21 checks passed
@camilamacedo86 camilamacedo86 deleted the add-e2e-test-res branch January 20, 2026 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants