Skip to content

Fix allow privilege escalation#48

Merged
mjiao merged 7 commits into
redhat-sap:masterfrom
mjiao:fix-AllowPrivilegeEscalation
Jan 22, 2026
Merged

Fix allow privilege escalation#48
mjiao merged 7 commits into
redhat-sap:masterfrom
mjiao:fix-AllowPrivilegeEscalation

Conversation

@mjiao
Copy link
Copy Markdown
Collaborator

@mjiao mjiao commented Jan 22, 2026

No description provided.

mjiao added 7 commits January 20, 2026 22:21
Set AllowPrivilegeEscalation to true when enabling Privileged mode,
as required by Kubernetes Pod Security Standards.
- Fix docker-buildx target missing build context in Makefile
- Remove duplicate logger WithValues in controller (controller-runtime
  automatically adds controller, namespace, name, and reconcileID)
- Change reconciliation to aggregate errors instead of fail-fast,
  allowing all adjustments to be attempted even if some components
  are missing
- Standardize log messages to "Component: action" format with
  structured key-value pairs
- Use V(1) debug level for no-op messages (when nothing changes)
  to reduce log noise during normal operation
Previously, ensureRole only checked if the role existed but didn't
verify if the rules matched the desired state. If someone modified
the role's rules, the operator wouldn't detect the drift.

Now ensureRole compares existing rules with desired rules using
reflect.DeepEqual and updates the role if they differ, matching
the behavior of ensureRoleBinding.
The StatefulSet uses RollingUpdate strategy with partition=0, so
Kubernetes handles pod rollouts automatically. Manual pod deletion
to force updates is unnecessary and could interfere with the
StatefulSet controller's rollout mechanism.
…ulSet patch

The StatefulSet controller does not automatically roll out pod template
changes when existing pods are unhealthy. After patching the StatefulSet
with the exports-mask volume, pods running on old revisions continue to
fail because they lack the required /exports mount.

This function detects pods running on outdated revisions and deletes them,
allowing the StatefulSet controller to create new pods with the correct spec.
- Fix pruneStatefulSetOldRevision to compare actual pod revision labels
  against desired UpdateRevision instead of trusting StatefulSet status.
  The status can report matching revisions even when pods run old revisions.

- Add isNotFoundError helper to handle aggregate errors containing
  multiple NotFound errors, treating them as INFO instead of ERROR.

- Fix handleError to return only Result (no error) to use fixed requeue
  interval instead of exponential backoff, ensuring predictable 1-minute
  retry when SDI components become available.
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jan 22, 2026

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 10.41667% with 86 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (master@797dec0). Learn more about missing BASE report.

Files with missing lines Patch % Lines
observer-operator/pkg/adjuster/sdiconfig.go 0.00% 66 Missing ⚠️
observer-operator/pkg/adjuster/adjuster.go 33.33% 8 Missing and 4 partials ⚠️
observer-operator/pkg/sdiobserver/sdiobserver.go 0.00% 6 Missing ⚠️
...ver-operator/controllers/sdiobserver_controller.go 66.66% 2 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff            @@
##             master      #48   +/-   ##
=========================================
  Coverage          ?   14.68%           
=========================================
  Files             ?       10           
  Lines             ?      919           
  Branches          ?        0           
=========================================
  Hits              ?      135           
  Misses            ?      771           
  Partials          ?       13           
Flag Coverage Δ
observer-operator 14.68% <10.41%> (?)

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

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

@mjiao mjiao merged commit 790b8d6 into redhat-sap:master Jan 22, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants