Skip to content

fix: reconcile explicit and admitted privilege escalation settings - #593

Merged
haorenfsa merged 2 commits into
mainfrom
fix-admitted-container-security
Dec 4, 2026
Merged

haorenfsa merged 2 commits into
mainfrom
fix-admitted-container-security

Conversation

@haorenfsa

@haorenfsa haorenfsa commented Dec 4, 2026 •

Copy link
Copy Markdown
Collaborator

Follow-up to #591.

Removing an explicit allowPrivilegeEscalation: false from the Milvus CR can leave it on the running workload indefinitely. Rebuilding a CR-defined sidecar or init container can also discard a value supplied by admission and trigger another rollout.

This change records the names of containers whose false value the CR explicitly requests in a Deployment or StatefulSet annotation. Each blue/green Deployment records that information with its own template. On a healthy workload, recording an existing setting updates only workload metadata. For a pre-upgrade false of unknown origin, the operator preserves it until it observes an explicit setting in the CR.

When the CR removes the field from a container it still declares, the operator releases the previous value. If admission supplies false again, subsequent reconciles preserve it. If the CR removes an entire custom container and the renderer retains it in the workload, the container keeps its restriction. Releasing a setting still respects Milvus image upgrade dependencies. A named config init container can override escalation and its related privilege settings during a full render.

Regression tests cover removal with and without simulated admission, retained sidecars, named config overrides, blue/green rollout selection and metadata-only adoption in automatic and manual modes. Three new regression cases fail on the previous PR commit and pass with the fix.

Validated in AWS UAT with the full controller test package and an operator build. The focused escalation, StatefulSet and config-container tests also passed three times with shuffled order.

Signed-off-by: haorenfsa <shaoyue.chen@zilliz.com>
@codecov

codecov Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.16514% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.26%. Comparing base (f3fcc66) to head (ff7e6e5).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
pkg/controllers/deployment_updater.go 91.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #593      +/-   ##
==========================================
+ Coverage   86.06%   86.26%   +0.20%     
==========================================
  Files          76       77       +1     
  Lines        7663     7754      +91     
==========================================
+ Hits         6595     6689      +94     
+ Misses       1066     1063       -3     
  Partials        2        2              

☔ View full report in Codecov by Harness.
📢 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.

… changes

Signed-off-by: haorenfsa <shaoyue.chen@zilliz.com>
@haorenfsa
haorenfsa marked this pull request as ready for review December 4, 2026 09:09
@mergify

mergify Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

This pull request is merged.

@haorenfsa haorenfsa added the lgtm looks good to merge label Dec 4, 2026
@huanghaoyuanhhy

Copy link
Copy Markdown

/lgtm

@sre-ci-robot

Copy link
Copy Markdown
Collaborator

@huanghaoyuanhhy: changing LGTM is restricted to collaborators

Details

In response to this:

/lgtm

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/test-infra repository.

@sre-ci-robot

Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: haorenfsa, huanghaoyuanhhy

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

@haorenfsa
haorenfsa merged commit 09ffe3f into main Dec 4, 2026
25 checks passed
@haorenfsa
haorenfsa deleted the fix-admitted-container-security branch December 4, 2026 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants