Skip to content

OCPBUGS-88531: Propagate restart-date annotation to CNO operand pod templates - #3030

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:masterfrom
bryan-cox:OCPBUGS-88531
Jul 10, 2026
Merged

OCPBUGS-88531: Propagate restart-date annotation to CNO operand pod templates#3030
openshift-merge-bot[bot] merged 1 commit into
openshift:masterfrom
bryan-cox:OCPBUGS-88531

Conversation

@bryan-cox

@bryan-cox bryan-cox commented Jun 15, 2026

Copy link
Copy Markdown
Member

Summary

When the hypershift.openshift.io/restart-date annotation is set on a HostedControlPlane CR, CNO-managed operands like cloud-network-config-controller were not being restarted. CNO never propagated this annotation to its operand pod templates, so there was nothing to trigger a rollout.

Previously, the CPO (control-plane-operator) handled restart-date propagation by directly patching individual deployments (multus-admission-controller, network-node-identity, ovnkube-control-plane), but this approach missed cloud-network-config-controller entirely — which is the bug reported in OCPBUGS-88531.

This PR fixes the issue by having CNO propagate the annotation itself:

  • Reading the hypershift.openshift.io/restart-date annotation from the HostedControlPlane CR in ParseHostedControlPlane()
  • Adding a SetRestartDateAnnotation() helper that injects the restart-date into pod template annotations of rendered Deployments, DaemonSets, and StatefulSets within the HCP namespace only (guest-cluster workloads are not affected)
  • Calling this helper in the reconciler after Render() returns, gated on HyperShift mode and a non-empty restart-date value

The companion HyperShift PR (#8751) removes the redundant CPO-side restart logic, since CNO now handles it directly.

Annotation removal behavior

If the restart-date annotation is removed from the HostedControlPlane, CNO will render manifests without the annotation on pod templates. This changes the pod template spec, triggering another rollout that restores the pods to a clean state (no restart-date annotation). This is expected behavior — removing the annotation is an explicit operator action.

Test plan

  • Unit tests for ParseHostedControlPlane with restart-date annotation
  • Unit tests for SetRestartDateAnnotation covering Deployments, DaemonSets, StatefulSets, non-apps objects, namespace filtering, annotation preservation, and multi-object handling
  • go build ./... passes
  • go test ./pkg/... ./cmd/... passes
  • go vet passes
  • Manual e2e: Set hypershift.openshift.io/restart-date annotation on a HostedCluster and verified all 4 CNO operands restart (cloud-network-config-controller, multus-admission-controller, network-node-identity, ovnkube-control-plane). Full test verification report.

Fixes: https://issues.redhat.com/browse/OCPBUGS-88531

@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 Jun 15, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@bryan-cox: This pull request references Jira Issue OCPBUGS-88531, which is invalid:

  • expected the bug to target the "5.0.0" version, but no target version was set

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:

Summary

When the hypershift.openshift.io/restart-date annotation is set on a HostedControlPlane CR, CNO-managed operands like cloud-network-config-controller were not being restarted. This happened because CNO uses server-side apply with deterministic manifests — applying the same manifest twice is a no-op, so operands don't roll out unless something in the pod template changes.

This PR fixes the issue by:

  • Reading the hypershift.openshift.io/restart-date annotation from the HostedControlPlane CR in ParseHostedControlPlane()
  • Adding a SetRestartDateAnnotation() helper that injects the restart-date into pod template annotations of all rendered Deployments, DaemonSets, and StatefulSets
  • Calling this helper in the reconciler after Render() returns, gated on HyperShift mode and a non-empty restart-date value

This follows the existing patterns in CNO:

  • Reading HCP annotations in ParseHostedControlPlane (like control-plane-priority-class)
  • Modifying rendered objects post-Render (like setOVNObjectAnnotation)

This is the architecturally correct location for this logic since CNO owns these operands and should be responsible for their lifecycle.

Test plan

  • Unit tests for ParseHostedControlPlane with restart-date annotation
  • Unit tests for SetRestartDateAnnotation covering Deployments, DaemonSets, StatefulSets, non-apps objects, annotation preservation, and multi-object handling
  • go build ./... passes
  • go test ./pkg/... ./cmd/... passes
  • go vet passes
  • Manual e2e: Set hypershift.openshift.io/restart-date annotation on an HCP and verify cloud-network-config-controller pods restart

Fixes: https://issues.redhat.com/browse/OCPBUGS-88531

🤖 Generated with Claude Code via /jira:solve OCPBUGS-88531

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 Jun 15, 2026

Copy link
Copy Markdown

Walkthrough

Adds HostedControlPlane restart-date parsing and render-time propagation so apps/v1 workload pod templates can receive the restart-date annotation during reconciliation.

Changes

HyperShift restart-date propagation

Layer / File(s) Summary
Data model and parsing
pkg/hypershift/hypershift.go, pkg/hypershift/hypershift_test.go
Adds RestartDateAnnotation, Namespace, and RestartDate, extends ParseHostedControlPlane to read metadata.annotations[RestartDateAnnotation], and verifies the parsed restart date in unit tests.
Annotation setter and tests
pkg/hypershift/hypershift.go, pkg/hypershift/hypershift_test.go
Adds SetRestartDateAnnotation to update pod-template annotations for matching apps/v1 Deployment, DaemonSet, and StatefulSet objects in the target namespace, with tests covering filtering, preservation, and multi-object updates.
Reconciler integration
pkg/controller/operconfig/operconfig_controller.go
Conditionally applies restart-date annotations after render, logs setter errors, marks the operator degraded under RenderError, and stops reconciliation on failure.

Sequence Diagram(s)

sequenceDiagram
  participant OperconfigController
  participant ParseHostedControlPlane
  participant SetRestartDateAnnotation
  participant RenderedObjects

  OperconfigController->>ParseHostedControlPlane: read HostedControlPlane restart date
  OperconfigController->>SetRestartDateAnnotation: annotate rendered objects when restart date is set
  SetRestartDateAnnotation->>RenderedObjects: update pod-template annotations
  OperconfigController->>OperconfigController: mark RenderError degraded on annotation failure
Loading

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

🚥 Pre-merge checks | ✅ 14 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (14 passed)
Check name Status Explanation
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 Changed tests use static Go test names and subtest titles; no Ginkgo titles or dynamic values like timestamps, UUIDs, namespaces, or generated names were added.
Test Structure And Quality ✅ Passed PASS: New tests are pure unit tests with focused subtests, no cluster resources/Eventually calls, and they match existing table-driven Gomega style in the repo.
Microshift Test Compatibility ✅ Passed The PR adds only plain Go unit tests in pkg/hypershift/hypershift_test.go; there are no Ginkgo e2e tests or MicroShift-unsupported OpenShift API uses.
Single Node Openshift (Sno) Test Compatibility ✅ Passed Only Go unit tests were added; no Ginkgo e2e tests or multi-node/SNO assumptions were introduced.
Topology-Aware Scheduling Compatibility ✅ Passed Changes only add restart-date parsing/annotation on pod templates in the HCP namespace; no node selectors, affinities, spread constraints, replica logic, or PDBs were introduced.
Ote Binary Stdout Contract ✅ Passed The diff only adds restart-date propagation in package/reconcile code and tests; no new main/init/TestMain/suite stdout writes or klog/stdout setup were added.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PASS: The PR adds only unit tests (Test*), not new Ginkgo e2e tests, and the new tests do not use external hosts or IPv6-sensitive networking assumptions.
No-Weak-Crypto ✅ Passed Only restart-date annotation logic was added; no weak algorithms, custom crypto, or secret/token comparisons appear in the changed files.
Container-Privileges ✅ Passed HEAD only changes three Go files; the added logic is annotation-only and no privileged/hostPID/allowPrivilegeEscalation settings were introduced.
No-Sensitive-Data-In-Logs ✅ Passed New logs only emit generic errors and resource kind/name; I found no logging of secrets, tokens, PII, session IDs, or customer data.
Title check ✅ Passed The title clearly summarizes the main change: propagating restart-date annotations to CNO operand pod templates.
Description check ✅ Passed The description directly matches the code changes and explains the restart-date propagation fix, tests, and scope.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@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 Jun 15, 2026
@openshift-ci

openshift-ci Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pkg/hypershift/hypershift_test.go`:
- Around line 154-155: The test code is discarding error returns by using blank
identifiers (_) instead of capturing them, which can mask test failures and
produce misleading passes. Identify all instances in the test file where
function calls return errors that are being ignored (such as calls to
unstructured.NestedStringMap and similar utility functions), capture the
returned error values instead of discarding them with _, and add appropriate
assertions or error handling using the test assertion framework (e.g.,
g.Expect(err).NotTo(HaveOccurred())) to verify these operations succeed as
expected during test setup and assertions.

In `@pkg/hypershift/hypershift.go`:
- Line 291: The call to unstructured.NestedStringMap is discarding the error
return value (the third return value) by using a blank identifier, which means
any errors from malformed annotations are silently ignored. Instead of ignoring
the error, capture it as a named variable in the assignment to
unstructured.NestedStringMap, check if the error is non-nil, and handle it
appropriately before proceeding to mutate the pod-template annotations. This
ensures that rendering defects in the annotations are surfaced rather than
silently hidden.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: 37272bb8-3d49-4c7b-9530-3c9966bb18b4

📥 Commits

Reviewing files that changed from the base of the PR and between 6dc1804 and d807287.

📒 Files selected for processing (3)
  • pkg/controller/operconfig/operconfig_controller.go
  • pkg/hypershift/hypershift.go
  • pkg/hypershift/hypershift_test.go

Comment thread pkg/hypershift/hypershift_test.go Outdated
Comment thread pkg/hypershift/hypershift.go Outdated
@bryan-cox
bryan-cox marked this pull request as ready for review June 15, 2026 16:42
@bryan-cox

Copy link
Copy Markdown
Member Author

/jira refresh

@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 Jun 15, 2026
@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 Jun 15, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@bryan-cox: This pull request references Jira Issue OCPBUGS-88531, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)
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-robot

Copy link
Copy Markdown
Contributor

@bryan-cox: This pull request references Jira Issue OCPBUGS-88531, which is valid.

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

In response to this:

Summary

When the hypershift.openshift.io/restart-date annotation is set on a HostedControlPlane CR, CNO-managed operands like cloud-network-config-controller were not being restarted. This happened because CNO uses server-side apply with deterministic manifests — applying the same manifest twice is a no-op, so operands don't roll out unless something in the pod template changes.

This PR fixes the issue by:

  • Reading the hypershift.openshift.io/restart-date annotation from the HostedControlPlane CR in ParseHostedControlPlane()
  • Adding a SetRestartDateAnnotation() helper that injects the restart-date into pod template annotations of all rendered Deployments, DaemonSets, and StatefulSets
  • Calling this helper in the reconciler after Render() returns, gated on HyperShift mode and a non-empty restart-date value

This follows the existing patterns in CNO:

  • Reading HCP annotations in ParseHostedControlPlane (like control-plane-priority-class)
  • Modifying rendered objects post-Render (like setOVNObjectAnnotation)

This is the architecturally correct location for this logic since CNO owns these operands and should be responsible for their lifecycle.

Test plan

  • Unit tests for ParseHostedControlPlane with restart-date annotation
  • Unit tests for SetRestartDateAnnotation covering Deployments, DaemonSets, StatefulSets, non-apps objects, annotation preservation, and multi-object handling
  • go build ./... passes
  • go test ./pkg/... ./cmd/... passes
  • go vet passes
  • Manual e2e: Set hypershift.openshift.io/restart-date annotation on an HCP and verify cloud-network-config-controller pods restart

Fixes: https://issues.redhat.com/browse/OCPBUGS-88531

🤖 Generated with Claude Code via /jira:solve OCPBUGS-88531

Summary by CodeRabbit

Release Notes

  • New Features

  • Added restart date annotation support for HyperShift control planes. The system now reads a restart date from control plane metadata and propagates it to provisioned Deployments, DaemonSets, and StatefulSets.

  • Bug Fixes

  • Improved reconciliation behavior by failing fast if restart-date annotation updates cannot be applied, marking the operator as degraded instead of continuing.

  • Tests

  • Added unit tests covering restart date parsing and propagation across supported controller kinds.

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 requested review from kyrtapz and marty-power June 15, 2026 16:49
@bryan-cox

Copy link
Copy Markdown
Member Author

/retest-required

@bryan-cox

Copy link
Copy Markdown
Member Author

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Jun 16, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@bryan-cox: This PR has been marked as verified by @bryan-cox.

Details

In response to this:

/verified by @bryan-cox

https://bryan-cox.github.io/architectural-artifact-sharing/test-verification-report-ocpbugs-88531/

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.

@bryan-cox

Copy link
Copy Markdown
Member Author

/retest


restartDate, _, err := unstructured.NestedString(hcp.UnstructuredContent(), "metadata", "annotations", RestartDateAnnotation)
if err != nil {
return nil, fmt.Errorf("failed to extract restart date annotation: %v", err)

@mgencur mgencur Jun 18, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nit: It would be better to use %w to preserve the error chain but since all other calls in this file use %v let's keep it.

@mgencur

mgencur commented Jun 18, 2026

Copy link
Copy Markdown

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jun 18, 2026

@kyrtapz kyrtapz 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.

When the hypershift.openshift.io/restart-date annotation is set on a HostedControlPlane CR, CNO-managed operands like cloud-network-config-controller were not being restarted. This happened because CNO uses server-side apply with deterministic manifests — applying the same manifest twice is a no-op, so operands don't roll out unless something in the pod template changes.

While the change is mostly I don't get the reasoning from the PR description.
CNO never propagated this annotation to its operand pod templates, so there was nothing to trigger a rollout. This has nothing to do with SSA.

Comment thread pkg/hypershift/hypershift.go Outdated

// SetRestartDateAnnotation sets the restart-date annotation on pod templates of all
// Deployment, DaemonSet, and StatefulSet objects to trigger a rolling restart.
func SetRestartDateAnnotation(objs []*unstructured.Unstructured, restartDate string) error {

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.

This will cause a rollout of ALL CNO managed Deployments, DaemonSets, and StatefulSets, even if they run only in the hosted cluster.
I was sure that this annotation only affects the control-plane components in hypershift, is that not the case?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good catch — SetRestartDateAnnotation currently operates on all rendered objects from Render(), which includes guest-cluster DaemonSets (ovnkube-node, multus, etc.), not just the HCP-namespace control-plane Deployments. The original CPO restart logic only targeted multus-admission-controller, network-node-identity, and ovnkube-control-plane in the HCP namespace.

I'll scope this by filtering on the HCP namespace so only control-plane objects are annotated.

r.status.UnsetProgressing(statusmanager.OperatorRender)
}

if hcp := bootstrapResult.Infra.HostedControlPlane; hcp != nil && hcp.RestartDate != "" {

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.

When the annotation is removed there will be another rollout, is this the expected behavior?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, removing the annotation would cause another rollout since the pod template spec changes (annotation removed). This is the expected behavior — removing the annotation is an explicit operator action, and the resulting rollout restores the clean state. I'll document this in the PR description.

@bryan-cox

Copy link
Copy Markdown
Member Author

/retest-required

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD 5baa578 and 1 for PR HEAD ab7d755 in total

@bryan-cox

Copy link
Copy Markdown
Member Author

/retest-required

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD 93ca1e5 and 0 for PR HEAD ab7d755 in total

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

/hold

Revision ab7d755 was retested 3 times: holding

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 25, 2026
@kyrtapz

kyrtapz commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

/override ci/prow/e2e-metal-ipi-ovn-dualstack-bgp-local-gw
/override ci/prow/e2e-aws-ovn-upgrade-ipsec
/override ci/prow/e2e-ovn-ipsec-step-registry
/override ci/prow/e2e-metal-ipi-ovn-ipv6-ipsec

@openshift-ci openshift-ci Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 7, 2026
@kyrtapz

kyrtapz commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

/hold cancel
@bryan-cox you need a rebase

@openshift-ci

openshift-ci Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

@kyrtapz: Overrode contexts on behalf of kyrtapz: ci/prow/e2e-aws-ovn-upgrade-ipsec, ci/prow/e2e-metal-ipi-ovn-dualstack-bgp-local-gw, ci/prow/e2e-metal-ipi-ovn-ipv6-ipsec, ci/prow/e2e-ovn-ipsec-step-registry

Details

In response to this:

/override ci/prow/e2e-metal-ipi-ovn-dualstack-bgp-local-gw
/override ci/prow/e2e-aws-ovn-upgrade-ipsec
/override ci/prow/e2e-ovn-ipsec-step-registry
/override ci/prow/e2e-metal-ipi-ovn-ipv6-ipsec

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.

@openshift-ci openshift-ci Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 7, 2026
…emplates

When the hypershift.openshift.io/restart-date annotation is set on a
HostedControlPlane, CNO now reads it and injects it into the pod
template annotations of all rendered Deployments, DaemonSets, and
StatefulSets. This triggers Kubernetes rolling restarts for all CNO
operands, including cloud-network-config-controller which was
previously missed.

The fix follows the existing pattern of reading HCP annotations in
ParseHostedControlPlane (like priority-class) and modifying rendered
objects post-Render (like setOVNObjectAnnotation). This is the correct
architectural location for this logic since CNO owns these operands.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@openshift-ci-robot openshift-ci-robot removed the verified Signifies that the PR passed pre-merge verification criteria label Jul 9, 2026
@openshift-ci openshift-ci Bot removed lgtm Indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jul 9, 2026
@bryan-cox

Copy link
Copy Markdown
Member Author

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Jul 9, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@bryan-cox: This PR has been marked as verified by @bryan-cox.

Details

In response to this:

/verified by @bryan-cox

https://bryan-cox.github.io/architectural-artifact-sharing/test-verification-report-ocpbugs-88531/

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.

@bryan-cox

Copy link
Copy Markdown
Member Author

@kyrtapz could I get lgtm again please when you have a moment?

I rebased.

@kyrtapz

kyrtapz commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jul 9, 2026
@openshift-ci

openshift-ci Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bryan-cox, kyrtapz, mgencur

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-merge-bot

Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD 125f66d and 2 for PR HEAD eeac17c in total

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD 0a9965a and 1 for PR HEAD eeac17c in total

@kyrtapz

kyrtapz commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

/override ci/prow/e2e-metal-ipi-ovn-ipv6-ipsec
/override ci/prow/e2e-aws-ovn-upgrade-ipsec
/override ci/prow/e2e-ovn-ipsec-step-registry

@openshift-ci

openshift-ci Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

@kyrtapz: Overrode contexts on behalf of kyrtapz: ci/prow/e2e-aws-ovn-upgrade-ipsec, ci/prow/e2e-metal-ipi-ovn-ipv6-ipsec, ci/prow/e2e-ovn-ipsec-step-registry

Details

In response to this:

/override ci/prow/e2e-metal-ipi-ovn-ipv6-ipsec
/override ci/prow/e2e-aws-ovn-upgrade-ipsec
/override ci/prow/e2e-ovn-ipsec-step-registry

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.

@openshift-ci

openshift-ci Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

@bryan-cox: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/5.0-upgrade-from-stable-4.22-e2e-aws-ovn-upgrade eeac17c link false /test 5.0-upgrade-from-stable-4.22-e2e-aws-ovn-upgrade
ci/prow/e2e-aws-ovn-rhcos10-techpreview eeac17c link false /test e2e-aws-ovn-rhcos10-techpreview
ci/prow/5.0-upgrade-from-stable-4.22-e2e-azure-ovn-upgrade eeac17c link false /test 5.0-upgrade-from-stable-4.22-e2e-azure-ovn-upgrade
ci/prow/5.0-upgrade-from-stable-4.22-e2e-gcp-ovn-upgrade eeac17c link false /test 5.0-upgrade-from-stable-4.22-e2e-gcp-ovn-upgrade

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.

@openshift-merge-bot
openshift-merge-bot Bot merged commit fc89599 into openshift:master Jul 10, 2026
26 of 30 checks passed
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@bryan-cox: Jira Issue OCPBUGS-88531: Some pull requests linked via external trackers have merged:

The following pull request, linked via external tracker, has not merged:

All associated pull requests must be merged or unlinked from the Jira bug in order for it to move to the next state. Once unlinked, request a bug refresh with /jira refresh.

Jira Issue OCPBUGS-88531 has not been moved to the MODIFIED state.

This PR is marked as verified. If the remaining PRs listed above are marked as verified before merging, the issue will automatically be moved to VERIFIED after all of the changes from the PRs are available in an accepted nightly payload.

Details

In response to this:

Summary

When the hypershift.openshift.io/restart-date annotation is set on a HostedControlPlane CR, CNO-managed operands like cloud-network-config-controller were not being restarted. CNO never propagated this annotation to its operand pod templates, so there was nothing to trigger a rollout.

Previously, the CPO (control-plane-operator) handled restart-date propagation by directly patching individual deployments (multus-admission-controller, network-node-identity, ovnkube-control-plane), but this approach missed cloud-network-config-controller entirely — which is the bug reported in OCPBUGS-88531.

This PR fixes the issue by having CNO propagate the annotation itself:

  • Reading the hypershift.openshift.io/restart-date annotation from the HostedControlPlane CR in ParseHostedControlPlane()
  • Adding a SetRestartDateAnnotation() helper that injects the restart-date into pod template annotations of rendered Deployments, DaemonSets, and StatefulSets within the HCP namespace only (guest-cluster workloads are not affected)
  • Calling this helper in the reconciler after Render() returns, gated on HyperShift mode and a non-empty restart-date value

The companion HyperShift PR (#8751) removes the redundant CPO-side restart logic, since CNO now handles it directly.

Annotation removal behavior

If the restart-date annotation is removed from the HostedControlPlane, CNO will render manifests without the annotation on pod templates. This changes the pod template spec, triggering another rollout that restores the pods to a clean state (no restart-date annotation). This is expected behavior — removing the annotation is an explicit operator action.

Test plan

  • Unit tests for ParseHostedControlPlane with restart-date annotation
  • Unit tests for SetRestartDateAnnotation covering Deployments, DaemonSets, StatefulSets, non-apps objects, namespace filtering, annotation preservation, and multi-object handling
  • go build ./... passes
  • go test ./pkg/... ./cmd/... passes
  • go vet passes
  • Manual e2e: Set hypershift.openshift.io/restart-date annotation on a HostedCluster and verified all 4 CNO operands restart (cloud-network-config-controller, multus-admission-controller, network-node-identity, ovnkube-control-plane). Full test verification report.

Fixes: https://issues.redhat.com/browse/OCPBUGS-88531

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.

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. 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. lgtm Indicates that a PR is ready to be merged. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants