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
test/e2e/auth: fix audit log test format parsing #51560
test/e2e/auth: fix audit log test format parsing #51560
Conversation
test/e2e/auth/audit.go
Outdated
@@ -138,6 +139,26 @@ func expectAuditLines(f *framework.Framework, expected []auditEvent) { | |||
} | |||
|
|||
func parseAuditLine(line string) (auditEvent, error) { | |||
var e struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this struct not already defined in API types we can reference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to use the audit Event type.
087b3da
to
77de774
Compare
@@ -126,9 +124,6 @@ func expectAuditLines(f *framework.Framework, expected []auditEvent) { | |||
if _, found := expectations[event]; found { | |||
expectations[event] = true | |||
} | |||
|
|||
// /version should not be audited (filtered in the policy). | |||
Expect(event.uri).NotTo(HavePrefix("/version")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed since non-resource URL requests are now tracked.
Managed to run this locally with some local-up modifications and modifying the test to read a file on disk
|
LGTM. @sttts? |
77de774
to
2166668
Compare
If we are in a hurry to fix this we can add |
I think this fix is fine. It supports both formats now, so it'll work regardless of the setup, which seems more ideal. |
Agree! Thanks. |
/test pull-kubernetes-e2e-gce-bazel |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ericchiang, sttts Associated issue: 51556 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
Automatic merge from submit-queue (batch tested with PRs 51632, 51055, 51676, 51560, 50007) |
Fixes #51556
cc @CaoShuFeng
Still need to figure out how to run this test locally.