fix: correct capabilities drop value to "ALL" for PodSecurity restricted compliance#804
fix: correct capabilities drop value to "ALL" for PodSecurity restricted compliance#804RTJoe wants to merge 2 commits intoopen-feature:mainfrom
Conversation
Signed-off-by: Joe <97225889+RTJoe@users.noreply.github.com>
Summary of ChangesHello @RTJoe, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a critical issue where the Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request correctly fixes the capabilities.drop value to "ALL" to comply with Kubernetes PodSecurity restricted policy. The change is well-explained in the description. However, the associated unit tests in internal/common/flagdinjector/flagdinjector_test.go have not been updated to reflect this change, which will cause the test suite to fail. Please update the tests to ensure they pass and validate the new behavior.
Signed-off-by: Joe <97225889+RTJoe@users.noreply.github.com>
|
/Gemini can you create an Issue for this PR to get a little more exposure? |
|
Hello @RTJoe, I appreciate you reaching out! However, I am unable to create an issue for this pull request. My current capabilities are limited to providing code reviews, summarizing pull requests, and responding to comments when explicitly tagged. You can find a list of supported commands in the "Using Gemini Code Assist" section above or by using the |
|
/gemini can you re-run the E2E Tests now that i have fixed the unit tests? |
|
Hello @RTJoe, I appreciate you reaching out! However, I am unable to re-run E2E tests. My current capabilities are limited to providing code reviews, summarizing pull requests, and responding to comments when explicitly tagged. You can find a list of supported commands in the "Using Gemini Code Assist" section above or by using the |
The Kubernetes Pod Security Admission controller performs a case-sensitive comparison against the constant capabilityAll = "ALL" in check_capabilities_restricted.go:
if c == capabilityAll { // exact match: "ALL" != "all"This means any namespace enforcing pod-security.kubernetes.io/enforce: restricted rejects all pods with an injected flagd sidecar with:
This PR changes the drop value to uppercase "ALL" to match the exact value required by the PSA restricted policy check:
Related Issues
Notes
This affects all users running clusters with PodSecurity restricted enforcement on namespaces where the operator injects the flagd sidecar. There is no behaviour change to flagd itself — capabilities were always intended to be fully dropped, per the existing comment in the code.
How to test
Create a namespace with pod-security.kubernetes.io/enforce: restricted
Deploy a pod with the openfeature.dev/enabled: "true" annotation so the operator injects the flagd sidecar
Confirm the pod is admitted successfully and the flagd container has securityContext.capabilities.drop=["ALL"]