Skip to content

Commit ea8f407

Browse files
Merge pull request #17116 from aveshagarwal/master-pod-toleration-restrictions-issues
Automatic merge from submit-queue. Allow override of cluster level (default, whitelist) tolerations by namespace level empty (default, whitelist) tolerations. Currently In PodTolerationRestriction admission plugin, if namespace level default and whitelist of tolerations are nil or empty, they do not override cluster level default and whitelist tolerations. This PR fixes the plugin to not override cluster level tolerations only when namespace level toleration are nil. IOW, if namespace level toleration are empty, they override cluster level tolerations. To be more clear, if following annotations are set to empty, they override cluster level tolerations. ``` scheduler.alpha.kubernetes.io/defaultTolerations : "" scheduler.alpha.kubernetes.io/tolerationsWhitelist: "" ``` This behavior is inline with PodNodeSelector admission plugin too. @sjenning I think its important to get it fixed for 3.7 so creating this backport PR even though the upstream PR is not merged yet.
2 parents 3ab472b + 83d3756 commit ea8f407

File tree

2 files changed

+49
-13
lines changed

2 files changed

+49
-13
lines changed

vendor/k8s.io/kubernetes/plugin/pkg/admission/podtolerationrestriction/admission.go

+26-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/k8s.io/kubernetes/plugin/pkg/admission/podtolerationrestriction/admission_test.go

+23-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)