Skip to content

🌱 Set Progressing to Succeeded on ClusterExtensionRevision only after availability probes pass - #2524

Merged
openshift-merge-bot[bot] merged 1 commit into
operator-framework:mainfrom
pedjak:progressing-deadline-include-availability
Feb 25, 2026
Merged

🌱 Set Progressing to Succeeded on ClusterExtensionRevision only after availability probes pass#2524
openshift-merge-bot[bot] merged 1 commit into
operator-framework:mainfrom
pedjak:progressing-deadline-include-availability

Conversation

@pedjak

@pedjakpedjak commented Feb 24, 2026

Copy link
Copy Markdown
Contributor

Description

Previously, Progressing reason was set to Succeeded as soon as the rollout
transition completed, not taking into account availability probes of the last phase.
This meant setting .spec.progressDeadlineMinutes could not catch workloads that were
applied to the cluster but never became available, due to for example bad image reference.

Now Progressing stays at RollingOut during transition and is only set to
Succeeded once probes confirm availability, allowing the progress deadline
to correctly expire when a workload fails to become available in time.

Reviewer Checklist

  • API Go Documentation
  • Tests: Unit Tests (and E2E Tests, if appropriate)
  • Comprehensive Commit Messages
  • Links to related GitHub Issue(s)

CopilotAI review requested due to automatic review settings February 24, 2026 16:34
@netlify

netlifyBot commented Feb 24, 2026

Copy link
Copy Markdown

Deploy Preview for olmv1 ready!

NameLink
🔨 Latest commit8ee2732
🔍 Latest deploy loghttps://app.netlify.com/projects/olmv1/deploys/699ef6f7c54b2e00089b451c
😎 Deploy Previewhttps://deploy-preview-2524--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-merge-robotopenshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 24, 2026

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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 modifies the ClusterExtensionRevision controller to delay setting the Progressing condition to Succeeded until availability probes pass, rather than immediately when the rollout transition completes. This ensures that the progressDeadlineMinutes feature can correctly detect workloads that are deployed but fail to become available (e.g., due to bad image references).

Changes:

  • Modified Progressing condition logic to remain at RollingOut during transition and only set to Succeeded after availability probes confirm readiness
  • Replaced sync.Map progress deadline tracking with deterministic clock-based requeue logic using injected clock.Clock interface
  • Added E2E test scenario for progress deadline with availability failures

Reviewed changes

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

FileDescription
internal/operator-controller/controllers/clusterextensionrevision_controller.goRefactored progress deadline logic to use injected clock, moved Progressing: Succeeded status to only be set when IsComplete() is true
internal/operator-controller/controllers/clusterextensionrevision_controller_test.goAdded clock mocking infrastructure, updated test expectations to reflect new behavior, and used fixed timestamps for deterministic progress deadline testing
test/e2e/features/install.featureAdded new scenario testing progress deadline expiration when rollout doesn't become available

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

@pedjak
pedjakforce-pushed the progressing-deadline-include-availability branch from e505739 to 36db108CompareFebruary 24, 2026 16:39
@openshift-merge-robotopenshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 24, 2026
@pedjak
pedjakforce-pushed the progressing-deadline-include-availability branch from 36db108 to c64a338CompareFebruary 24, 2026 16:41
CopilotAI review requested due to automatic review settings February 24, 2026 16:41
@pedjak
pedjakforce-pushed the progressing-deadline-include-availability branch from c64a338 to 76b1cbcCompareFebruary 24, 2026 16:43

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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 3 out of 3 changed files in this pull request and generated 1 comment.


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

if time.Since(existingRev.CreationTimestamp.Time) > timeout {
if c.Clock.Since(existingRev.CreationTimestamp.Time) > timeout {
// progress deadline reached, reset any errors and stop reconciling this revision
markAsNotProgressing(reconciledRev, ocv1.ReasonProgressDeadlineExceeded, fmt.Sprintf("Revision has not rolled out for %d minutes.", pd))

CopilotAIFeb 24, 2026

Copy link

Choose a reason for hiding this comment

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

The error message uses "minutes" which is always plural, but when the progress deadline is 1 minute, it should say "minute" (singular). Consider using a conditional or pluralization helper to make the message grammatically correct for all values. For example: fmt.Sprintf("Revision has not rolled out for %d minute(s).", pd) or a more sophisticated approach that checks if pd == 1.

Suggested change
markAsNotProgressing(reconciledRev, ocv1.ReasonProgressDeadlineExceeded, fmt.Sprintf("Revision has not rolled out for %d minutes.", pd))
unit:="minutes"
ifpd==1 {
unit="minute"
}
markAsNotProgressing(reconciledRev, ocv1.ReasonProgressDeadlineExceeded, fmt.Sprintf("Revision has not rolled out for %d %s.", pd, unit))

Copilot uses AI. Check for mistakes.

@perdasilvaperdasilvaFeb 25, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

'minute(s)' might also be acceptable here

c.progressDeadlineCheckInFlight.Store(existingRev.GetUID(), true)
res = ctrl.Result{RequeueAfter: timeout}
} else if reconcileErr == nil {
requeueAfter := existingRev.CreationTimestamp.Time.Add(timeout).Add(2 * time.Second).Sub(c.Clock.Now()).Round(time.Second)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

what's the reason for the +2 seconds?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

what's the reason for the +2 seconds?

Requeing is not exact time-wise, so we can land here for the second time if we do not add a bit of drift. With drift we ensure that the next reconciliation is going to detect the deadline has exceeded. We could experiment with adding just 1 sec, if that would your preference, but I think it is safer to have larger drift. An alternative would be to drop Add(2 * time.Second), but then we need to add a check:

ifrequeueAfter==0 {
requeueafter=1*time.Second
}

wdyt?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm good with keeping it as is - maybe we could just add a comment to call this out as it might trip up the next person? Maybe also move the drift to a const to add additional context with the constant's name?

"olm.operatorframework.io/metadata.name": test-catalog
"""
Then ClusterExtensionRevision "${NAME}-1" reports Progressing as False with Reason ProgressDeadlineExceeded
And ClusterExtension reports Progressing as False with Reason ProgressDeadlineExceeded and Message:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

not for this PR, but I wonder if we should call it availabilityDeadline or revisionRolloutDeadline or something like that. If the rollout has moved from one phase to another, it has made progress.

…fter availability probes pass
Previously, `Progressing` reason was set to `Succeeded` as soon as the rollout
transition completed, not taking into account availability probes of the last phase.
This meant setting `.spec.progressDeadlineMinutes` could not catch workloads that were
applied to the cluster but never became available, due to for example bad image reference.
Now `Progressing` stays at `RollingOut` during transition and is only set to
`Succeeded` once probes confirm availability, allowing the progress deadline
to correctly expire when a workload fails to become available in time.
@pedjak
pedjakforce-pushed the progressing-deadline-include-availability branch from 76b1cbc to 8ee2732CompareFebruary 25, 2026 13:19
@perdasilva

Copy link
Copy Markdown
Contributor

/approve

@openshift-ciopenshift-ciBot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 25, 2026

@rashmigottipatirashmigottipati left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/lgtm

@openshift-ciopenshift-ciBot added the lgtm Indicates that a PR is ready to be merged. label Feb 25, 2026
@openshift-ci

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: perdasilva, rashmigottipati

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

@codecov

codecovBot commented Feb 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.04%. Comparing base (4121321) to head (8ee2732).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@ Coverage Diff @@## main #2524 +/- ##
==========================================
- Coverage 72.15% 72.04% -0.11% 
==========================================
Files 103 103 Lines 8686 8690 +4 ==========================================
- Hits 6267 6261 -6 - Misses 1937 1946 +9 - Partials 482 483 +1 
FlagCoverage Δ
e2e45.33% <0.00%> (+<0.01%)⬆️
experimental-e2e53.63% <100.00%> (-0.29%)⬇️
unit57.13% <91.66%> (+<0.01%)⬆️

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.

@openshift-merge-bot
openshift-merge-botBot merged commit dfd25de into operator-framework:mainFeb 25, 2026
28 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@pedjak@perdasilva@rashmigottipati@openshift-merge-robot