Skip to content
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

Merged
merged 2 commits into from
Sep 15, 2016

Conversation

johnbieren
Copy link
Contributor

@johnbieren johnbieren commented Sep 13, 2016

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

Fix audit_test regex for iso8601 timestamps

Signed-off-by: Johnny Bieren jbieren@redhat.com


This change is Reviewable

Signed-off-by: Johnny Bieren <jbieren@redhat.com>
@k8s-ci-robot
Copy link
Contributor

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.

@googlebot
Copy link

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!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

@k8s-github-robot k8s-github-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. release-note-label-needed labels Sep 13, 2016
@johnbieren
Copy link
Contributor Author

johnbieren commented Sep 13, 2016

I signed it!

@ncdc ncdc added the release-note-none Denotes a PR that doesn't merit a release note. label Sep 13, 2016
@googlebot
Copy link

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])
Copy link

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.

Copy link
Contributor Author

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>
@nikhiljindal
Copy link
Contributor

@k8s-bot ok to test

Is there an issue filed for failing test?

@nikhiljindal nikhiljindal added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 14, 2016
@k8s-bot
Copy link

k8s-bot commented Sep 14, 2016

GCE e2e build/test passed for commit df6299d.

@k8s-github-robot
Copy link

Automatic merge from submit-queue

@k8s-github-robot k8s-github-robot merged commit 1ad5c5e into kubernetes:master Sep 15, 2016
@johnbieren
Copy link
Contributor Author

@nikhiljindal No, I did not open an issue for the failing test, just this PR

@ivan4th
Copy link
Contributor

ivan4th commented Sep 15, 2016

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

@pigmej
Copy link
Contributor

pigmej commented Sep 15, 2016

@ivan4th it's not only about CI, 1.4 release is affected with this bug :)

cc @nikhiljindal @johnbieren

@pigmej
Copy link
Contributor

pigmej commented Sep 21, 2016

Pinging again, can we cherry-pick it for 1.4?

@nikhiljindal @johnbieren

@zen
Copy link

zen commented Sep 22, 2016

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.

@idvoretskyi
Copy link
Member

@pwittrock this issue looks critical for some instances, while it hasn't been added to 1.4 branch yet (while it is important).

@nikhiljindal
Copy link
Contributor

Sorry for not replying earlier.
Yes @pwittrock is the right person to make that call.

I'd like to understand what needs to happen to have it picked for the release.

The process is: add the PR to be cherrypicked to the relevant milestone and add the "cherrypick-candidate" label.
Release czar will then either remove the "cherrypick-candidate" label or add a "cherrypick-approved" label.
Adding the milestone and label for you guys.

@pwittrock
Copy link
Member

Sounds like the ball got dropped here. I have repeatedly communicated both at the community meeting and to kubernetes-dev@googlegroups.com that:

  1. Last call for cherrypick changes to be merged was on Wednesday
  2. If this is a surprise or issue for anyone to reach out to me immediately on slack

Why can't this wait for 1.4.1 and we add an item to known issues?

@pwittrock
Copy link
Member

Looking at the code, this only updates a test file. How does the impact CI?

@pwittrock pwittrock added the cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. label Sep 23, 2016
@pwittrock
Copy link
Member

@nikhiljindal We are past the point of doing batch cherrypicks. You will need to do this one yourself.

@pwittrock pwittrock removed the cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. label Sep 23, 2016
@pwittrock
Copy link
Member

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?

@nikhiljindal
Copy link
Contributor

@nikhiljindal We are past the point of doing batch cherrypicks. You will need to do this one yourself.

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.

@idvoretskyi
Copy link
Member

@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.
1.4.1 branch cherrypicking SGTM.

@pwittrock
Copy link
Member

Alright sounds good.

@jessfraz jessfraz added the cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. label Oct 6, 2016
@jessfraz
Copy link
Contributor

jessfraz commented Oct 6, 2016

@nikhiljindal @idvoretskyi can one of you please open the PR to cherry-pick this into release-1.4, thanks!

@pigmej
Copy link
Contributor

pigmej commented Oct 6, 2016

@jessfraz I submitted cherry pick #34228

@jessfraz jessfraz added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Oct 6, 2016
k8s-github-robot pushed a commit that referenced this pull request Oct 7, 2016
…-upstream-release-1.4

Automatic merge from submit-queue

Automated cherry pick of #32593

Cherry pick of #32593 on release-1.4.

#32593: Subject: [PATCH 1/2] Fix audit_test regex for iso8601 timestamps
Subject: [PATCH 2/2] Fixed edited regex in audit_test unit test
@k8s-cherrypick-bot
Copy link

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.

k8s-github-robot pushed a commit that referenced this pull request Oct 10, 2016
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>
shyamjvs pushed a commit to shyamjvs/kubernetes that referenced this pull request Dec 1, 2016
…-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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.