-
Notifications
You must be signed in to change notification settings - Fork 121
Fix kubectl debug for JSON Enricher #2896
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix kubectl debug for JSON Enricher #2896
Conversation
Hi @ngopalak-redhat. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2896 +/- ##
===========================================
- Coverage 45.50% 25.07% -20.43%
===========================================
Files 79 120 +41
Lines 7782 20845 +13063
===========================================
+ Hits 3541 5227 +1686
- Misses 4099 15361 +11262
- Partials 142 257 +115 🚀 New features to boost your workflow:
|
/test e2e-apparmor-profile |
@ngopalak-redhat: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
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. |
/ok-to-test |
@saschagrunert / @haircommander Can you please review? |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ngopalak-redhat, saschagrunert The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind bug
What this PR does / why we need it:
This PR fixes an issue where the
kubectl debug
command's audit logs were missing therequestUID
from the JSON Log Enricher.Previously, while
kubectl exec
successfully captured therequestUID
by setting it as an environment variable,kubectl debug
(which creates a new ephemeral container) failed to do so. This fix ensures therequestUID
environment variable is correctly injected into these new containers.Additionally, this PR includes a fix for kubectl exec's handling of the
SPO_EXEC_REQUEST_UID
environment variable. Instead of attempting to remove an existing variable with the same name (a rare occurrence), the code now correctly replaces its value with the appropriaterequestUID
.Finally, the unit tests for the webhook have been enhanced with range-based testing to improve coverage.
Which issue(s) this PR fixes:
Does this PR have test?
Yes, Added e2e and unit test
Special notes for your reviewer:
e2e-apparmor-profile requires a rerun - The failure is not related to the PR
Does this PR introduce a user-facing change?