-
Notifications
You must be signed in to change notification settings - Fork 771
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
Make OnFailure as default restartPolicy for BroadcastJob #1149
Make OnFailure as default restartPolicy for BroadcastJob #1149
Conversation
Welcome @Shubhamurkade! It looks like this is your first PR to openkruise/kruise 🎉 |
@Shubhamurkade Maybe, you should modify this function instead of event handler :) kruise/apis/apps/defaults/v1alpha1.go Line 178 in 1ece7fe
|
@veophi Thanks for the suggestion. Will do! |
@veophi Please let me know if the latest changes look fine. |
@Shubhamurkade It's good, and you should git commit -s and push again. |
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## master #1149 +/- ##
==========================================
+ Coverage 49.73% 50.04% +0.31%
==========================================
Files 137 143 +6
Lines 19331 19843 +512
==========================================
+ Hits 9614 9931 +317
- Misses 8667 8826 +159
- Partials 1050 1086 +36
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
83049b8
to
1706262
Compare
@Shubhamurkade You need git commit -s and squash the commits to one. |
1706262
to
9836a38
Compare
@Shubhamurkade tks, and you must resolve the checks. https://github.com/openkruise/kruise/pull/1149/checks?check_run_id=11663449687 |
Signed-off-by: Shubham Urkade <shubhamurkade1@gmail.com>
9836a38
to
01cebb4
Compare
Please check now. |
/lgtm |
/approve |
1 similar comment
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: veophi, zmberg 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 |
…1149) Signed-off-by: Shubham Urkade <shubhamurkade1@gmail.com> Co-authored-by: Shubham Urkade <surkade@surkade3MD6M.vmware.com>
…1149) Signed-off-by: Shubham Urkade <shubhamurkade1@gmail.com> Co-authored-by: Shubham Urkade <surkade@surkade3MD6M.vmware.com>
…1149) Signed-off-by: Shubham Urkade <shubhamurkade1@gmail.com> Co-authored-by: Shubham Urkade <surkade@surkade3MD6M.vmware.com>
…1149) Co-authored-by: Shubham Urkade <surkade@surkade3MD6M.vmware.com>
Ⅰ. Describe what this PR does
Creation of a BroadcastJob without specifying restartPolicy fails with the following error:
Error from server: error when creating "broadcastjob_kruise.yaml": admission webhook "vbroadcastjob.kb.io" denied the request: spec.template.spec.restartPolicy: Invalid value: "Always": pod restartPolicy can only be Never or OnFailure
Root Cause:
restartPolicy is present under spec.template.spec block. This block is defined with PodSpec structure and the restartPolicy element in it has a default value of Always.
Solution:
For BroadcastJob changed the default value to OnFailure in
/Users/surkade/Documents/dev/kruise/pkg/webhook/broadcastjob/validating/broadcastjob_create_update_handler.go
fileⅡ. Does this pull request fix one issue?
No
Ⅲ. Describe how to verify it
Create a sample BroadcastJob with the following template (Do not specify restartPolicy under spec.template.spec:
The previously mentioned error can be seen
Ⅳ. Special notes for reviews
I have kept the new default for restartPolicy as OnFailure. Please let me know if Never would make more sense as a default.