-
Notifications
You must be signed in to change notification settings - Fork 40k
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 audit_test regex for iso8601 timestamps #32593
Conversation
Signed-off-by: Johnny Bieren <jbieren@redhat.com>
Can a kubernetes member verify that this patch is reasonable to test? If so, please reply with "ok to test" on its own line. Regular contributors should join the org to skip this step. While we transition away from the Jenkins GitHub PR Builder plugin, "ok to test" commenters will need to be on the admin list defined in this file. |
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
I signed it! |
CLAs look good, thanks! |
@@ -95,14 +95,14 @@ func TestAudit(t *testing.T) { | |||
if len(line) != 2 { | |||
t.Fatalf("Unexpected amount of lines in audit log: %d", len(line)) | |||
} | |||
match, err := regexp.MatchString(`[\d\:\-\.\+]+ AUDIT: id="[\w-]+" ip="127.0.0.1" method="GET" user="admin" as="<self>" namespace="default" uri="/api/v1/namespaces/default/pods"`, line[0]) | |||
match, err := regexp.MatchString(`[\d\:\-\.\+,T,Z]+ AUDIT: id="[\w-]+" ip="127.0.0.1" method="GET" user="admin" as="<self>" namespace="default" uri="/api/v1/namespaces/default/pods"`, line[0]) |
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.
I think it should be just [\d\:\-\.\+TZ]
, otherwise it also matches ,
symbol.
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.
Nice catch, fixed it
Signed-off-by: Johnny Bieren <jbieren@redhat.com>
@k8s-bot ok to test Is there an issue filed for failing test? |
GCE e2e build/test passed for commit df6299d. |
Automatic merge from submit-queue |
@nikhiljindal No, I did not open an issue for the failing test, just this PR |
Can we have this cherry-picked into release-1.4 branch? We're having some problems with our CI due to the bug this PR fixes |
@ivan4th it's not only about CI, 1.4 release is affected with this bug :) |
Pinging again, can we cherry-pick it for 1.4? |
This bug affects almost anyone running custom CI for k8s, it would be very good to have it merged to 1.4. I'd like to understand what needs to happen to have it picked for the release. |
@pwittrock this issue looks critical for some instances, while it hasn't been added to 1.4 branch yet (while it is important). |
Sorry for not replying earlier.
The process is: add the PR to be cherrypicked to the relevant milestone and add the "cherrypick-candidate" label. |
Sounds like the ball got dropped here. I have repeatedly communicated both at the community meeting and to kubernetes-dev@googlegroups.com that:
Why can't this wait for 1.4.1 and we add an item to known issues? |
Looking at the code, this only updates a test file. How does the impact CI? |
@nikhiljindal We are past the point of doing batch cherrypicks. You will need to do this one yourself. |
Need more context on this if it is going to go in. Seems like the regex adds a piece that isn't optional. How do we know this won't break anything else? |
Sorry I dont want this to be blocked on me. I have some other 1.4 work am involved in. Anyone else willing to step up? You will have to convince pwittrock and then send a PR cherrypicking this to release-1.4 branch. |
@pwittrock I'm not pushing this item to be cherrypicked urgently, I'm notifying about this issue that is critical for some users and we have to solve it in the best possible way. |
Alright sounds good. |
@nikhiljindal @idvoretskyi can one of you please open the PR to cherry-pick this into release-1.4, thanks! |
Commit found in the "release-1.4" branch appears to be this PR. Removing the "cherrypick-candidate" label. If this is an error find help to get your PR picked. |
Automatic merge from submit-queue hack: update cherry-pick script to show subject when patch is split <!-- Thanks for sending a pull request! Here are some tips for you: 1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md 2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md 3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes --> **What this PR does / why we need it**: This is a continuation of #34049, which worked, but then I realized some patch files have more than one subject, see example: #34228 This cleans the output so it looks like this: ``` Automated cherry pick of #32593 Cherry pick of #32593 on release-1.4. #32593: Fix audit_test regex for iso8601 timestamps ``` pretty!!! **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes # **Special notes for your reviewer**: **Release note**: <!-- Steps to write your release note: 1. Use the release-note-* labels to set the release note state (if you have access) 2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. --> Signed-off-by: Jess Frazelle <acidburn@google.com>
…-of-#32593-upstream-release-1.4 Automatic merge from submit-queue Automated cherry pick of kubernetes#32593 Cherry pick of kubernetes#32593 on release-1.4. kubernetes#32593: Subject: [PATCH 1/2] Fix audit_test regex for iso8601 timestamps Subject: [PATCH 2/2] Fixed edited regex in audit_test unit test
What this PR does / why we need it: The audit_test unit test fails as some iso8601 timestamps are of the form 2016-09-13T10:32:50.823081217Z and the current regex doesn't allow T's or Z's.
Which issue this PR fixes (optional, in
fixes #<issue number>(, #<issue_number>, ...)
format, will close that issue when PR gets merged): fixes #Special notes for your reviewer:
Release note:NONE
Signed-off-by: Johnny Bieren jbieren@redhat.com
This change is