Skip to content

CNTRLPLANE-3532: migrate CPO status patches to statuspatching helpers - #8966

Open
vsolanki12 wants to merge 1 commit into
openshift:mainfrom
vsolanki12:vsolanki/cntrlplane-3532-tier2-optimistic-lock
Open

CNTRLPLANE-3532: migrate CPO status patches to statuspatching helpers#8966
vsolanki12 wants to merge 1 commit into
openshift:mainfrom
vsolanki12:vsolanki/cntrlplane-3532-tier2-optimistic-lock

Conversation

@vsolanki12

@vsolanki12 vsolanki12 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

Migrates 9 status patch call sites in the CPO to use statuspatching.PatchStatus / PatchStatusCondition, adding retry-on-conflict and consistent optimistic locking.

  • hostedcontrolplane_controller.go: 7 sites migrated (reconcileDeletion, update, reconcileValidIDPConfigurationCondition, removeCloudResources, reconcileDefaultSecurityGroup)
  • reencryption.go: 1 site migrated (HCCO re-encryption controller)
  • 2 batch-patch sites deferred — they accumulate status across the full reconcile loop and require restructuring

Part of the broader CNTRLPLANE-3532 migration. Depends on PR #8782 (merged).

Which issue(s) this PR fixes:

Fixes CNTRLPLANE-3532

Special notes for your reviewer:

  • 2 batch-patch sites (lines 686, 869 in hostedcontrolplane_controller.go) are intentionally skipped — they accumulate status changes from the entire reconcile loop and migrating them requires restructuring the reconcile flow.
  • The originalHostedControlPlane parameter was removed from reconcileDeletion since the migrated helpers handle re-fetching internally.

Checklist:

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

Summary by CodeRabbit

  • Bug Fixes

    • Improved reliability of control plane status updates during AWS security-group creation and deletion, release-image checks, identity-provider validation, and cloud-resource cleanup.
    • AWS security-group identifiers are now retained after successful creation.
    • Improved persistence and accuracy of secret-encryption migration status, conditions, and completion reporting.
  • Tests

    • Added coverage for security-group failures, deletion status persistence, identity-provider readiness, and platform-status updates.

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jul 9, 2026
@openshift-ci-robot

openshift-ci-robot commented Jul 9, 2026

Copy link
Copy Markdown

@vsolanki12: This pull request references CNTRLPLANE-3532 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

What this PR does / why we need it:

Migrates 9 status patch call sites in the CPO to use statuspatching.PatchStatus / PatchStatusCondition, adding retry-on-conflict and consistent optimistic locking.

  • hostedcontrolplane_controller.go: 7 sites migrated (reconcileDeletion, update, reconcileValidIDPConfigurationCondition, removeCloudResources, reconcileDefaultSecurityGroup)
  • reencryption.go: 1 site migrated (HCCO re-encryption controller)
  • 2 batch-patch sites deferred — they accumulate status across the full reconcile loop and require restructuring

Part of the broader CNTRLPLANE-3532 migration. Depends on PR #8782 (merged).

Which issue(s) this PR fixes:

Fixes CNTRLPLANE-3532

Special notes for your reviewer:

  • 2 batch-patch sites (lines 686, 869 in hostedcontrolplane_controller.go) are intentionally skipped — they accumulate status changes from the entire reconcile loop and migrating them requires restructuring the reconcile flow.
  • The originalHostedControlPlane parameter was removed from reconcileDeletion since the migrated helpers handle re-fetching internally.

Checklist:

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

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 added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 9, 2026
@openshift-ci

openshift-ci Bot commented Jul 9, 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 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: d2add2cd-9f15-4f34-b8f4-9fccfffc3e91

📥 Commits

Reviewing files that changed from the base of the PR and between 7d42488 and af4c08c.

📒 Files selected for processing (1)
  • control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go

📝 Walkthrough

Walkthrough

The controllers now use statuspatching for targeted HostedControlPlane status and condition updates. This covers deletion, validation, timeout, scaling, and AWS default security-group reconciliation. Successful security-group creation records the AWS security-group ID. Re-encryption reconciliation patches encryption-related status fields and conditions, and updates migration metrics. Tests cover deletion persistence and default security-group outcomes.

Possibly related PRs

Suggested reviewers: enxebre, devguyio

Mergeability Score: ⚪ Minimal · up to af4c0

This PR updates status patch handling and adds consistent conflict retries; no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 10 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Test Structure And Quality ⚠️ Warning The added t.Run/Gomega tests contain uncontextualized assertions such as err checks and fakeClient.Get at lines 4576, 4586, 4588, and 4597, contrary to the required diagnostic messages. Add meaningful messages to every new assertion, especially error and fake-client Get checks, such as identifying the operation and expected persisted status.
✅ Passed checks (10 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: migrating CPO status patches to statuspatching helpers.
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 added subtest titles are static descriptive literals; dynamic values such as VPC IDs and CIDRs remain in test setup, not titles.
Topology-Aware Scheduling Compatibility ✅ Passed The production diff only changes HCP status/condition patching and metrics; it adds no affinity, spread, node selector, toleration, replica, PDB, or other scheduling constraint.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The diff adds standard Go unit tests using func Test... and Gomega, not Ginkgo e2e tests; no external connectivity requirement applies.
No-Weak-Crypto ✅ Passed The diff adds status patching and encryption-status bookkeeping only; added-line scans found no MD5, SHA-1, DES, RC4, 3DES, Blowfish, ECB, custom crypto, or secret/token comparison.
Container-Privileges ✅ Passed The PR changes only three Go files; the added diff contains no privileged, hostPID, hostNetwork, hostIPC, SYS_ADMIN, root, or allowPrivilegeEscalation settings.
No-Sensitive-Data-In-Logs ✅ Passed The PR adds no production logging calls or sensitive log fields. statuspatching only fetches and patches status; existing fingerprint/hash logs are unchanged.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@openshift-ci openshift-ci Bot added area/control-plane-operator Indicates the PR includes changes for the control plane operator - in an OCP release and removed do-not-merge/needs-area labels Jul 9, 2026
@vsolanki12
vsolanki12 force-pushed the vsolanki/cntrlplane-3532-tier2-optimistic-lock branch from fb8a23c to d73cc0d Compare July 9, 2026 13:57
@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 25 lines in your changes missing coverage. Please review.
✅ Project coverage is 45.76%. Comparing base (ab71ef1) to head (7d42488).
⚠️ Report is 25 commits behind head on main.

Files with missing lines Patch % Lines
...ostedcontrolplane/hostedcontrolplane_controller.go 55.10% 16 Missing and 6 partials ⚠️
...goperator/controllers/reencryption/reencryption.go 88.46% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8966      +/-   ##
==========================================
+ Coverage   45.67%   45.76%   +0.08%     
==========================================
  Files         781      781              
  Lines       97726    97728       +2     
==========================================
+ Hits        44641    44725      +84     
+ Misses      50019    49933      -86     
- Partials     3066     3070       +4     
Files with missing lines Coverage Δ
...goperator/controllers/reencryption/reencryption.go 70.46% <88.46%> (+1.11%) ⬆️
...ostedcontrolplane/hostedcontrolplane_controller.go 49.21% <55.10%> (+2.94%) ⬆️
Flag Coverage Δ
cmd-support 38.79% <ø> (ø)
cpo-hostedcontrolplane 48.27% <55.10%> (+0.43%) ⬆️
cpo-other 45.95% <88.46%> (+0.06%) ⬆️
hypershift-operator 56.97% <ø> (ø)
other 34.38% <ø> (ø)

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

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

@coderabbitai coderabbitai Bot 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.

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
`@control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go`:
- Around line 1117-1139: The status patch in hostedcontrolplane_controller.go is
using a stale copy of HostedControlPlane and will overwrite earlier updates made
in update() and reconcileCPOV2. Fix the PatchStatus call to patch the current
in-memory hostedControlPlane state, or explicitly merge the existing status
fields back before setting ValidReleaseInfo. Keep the existing status mutations
such as Ready, KubeConfig, KubeadminPassword, ControlPlaneVersion, Initialized,
and prior conditions intact when applying the patch.

In
`@control-plane-operator/hostedclusterconfigoperator/controllers/reencryption/reencryption.go`:
- Around line 76-89: The `desiredCondition` in `reconcile` is a pointer into
`hcp.Status.Conditions`, so `statuspatching.PatchStatus` may re-fetch and
overwrite the backing slice before the callback uses it. Capture the condition
by value before calling `PatchStatus` (for example, copy the result of
`meta.FindStatusCondition` into a standalone variable) and then use that copied
value inside the patch callback when setting `hcp.Status.Conditions`.
🪄 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 YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: ddb9d783-3baf-45e9-a217-5ed2a8755bb9

📥 Commits

Reviewing files that changed from the base of the PR and between 1f2811f and fb8a23c.

📒 Files selected for processing (3)
  • control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go
  • control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller_test.go
  • control-plane-operator/hostedclusterconfigoperator/controllers/reencryption/reencryption.go

@vsolanki12
vsolanki12 force-pushed the vsolanki/cntrlplane-3532-tier2-optimistic-lock branch from d73cc0d to 7848ce8 Compare July 9, 2026 14:54
@hypershift-jira-solve-ci

hypershift-jira-solve-ci Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Both failures are now fully analyzed. Let me produce the final report.

Test Failure Analysis Complete

Job Information


  • Konflux Job: Red Hat Konflux / control-plane-operator-main-on-pull-request
  • Check Run ID: 86150298660
  • PipelineRun: control-plane-operator-main-on-pull-request-gkspc

Test Failure Analysis

Error

# Job 1: verify / Verify — make deps failure
golang.org/x/net@v0.53.0: read "https://proxy.golang.org/golang.org/x/net/@v/v0.53.0.zip": stream error: stream ID 773; INTERNAL_ERROR; received from peer
github.com/alecthomas/chroma/v2@v2.23.1: read "https://proxy.golang.org/github.com/alecthomas/chroma/v2/@v/v2.23.1.zip": stream error: stream ID 787; INTERNAL_ERROR; received from peer
make: *** [Makefile:552: deps] Error 1

# Job 2: Red Hat Konflux / control-plane-operator — rpms-signature-scan image pull failure
the step "rpms-signature-scan" in TaskRun failed to pull the image "quay.io/konflux-ci/tools@sha256:cdab2b0f6e01ed7852ad4c5376fd58bdbfe0db1379dd5acf42aad722a0f1e168":
Back-off pulling image: ErrImagePull: copying system image from manifest list: parsing image configuration: fetching blob: received unexpected HTTP status: 503 Service Unavailable.

Summary

Both failures are transient infrastructure flakes completely unrelated to the code changes in PR #8966. The verify / Verify job failed because the Go module proxy (proxy.golang.org) returned HTTP/2 INTERNAL_ERROR stream errors while downloading dependency zip files during make deps. The Konflux / control-plane-operator job failed because Quay.io returned 503 Service Unavailable when the rpms-signature-scan Tekton task attempted to pull its tooling image. All 16 other Konflux pipeline tasks (including build, security scans, and SBOM generation) succeeded. Retrying both jobs should resolve these failures.

Root Cause

Job 1 — verify / Verify:
The make generate update target invokes make deps, which builds tools from hack/tools. During go build -tags=tools, the Go module proxy at proxy.golang.org returned HTTP/2 stream-level INTERNAL_ERROR responses for two module zip downloads:

  1. golang.org/x/net@v0.53.0 — cascading across 7+ import chains (html/charset, proxy, http2, grpc, etc.)
  2. github.com/alecthomas/chroma/v2@v2.23.1 — via golangci-lint → goformat → chroma/quick

These are server-side errors from the Go module proxy CDN, not local network issues or code problems.

Job 2 — Red Hat Konflux / control-plane-operator-main-on-pull-request:
The pipeline completed 16 of 17 tasks successfully. The sole failing task was rpms-signature-scan, which has status TaskRunImagePullFailed. The Tekton pod could not pull quay.io/konflux-ci/tools@sha256:cdab2b... because Quay.io returned HTTP 503 during blob fetch. This also caused the downstream enterprise-contract check to be cancelled (it never ran since it depends on this pipeline).

Neither failure is related to the PR's code changes (migrating CPO status patches to statuspatching helpers).

Recommendations
  1. Rerun both jobs — these are transient infrastructure failures that will resolve on retry.
  2. For the Verify job: Use the GitHub Actions "Re-run failed jobs" button or push an empty commit to re-trigger.
  3. For the Konflux job: Re-trigger via the Konflux UI or add a /retest comment if supported. The downstream enterprise-contract check will automatically run once the pipeline succeeds.
  4. No code changes are needed in PR CNTRLPLANE-3532: migrate CPO status patches to statuspatching helpers #8966.
Evidence
Evidence Detail
Verify failed step Step 4 — "Run make generate update" at Makefile:552 (deps target)
Go proxy error 1 golang.org/x/net@v0.53.0 — HTTP/2 stream ID 773 INTERNAL_ERROR from proxy.golang.org
Go proxy error 2 github.com/alecthomas/chroma/v2@v2.23.1 — HTTP/2 stream ID 787 INTERNAL_ERROR from proxy.golang.org
Konflux failed task rpms-signature-scan — status TaskRunImagePullFailed (8s duration)
Konflux image pull error quay.io/konflux-ci/tools@sha256:cdab2b... — HTTP 503 Service Unavailable from Quay.io
Konflux passing tasks 16/17 tasks passed (init, clone, build-images, clair-scan, sast-snyk, etc.)
Konflux cancelled downstream enterprise-contract check cancelled due to pipeline failure
Other Konflux pipelines hypershift-operator-main-on-pull-request ✅ passed
PR HEAD SHA 7848ce80b2b3931be0f1cf2fecb7582cb036fc0c

@vsolanki12
vsolanki12 marked this pull request as ready for review July 13, 2026 09:27
@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 Jul 13, 2026
@openshift-ci
openshift-ci Bot requested review from devguyio and enxebre July 13, 2026 09:28
@vsolanki12 vsolanki12 closed this Jul 13, 2026
@vsolanki12 vsolanki12 reopened this Jul 13, 2026

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

The migration to statuspatching helpers looks well-executed across all call sites. F1 (metrics regression in reencryption.go) is the main concern — the rest are suggestions.

}

// Record metrics when encryption status changed.
if !equality.Semantic.DeepEqual(previousEncryption, desiredEncryption) {

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.

recordMigrationState is now gated behind the DeepEqual check, but the old code called it unconditionally on every reconcile. After an HCCO pod restart in steady state (no encryption change), all hypershift_encryption_migration_state gauges stay at zero indefinitely — the "idle" gauge is never re-set to 1. This could confuse dashboards/alerts until the next key rotation, which may be weeks away.

Consider moving recordMigrationState outside the if !equality.Semantic.DeepEqual(...) block so it runs unconditionally, matching the old behavior. recordMigrationDuration should stay inside the guard since it should only fire on actual transitions.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done. Moved recordMigrationState outside the DeepEqual guard so it runs unconditionally on every reconcile, matching the old behavior. recordMigrationDuration stays inside the guard since it should only fire on actual transitions.


AI-assisted response via Claude Code


func (r *HostedControlPlaneReconciler) reconcileDeletion(ctx context.Context, hostedControlPlane *hyperv1.HostedControlPlane, originalHostedControlPlane *hyperv1.HostedControlPlane) (ctrl.Result, error) {
func (r *HostedControlPlaneReconciler) reconcileDeletion(ctx context.Context, hostedControlPlane *hyperv1.HostedControlPlane) (ctrl.Result, error) {
condition := &metav1.Condition{

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.

Nit: condition is declared as a pointer (&metav1.Condition{...}) and then dereferenced (*condition) when passed to PatchStatusCondition. The other migrated sites (reconcileDefaultSecurityGroup, removeCloudResources) use value types or inline literals. Switching to a value type here would be more consistent and avoids the unnecessary indirection.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done. Changed condition from *metav1.Condition to metav1.Condition — consistent with the other migrated sites now.


AI-assisted response via Claude Code

if err := statuspatching.PatchStatus(ctx, r.Client, hcp, func() error {
meta.SetStatusCondition(&hcp.Status.Conditions, condition)
if creationErr == nil {
hcp.Status.Platform = &hyperv1.PlatformStatus{

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.

Pre-existing, but worth noting since the PatchStatus migration touches this: the callback replaces the entire hcp.Status.Platform struct with a new one containing only the security group ID. If PlatformStatus gains additional fields in the future, they'd be silently cleared on every reconcile. With PatchStatus retrying on conflict, the fresh struct also discards whatever the server has at retry time.

Consider initializing hcp.Status.Platform / hcp.Status.Platform.AWS if nil instead of replacing, then setting only DefaultWorkerSecurityGroupID.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done. Changed to init-if-nil pattern — hcp.Status.Platform and hcp.Status.Platform.AWS are now initialized only if nil, then only DefaultWorkerSecurityGroupID is set. This preserves any other fields that may be added to PlatformStatus in the future.


AI-assisted response via Claude Code

Status: metav1.ConditionTrue,
Reason: hyperv1.AsExpectedReason,
Message: hyperv1.AllIsWellMessage,
ObservedGeneration: hostedControlPlane.Generation,

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.

Not a regression (old code also re-fetched before referencing Generation), but ObservedGeneration inside the PatchStatus closure will reflect the re-fetched HCP's generation, which may be newer than the generation used to compute missingImages. If the spec changed between the original read and the re-fetch, the condition content won't match what that generation actually means. A follow-up reconcile self-corrects, so this is minor — just flagging in case you want to snapshot the generation before the PatchStatus call.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Acknowledged. This is pre-existing — the old code also re-fetched before referencing Generation. A follow-up reconcile self-corrects, so leaving as-is for now.


AI-assisted response via Claude Code

@vsolanki12
vsolanki12 force-pushed the vsolanki/cntrlplane-3532-tier2-optimistic-lock branch from 7848ce8 to 4237039 Compare July 15, 2026 04:08
// Capture desired status changes computed by reconcile().
// Copy by value — PatchStatus re-fetches hcp, which replaces the backing slice.
desiredEncryption := *hcp.Status.SecretEncryption.DeepCopy()
var desiredCondition metav1.Condition

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.

Potential semantic narrowing: The original MergeFrom(originalHCP) patch captured all status mutations made by reconcile(). This new code snapshots only SecretEncryption and the EtcdDataEncryptionUpToDate condition, then replays just those two fields inside the PatchStatus closure.

If reconcile() (or any of its sub-functions like handleInitialBootstrap, startNewRotation, handleMigratingPhase, etc.) sets other status fields or conditions beyond these two, those changes are silently dropped after PatchStatus re-fetches the object.

Is EtcdDataEncryptionUpToDate the only condition reconcile() touches? If so this is fine — but worth a comment saying so. If not, the other conditions need to be captured and replayed too.

@vsolanki12 vsolanki12 Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch. Confirmed — reconcile() only mutates SecretEncryption and the EtcdDataEncryptionUpToDate condition. No other status fields or conditions. Added a comment on the snapshot block stating this explicitly.

@openshift-ci openshift-ci Bot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. area/api Indicates the PR includes changes for the API area/ci-tooling Indicates the PR includes changes for CI or tooling area/cli Indicates the PR includes changes for CLI area/documentation Indicates the PR includes changes for documentation area/hypershift-operator Indicates the PR includes changes for the hypershift operator and API - outside an OCP release labels Jul 28, 2026
@vsolanki12
vsolanki12 force-pushed the vsolanki/cntrlplane-3532-tier2-optimistic-lock branch from 9a6b2ba to f0f6ec1 Compare August 8, 2026 01:11
@cblecker

Copy link
Copy Markdown
Member

@coderabbitai resume

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Reviews resumed.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@coderabbitai coderabbitai Bot 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.

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
`@control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller_test.go`:
- Around line 4458-4573: Extend TestReconcileDefaultSecurityGroup with a
successful createAWSDefaultSecurityGroup table case, configuring the EC2 mock
for the required VPC lookup and security-group creation calls. Mark the identity
provider ready, reconcile successfully, re-read the HostedControlPlane from
fakeClient, and assert AWSDefaultSecurityGroupCreated is True,
DefaultWorkerSecurityGroupID is non-empty, and no error occurs.
- Around line 4435-4444: The test currently checks the in-memory hcp condition
rather than the persisted status. After r.reconcileDeletion returns, re-fetch
hcp with fakeClient.Get using client.ObjectKeyFromObject(hcp), then assert the
deletion condition on the re-read object while preserving the existing reconcile
error assertion.
🪄 Autofix

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 YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 470ad102-68d8-4cb7-ad19-2c2ec8ab387e

📥 Commits

Reviewing files that changed from the base of the PR and between 01b36e3 and f0f6ec1.

📒 Files selected for processing (3)
  • control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go
  • control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller_test.go
  • control-plane-operator/hostedclusterconfigoperator/controllers/reencryption/reencryption.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go

@cblecker

Copy link
Copy Markdown
Member

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Aug 10, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-aks
/test e2e-aws
/test e2e-aws-upgrade-hypershift-operator
/test e2e-kubevirt-aws-ovn-reduced
/test e2e-v2-aws
/test e2e-v2-azure-self-managed
/test e2e-v2-gke

@vsolanki12
vsolanki12 force-pushed the vsolanki/cntrlplane-3532-tier2-optimistic-lock branch from f0f6ec1 to 756f882 Compare August 12, 2026 06:00
@openshift-ci openshift-ci Bot removed the lgtm Indicates that a PR is ready to be merged. label Aug 12, 2026
@vsolanki12

Copy link
Copy Markdown
Contributor Author

/test security

@vsolanki12
vsolanki12 force-pushed the vsolanki/cntrlplane-3532-tier2-optimistic-lock branch from 756f882 to 7d42488 Compare August 12, 2026 07:08
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@cblecker

Copy link
Copy Markdown
Member

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Aug 12, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-aks
/test e2e-aws
/test e2e-aws-upgrade-hypershift-operator
/test e2e-kubevirt-aws-ovn-reduced
/test e2e-v2-aws
/test e2e-v2-azure-self-managed
/test e2e-v2-gke

@vsolanki12

Copy link
Copy Markdown
Contributor Author

/retest

@bryan-cox

Copy link
Copy Markdown
Member

/rebase

@github-actions

Copy link
Copy Markdown

🤖 Rebasing PR onto main: workflow run

…ng helpers

Migrate 9 status patch call sites across hostedcontrolplane_controller.go
and reencryption.go to use the shared statuspatching package, adding
retry-on-conflict and consistent optimistic locking.

- hostedcontrolplane_controller.go: 7 sites migrated to PatchStatus /
  PatchStatusCondition (reconcileDeletion, update, reconcileValidIDP,
  removeCloudResources, reconcileDefaultSecurityGroup)
- reencryption.go: 1 site migrated to PatchStatus
- 2 batch-patch sites (lines 686, 869) deferred — they accumulate
  status changes across the full reconcile loop and need restructuring

Signed-off-by: Vimal Solanki <vsolanki@redhat.com>
@github-actions
github-actions Bot force-pushed the vsolanki/cntrlplane-3532-tier2-optimistic-lock branch from 7d42488 to af4c08c Compare August 13, 2026 17:52
@openshift-ci openshift-ci Bot removed the lgtm Indicates that a PR is ready to be merged. label Aug 13, 2026
@bryan-cox

Copy link
Copy Markdown
Member

/lgtm

Putting this back on after rebase

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Aug 13, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-aks
/test e2e-aws
/test e2e-aws-upgrade-hypershift-operator
/test e2e-kubevirt-aws-ovn-reduced
/test e2e-v2-aws
/test e2e-v2-azure-self-managed
/test e2e-v2-gke

@vsolanki12

Copy link
Copy Markdown
Contributor Author

/retest

1 similar comment
@vsolanki12

Copy link
Copy Markdown
Contributor Author

/retest

@openshift-ci

openshift-ci Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

@vsolanki12: The following test 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/e2e-kubevirt-aws-ovn-reduced af4c08c link true /test e2e-kubevirt-aws-ovn-reduced

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.

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

Labels

area/api Indicates the PR includes changes for the API area/ci-tooling Indicates the PR includes changes for CI or tooling area/cli Indicates the PR includes changes for CLI area/control-plane-operator Indicates the PR includes changes for the control plane operator - in an OCP release area/documentation Indicates the PR includes changes for documentation area/hypershift-operator Indicates the PR includes changes for the hypershift operator and API - outside an OCP release area/platform/aws PR/issue for AWS (AWSPlatform) platform area/platform/azure PR/issue for Azure (AzurePlatform) platform area/platform/gcp PR/issue for GCP (GCPPlatform) platform area/platform/kubevirt PR/issue for KubeVirt (KubevirtPlatform) platform area/platform/openstack PR/issue for OpenStack (OpenStackPlatform) platform area/platform/powervs PR/issue for PowerVS (PowerVSPlatform) platform area/testing Indicates the PR includes changes for e2e testing 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants