From 1f9cd88972c3e9d8119feff06c8a39b8b720ab57 Mon Sep 17 00:00:00 2001 From: Klaus Ma Date: Mon, 13 Mar 2017 22:40:56 +0800 Subject: [PATCH] generated client-go. Kubernetes-commit: 98a52fd6b5fd50f45554c4c8f86350d62826fc26 --- pkg/api/helpers.go | 6 +++--- pkg/api/v1/helpers.go | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/api/helpers.go b/pkg/api/helpers.go index faa7df7c..f3ff8321 100644 --- a/pkg/api/helpers.go +++ b/pkg/api/helpers.go @@ -494,7 +494,7 @@ func GetTolerationsFromPodAnnotations(annotations map[string]string) ([]Tolerati // AddOrUpdateTolerationInPod tries to add a toleration to the pod's toleration list. // Returns true if something was updated, false otherwise. -func AddOrUpdateTolerationInPod(pod *Pod, toleration *Toleration) (bool, error) { +func AddOrUpdateTolerationInPod(pod *Pod, toleration *Toleration) bool { podTolerations := pod.Spec.Tolerations var newTolerations []Toleration @@ -502,7 +502,7 @@ func AddOrUpdateTolerationInPod(pod *Pod, toleration *Toleration) (bool, error) for i := range podTolerations { if toleration.MatchToleration(&podTolerations[i]) { if Semantic.DeepEqual(toleration, podTolerations[i]) { - return false, nil + return false } newTolerations = append(newTolerations, *toleration) updated = true @@ -517,7 +517,7 @@ func AddOrUpdateTolerationInPod(pod *Pod, toleration *Toleration) (bool, error) } pod.Spec.Tolerations = newTolerations - return true, nil + return true } // MatchToleration checks if the toleration matches tolerationToMatch. Tolerations are unique by , diff --git a/pkg/api/v1/helpers.go b/pkg/api/v1/helpers.go index 01f4ef47..340ba63a 100644 --- a/pkg/api/v1/helpers.go +++ b/pkg/api/v1/helpers.go @@ -276,9 +276,9 @@ const ( AffinityAnnotationKey string = "scheduler.alpha.kubernetes.io/affinity" ) -// Tries to add a toleration to annotations list. Returns true if something was updated -// false otherwise. -func AddOrUpdateTolerationInPod(pod *Pod, toleration *Toleration) (bool, error) { +// AddOrUpdateTolerationInPod tries to add a toleration to the pod's toleration list. +// Returns true if something was updated, false otherwise. +func AddOrUpdateTolerationInPod(pod *Pod, toleration *Toleration) bool { podTolerations := pod.Spec.Tolerations var newTolerations []Toleration @@ -286,7 +286,7 @@ func AddOrUpdateTolerationInPod(pod *Pod, toleration *Toleration) (bool, error) for i := range podTolerations { if toleration.MatchToleration(&podTolerations[i]) { if api.Semantic.DeepEqual(toleration, podTolerations[i]) { - return false, nil + return false } newTolerations = append(newTolerations, *toleration) updated = true @@ -301,7 +301,7 @@ func AddOrUpdateTolerationInPod(pod *Pod, toleration *Toleration) (bool, error) } pod.Spec.Tolerations = newTolerations - return true, nil + return true } // MatchToleration checks if the toleration matches tolerationToMatch. Tolerations are unique by ,