-
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
check job ActiveDeadlineSeconds #48454
check job ActiveDeadlineSeconds #48454
Conversation
Hi @weiwei04. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with 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/test-infra repository. I understand the commands that are listed here. |
8ebd760
to
0432a5f
Compare
/assign @janetkuo |
@weiwei04: GitHub didn't allow me to assign the following users: PTAL. Note that only kubernetes members can be assigned. 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/test-infra repository. |
@janetkuo please take a look, thanks. |
0432a5f
to
5a888ac
Compare
5a888ac
to
0218c72
Compare
@weiwei04 sorry, was out for quite a long, will look into it today or tomorrow. |
@soltysh thanks:) |
/assign |
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.
Mostly nits, overall looks good.
pkg/controller/job/jobcontroller.go
Outdated
curJob := cur.(*batch.Job) | ||
|
||
// never return error | ||
key, _ := controller.KeyFunc(curJob) |
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.
There's no point in re-trying if there was an error. Check error and just return if that happens.
pkg/controller/job/jobcontroller.go
Outdated
jm.queue.Add(key) | ||
// check if need to add a new rsync for ActiveDeadlineSeconds | ||
if curJob.Status.StartTime != nil { | ||
curSeconds := curJob.Spec.ActiveDeadlineSeconds |
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.
Can you please use currentADS
and oldADS
it's less confusing name :)
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.
yes ADS would be a more meaningful name:)
@@ -150,6 +150,10 @@ const ( | |||
JobFailed JobConditionType = "Failed" | |||
) | |||
|
|||
const ( |
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.
Not needed, drop it. It'll cause only confusion wrt to our API.
test/e2e/apps/job.go
Outdated
@@ -28,6 +28,8 @@ import ( | |||
"k8s.io/kubernetes/pkg/kubectl" | |||
"k8s.io/kubernetes/test/e2e/framework" | |||
|
|||
batch "k8s.io/api/batch/v1" |
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.
Use batchv1
as the name alias, to make it clear it's that version.
test/e2e/apps/job.go
Outdated
@@ -86,9 +88,20 @@ var _ = SIGDescribe("Job", func() { | |||
Expect(err).NotTo(HaveOccurred()) | |||
}) | |||
|
|||
It("should exceed active deadline", func() { | |||
By("Creating a job") | |||
var activeDeadlineSeconds int64 = 10 |
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.
Make it shorter, this will cause the entire test suite longer by 10 seconds. I'd propose 1-2 seconds max.
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.
changed to 2 seconds.
36896d9
to
1662f30
Compare
@soltysh modified code according to your comments, please take a look, thanks:) |
/ok-to-test |
/test pull-kubernetes-e2e-gce-etcd3 |
/test pull-kubernetes-e2e-gce-etcd3 |
@soltysh modified code according to your comments, and all the test are passed, please take a look, thanks:) |
ping @soltysh :) |
1 similar comment
ping @soltysh :) |
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://github.com/kubernetes/kubernetes/wiki/CLA-FAQ to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
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/test-infra repository. I understand the commands that are listed here. |
ping @soltysh :) |
@weiwei04 sorry for the long silence, looking at it right now... |
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.
LGTM
@weiwei04 mind squashing these changes into a single commit and I'll apply all the necessary labels for merge |
92e91cc
to
46239ea
Compare
/test pull-kubernetes-node-e2e |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: soltysh, weiwei04 Associated issue: 32149 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 |
Thanks:) |
Automatic merge from submit-queue (batch tested with PRs 44719, 48454) |
What this PR does / why we need it:
enqueue a sync task after ActiveDeadlineSeconds
Which issue this PR fixes *:
fixes #32149
Special notes for your reviewer:
Release note: