Skip to content

OCPBUGS-23746: Add availableInertia support to operator status controller - #2429

Open
tchap wants to merge 1 commit into
openshift:masterfrom
tchap:available-inertia
Open

OCPBUGS-23746: Add availableInertia support to operator status controller#2429
tchap wants to merge 1 commit into
openshift:masterfrom
tchap:available-inertia

Conversation

@tchap

@tchap tchap commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

The OperatorAvailable condition now respects an inertia window, similar to the existing degradedInertia behavior. This allows operators to suppress transient availability fluctuations within a configurable time window. A new WithAvailableInertia method enables operators to set custom inertia thresholds, and comprehensive tests validate the inertia behavior for various condition scenarios.

This basically replaces #2426 . I am pushing this now since the other author is on vacation and I would like to proceed.

#2057 can also be closed once this is merged IMO.

Summary by CodeRabbit

  • New Features
    • Added configurable inertia for operator availability status updates.
    • Availability can now remain active briefly after a temporary unavailable condition, reducing status fluctuation.
    • Multiple unavailable conditions are aggregated when determining the final availability status.

The OperatorAvailable condition now respects an inertia window, similar to the
existing degradedInertia behavior. This allows operators to suppress transient
availability fluctuations within a configurable time window. A new
WithAvailableInertia method enables operators to set custom inertia thresholds,
and comprehensive tests validate the inertia behavior for various condition
scenarios.
@openshift-ci-robot openshift-ci-robot added jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Aug 18, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@tchap: This pull request references Jira Issue OCPBUGS-23746, which is invalid:

  • expected the bug to target either version "5.1.0." or "openshift-5.1.0.", but it targets "4.22.0" instead

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

The OperatorAvailable condition now respects an inertia window, similar to the existing degradedInertia behavior. This allows operators to suppress transient availability fluctuations within a configurable time window. A new WithAvailableInertia method enables operators to set custom inertia thresholds, and comprehensive tests validate the inertia behavior for various condition scenarios.

This basically replaces #2426 . I am pushing this now since the other author is on vacation and I would like to proceed.

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 openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: abbcd700-429d-4b0d-a28d-b24bccaf139c

📥 Commits

Reviewing files that changed from the base of the PR and between a0584a6 and 9760562.

📒 Files selected for processing (2)
  • pkg/operator/status/status_controller.go
  • pkg/operator/status/status_controller_test.go

Included review availability: Your plan includes up to 12 reviews per rolling hour; 11 remain after this review.


Walkthrough

StatusSyncer now supports configurable inertia for OperatorAvailable conditions. Tests cover propagation, suppression, expiry, and multiple unavailable conditions.

Changes

Available condition inertia

Layer / File(s) Summary
Configure and apply available inertia
pkg/operator/status/status_controller.go
StatusSyncer stores an available-condition inertia value. WithAvailableInertia configures it on a copied controller. OperatorAvailable updates use the configured inertia.
Validate inertia behavior
pkg/operator/status/status_controller_test.go
Table-driven tests verify immediate propagation, suppression during the inertia window, propagation after expiry, and aggregation of multiple unavailable conditions.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 97605

The PR adds configurable inertia handling for operator availability conditions; no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed The PR adds standard Go subtests, not Ginkgo tests; all five t.Run names are static scenario strings and contain no runtime values.
Test Structure And Quality ✅ Passed The changed test uses standard Go subtests with fake clients, not Ginkgo; it has no Eventually/Consistently waits, creates no real cluster resources, and follows existing package patterns.
Microshift Test Compatibility ✅ Passed The pull request adds a standard Go TestAvailableInertia unit test, not a Ginkgo e2e test; the MicroShift API compatibility check is therefore inapplicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The PR adds TestAvailableInertia as a standard testing.T unit test, not a Ginkgo e2e test, and it contains no multi-node or HA assumptions.
Topology-Aware Scheduling Compatibility ✅ Passed The commit changes only status-condition inertia and tests; inspection found no deployments, replicas, affinity, topology spread, node selectors, tolerations, or PDB scheduling constraints.
Ote Binary Stdout Contract ✅ Passed The PR diff adds inertia logic and tests only; it introduces no main/init/suite setup or stdout writes. Existing klog calls are unchanged.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The added test is a local Go table test using fake clients and an in-memory clock; it adds no Ginkgo e2e test, IPv4 assumption, or external network access.
No-Weak-Crypto ✅ Passed The diff adds available-condition inertia and tests only; added-line scanning found no MD5, SHA1, DES, RC4, Blowfish, ECB, custom crypto, or secret comparisons.
Container-Privileges ✅ Passed The commit changes only Go source and tests. No container or Kubernetes manifest changes add privileged, host namespace, SYS_ADMIN, or privilege-escalation settings.
No-Sensitive-Data-In-Logs ✅ Passed The PR adds inertia configuration and tests only; it introduces no logging calls or log message changes, and existing status-diff logging remains unchanged.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the issue and the main change: adding availableInertia support to the operator status controller.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@tchap

tchap commented Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Aug 18, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@tchap: This pull request references Jira Issue OCPBUGS-23746, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.1.0) matches configured target version for branch (5.1.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @gangwgr

Details

In response to this:

/jira refresh

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci

openshift-ci Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: tchap
Once this PR has been reviewed and has the lgtm label, please assign jsafrane for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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 commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

@tchap: all tests passed!

Full PR test history. Your PR dashboard.

Details

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. I understand the commands that are listed here.

@bertinatto

Copy link
Copy Markdown
Member

/assign @dusk125

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants