Skip to content

Conversation

@camilamacedo86
Copy link
Contributor

@camilamacedo86 camilamacedo86 commented Nov 1, 2025

Fixes deprecation conditions showing install errors instead of actual deprecation status.

Closes: #2008
Addresses: Comment #3524229770, Comment #3524241806

Problems Fixed

1. Install errors leaked into deprecation conditions

When installation failed, the error appeared in ALL conditions including deprecation ones:

- type: PackageDeprecated
  status: "False"
  reason: Failed
  message: "validating bundle: dependency not supported"  # ❌ Wrong place!

Users couldn't tell if something was actually deprecated.

2. Wrong bundle checked during upgrades

When upgrading v1.0.0 → v1.0.1, deprecation showed v1.0.1's status even when the upgrade failed.

This violates Kubernetes convention: status must show actual state, not desired state.

3. Too much YAML clutter

Every ClusterExtension showed 4 False deprecation conditions:

conditions:
  - type: Deprecated
    status: "False"              # Noise
  - type: PackageDeprecated
    status: "False"              # Noise
  - type: ChannelDeprecated
    status: "False"              # Noise
  - type: BundleDeprecated
    status: "False"              # Noise

Users complained about cluttered output.


Changes Made

What we do now

Situation What we show
IS deprecated Condition with status: True
NOT deprecated Condition absent (no clutter!)
Can't check catalog Condition with status: Unknown
No bundle installed BundleDeprecated shows status: Unknown, reason: Absent

Key improvements

  1. Install errors stay separate

    • Errors → Progressing and Installed conditions only
    • Deprecation → catalog data only (never errors)
  2. Use installed bundle (not resolved)

    • Checks what's actually running
    • Follows Kubernetes "status = actual state" convention
  3. Remove False conditions

    • Absent = not deprecated
    • 60% less YAML clutter
  4. Correct reason values

    • Deprecated → when True
    • DeprecationStatusUnknown → when Unknown
    • Absent → when no bundle installed (BundleDeprecated only)

Before/After Comparison

What Changed Main (Before) This PR (After)
Install errors Leak into deprecation conditions ❌ Stay in Progressing/Installed only ✅
Catalog unavailable Shows False (misleading) ❌ Shows Unknown (honest) ✅
Bundle reference Uses resolved bundle ❌ Uses installed bundle ✅
Not deprecated Shows False (noisy) ❌ Condition absent (clean!) ✅
Reason values Always Deprecated Context-specific ✅

Examples

Example 1: Not Deprecated (Clean!)

Before:

conditions:
  - {type: Deprecated, status: "False"}
  - {type: PackageDeprecated, status: "False"}
  - {type: ChannelDeprecated, status: "False"}
  - {type: BundleDeprecated, status: "False"}
  - {type: Installed, status: "True"}
  - {type: Progressing, status: "True"}

After:

conditions:
  - {type: Installed, status: "True"}
  - {type: Progressing, status: "True"}
  # ✅ No deprecation conditions = not deprecated

Example 2: Install Error (Bug #2008)

Before:

- type: Progressing
  status: "True"
  message: "validation failed: dependency not supported"
- type: PackageDeprecated
  status: "False"
  reason: Failed
  message: "validation failed: dependency not supported"  # ❌ Error leaked!

After:

- type: Progressing
  status: "True"
  message: "validation failed: dependency not supported"
# ✅ PackageDeprecated absent (error didn't leak!)

Example 3: Catalog Removed

Before:

- type: BundleDeprecated
  status: "False"              # ❌ Misleading: claims "not deprecated"
  reason: Failed

After:

- type: BundleDeprecated
  status: "Unknown"            # ✅ Honest: we can't check
  reason: DeprecationStatusUnknown

Demos

Watch the fixes in action:

  1. Scenarios 1-2 (Clean YAML + Unknown): https://asciinema.org/a/Ej0ZeWEXnCvzf2SNuIkF4FDh9
  2. Scenario 3 (Error leak fix Install error message getting propagated to most conditions #2008): https://asciinema.org/a/frKLqoOHWRGkvJNFMfO0hysdy
  3. Scenario 4 (Catalog removed): https://asciinema.org/a/ZGWA3YQH1kmS9AKHuObPzlSi4

Copilot AI review requested due to automatic review settings November 1, 2025 07:58
@camilamacedo86 camilamacedo86 requested a review from a team as a code owner November 1, 2025 07:58
@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 Nov 1, 2025
@openshift-ci openshift-ci bot requested a review from dtfranz November 1, 2025 07:58
@netlify
Copy link

netlify bot commented Nov 1, 2025

Deploy Preview for olmv1 ready!

Name Link
🔨 Latest commit 8b6cfef
🔍 Latest deploy log https://app.netlify.com/projects/olmv1/deploys/6957c18a9cfe3f00083c94b2
😎 Deploy Preview https://deploy-preview-2296--olmv1.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@openshift-ci openshift-ci bot requested a review from oceanc80 November 1, 2025 07:58
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors deprecation status handling in ClusterExtension reconciliation to ensure deprecation conditions accurately reflect catalog data and installed bundle state, preventing install/validation errors from leaking into deprecation conditions.

  • Moved deprecation status updates to a deferred function that runs at the end of reconciliation
  • Changed BundleDeprecated condition to use Unknown status with ReasonAbsent when no bundle is installed
  • Updated test expectations to handle multiple possible error messages for sourceType validation

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
internal/operator-controller/controllers/clusterextension_controller.go Refactored deprecation status logic with deferred updates and new condition semantics for uninstalled bundles
internal/operator-controller/controllers/clusterextension_controller_test.go Added tests for deprecation handling with resolution failures and applier failures; updated test expectations for BundleDeprecated conditions
test/e2e/cluster_extension_install_test.go Updated e2e tests to verify deprecation conditions in success and failure scenarios
internal/operator-controller/controllers/clusterextension_admission_test.go Enhanced sourceType validation test to handle multiple possible error message formats

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings November 1, 2025 08:33
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link

codecov bot commented Nov 1, 2025

Codecov Report

❌ Patch coverage is 98.83721% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 68.87%. Comparing base (0f92032) to head (8b6cfef).

Files with missing lines Patch % Lines
...er/controllers/clusterextension_reconcile_steps.go 96.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2296      +/-   ##
==========================================
+ Coverage   68.82%   68.87%   +0.04%     
==========================================
  Files         100      100              
  Lines        7641     7665      +24     
==========================================
+ Hits         5259     5279      +20     
- Misses       1947     1951       +4     
  Partials      435      435              
Flag Coverage Δ
e2e 43.91% <72.09%> (+0.09%) ⬆️
experimental-e2e 13.63% <0.00%> (-0.05%) ⬇️
unit 57.19% <98.83%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@camilamacedo86 camilamacedo86 changed the title WIP: 🐛 (fix):Fix deprecation conditions leaking install errors 🐛 (fix):Fix deprecation conditions leaking install errors Nov 1, 2025
@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 Nov 1, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

internal/operator-controller/controllers/clusterextension_controller_test.go:1

  • The assertion require.Contains(ct, []string{...}, cond.Reason) is semantically backwards. The Contains function expects a slice as the second argument and the search item as the first. This should be require.Contains(ct, cond.Reason, []string{ocv1.ReasonFailed, ocv1.ReasonAbsent}) or use require.True(ct, slices.Contains([]string{ocv1.ReasonFailed, ocv1.ReasonAbsent}, cond.Reason)).
package controllers_test

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@camilamacedo86 camilamacedo86 changed the title 🐛 report Unknown for deprecation status when catalog unavailable and prevent error leak WIP 🐛 report Unknown for deprecation status when catalog unavailable and prevent error leak Jan 2, 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 2, 2026
Copilot AI review requested due to automatic review settings January 2, 2026 12:26
@camilamacedo86 camilamacedo86 changed the title WIP 🐛 report Unknown for deprecation status when catalog unavailable and prevent error leak WIP 🐛 Fix deprecation conditions showing install errors and improve condition semantics Jan 2, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings January 2, 2026 12:42
@openshift-ci
Copy link

openshift-ci bot commented Jan 2, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pedjak

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

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 7 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@camilamacedo86 camilamacedo86 changed the title WIP 🐛 Fix deprecation conditions showing install errors and improve condition semantics 🐛 Fix deprecation conditions showing install errors and improve condition semantics Jan 2, 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 2, 2026
@camilamacedo86 camilamacedo86 changed the title 🐛 Fix deprecation conditions showing install errors and improve condition semantics WIP 🐛 Fix deprecation conditions showing install errors and improve condition semantics Jan 2, 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 2, 2026
Deprecation conditions now only show what matters:
- When deprecated: condition shows "True" with deprecation message
- When not deprecated: condition is absent (no clutter!)
- When we can't check: condition shows "Unknown"

This fixes three problems:
1. Install errors were leaking into deprecation conditions
2. Catalog unavailable showed "False" instead of "Unknown"
3. BundleDeprecated was checking the wrong bundle (resolved vs installed)

Also improved the code:
- Simpler logic (clear all, then add only what's needed)
- Better reason values (Deprecated, DeprecationStatusUnknown, Absent)
- Comprehensive test coverage for all scenarios

Assisted-by: Cursor
Copilot AI review requested due to automatic review settings January 2, 2026 13:00
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@camilamacedo86 camilamacedo86 changed the title WIP 🐛 Fix deprecation conditions showing install errors and improve condition semantics 🐛 Fix deprecation conditions showing install errors and improve condition semantics Jan 2, 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 2, 2026
@camilamacedo86
Copy link
Contributor Author

Hey @joelanford — all your comments have been addressed.

We also have an RFC here: https://docs.google.com/document/d/1_XtISZ74rsd9-Zh9oQje1mEHjAfx0CHlf_50UJkXHTQ
.
In the doc description you’ll find the list of issues fixed, plus demos with examples.

I think it’s ready to 🚀 now.

c/c @pedjak @perdasilva @grokspawn

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Install error message getting propagated to most conditions

5 participants