mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-12-15 20:37:39 +00:00
Removed err from return value of AddOrUpdateTolerationInPod.
This commit is contained in:
@@ -97,29 +97,21 @@ func (p *plugin) Admit(attributes admission.Attributes) (err error) {
|
||||
}
|
||||
|
||||
if !toleratesNodeNotReady {
|
||||
_, err := api.AddOrUpdateTolerationInPod(pod, &api.Toleration{
|
||||
api.AddOrUpdateTolerationInPod(pod, &api.Toleration{
|
||||
Key: metav1.TaintNodeNotReady,
|
||||
Operator: api.TolerationOpExists,
|
||||
Effect: api.TaintEffectNoExecute,
|
||||
TolerationSeconds: defaultNotReadyTolerationSeconds,
|
||||
})
|
||||
if err != nil {
|
||||
return admission.NewForbidden(attributes,
|
||||
fmt.Errorf("failed to add default tolerations for taints `notReady:NoExecute` and `unreachable:NoExecute`, err: %v", err))
|
||||
}
|
||||
}
|
||||
|
||||
if !toleratesNodeUnreachable {
|
||||
_, err := api.AddOrUpdateTolerationInPod(pod, &api.Toleration{
|
||||
api.AddOrUpdateTolerationInPod(pod, &api.Toleration{
|
||||
Key: metav1.TaintNodeUnreachable,
|
||||
Operator: api.TolerationOpExists,
|
||||
Effect: api.TaintEffectNoExecute,
|
||||
TolerationSeconds: defaultUnreachableTolerationSeconds,
|
||||
})
|
||||
if err != nil {
|
||||
return admission.NewForbidden(attributes,
|
||||
fmt.Errorf("failed to add default tolerations for taints `notReady:NoExecute` and `unreachable:NoExecute`, err: %v", err))
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user