Skip to content

PROJQUAY-10873: fix(mirror): prevent pod loss during securityContext override#1220

Open
Marcusk19 wants to merge 1 commit into
quay:masterfrom
Marcusk19:PROJQUAY-10873/mirror-maxunavailable
Open

PROJQUAY-10873: fix(mirror): prevent pod loss during securityContext override#1220
Marcusk19 wants to merge 1 commit into
quay:masterfrom
Marcusk19:PROJQUAY-10873/mirror-maxunavailable

Conversation

@Marcusk19
Copy link
Copy Markdown
Contributor

Summary

  • Root cause fix: GetReplicasOverrideForComponent returned nil when a component had overrides (e.g. securityContext) but no explicit replicas setting. This caused the middleware to omit the replicas field from server-side apply, releasing operator ownership and letting Kubernetes revert desired replicas from 2→1.
  • Fix: Return the default of 2 replicas consistently, regardless of whether other overrides are present, matching the behavior when Overrides == nil.
  • Defense-in-depth: Keeps the existing maxUnavailable=0 strategy from the previous commit to prevent pod loss during any rollout where new pods fail admission.

Test plan

  • Added TestGetReplicasOverrideForComponent covering: no overrides (default 2), overrides with securityContext but no replicas (default 2), explicit replicas override, and component not found
  • All existing tests pass
  • QE verification: apply securityContext override on mirror component without replicas → mirror pods should remain at 2

…lica count (PROJQUAY-10873)

GetReplicasOverrideForComponent returned nil when a component had
overrides (e.g. securityContext) but no explicit replicas setting.
This caused the middleware to omit the replicas field from SSA,
releasing operator ownership and letting Kubernetes revert to 1.

Return the default of 2 consistently, matching the behavior when
no overrides are set at all.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Marcusk19 Marcusk19 force-pushed the PROJQUAY-10873/mirror-maxunavailable branch from e1f893f to 09a5237 Compare March 23, 2026 13:45
@Marcusk19 Marcusk19 changed the title fix(mirror): prevent pod loss during securityContext override (PROJQUAY-10873) PROJQUAY-10873: fix(mirror): prevent pod loss during securityContext override Mar 23, 2026
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Mar 23, 2026

@Marcusk19: 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/ocp-latest-e2e 09a5237 link true /test ocp-latest-e2e

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-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 17, 2026

PR needs rebase.

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.

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

Development

Successfully merging this pull request may close these issues.

1 participant