From eb310ac9985ef9716d33e2e7259dc83b82fceb39 Mon Sep 17 00:00:00 2001 From: Chin-Ya Huang Date: Wed, 22 Mar 2023 12:05:04 +0800 Subject: [PATCH] fix(agent): remove "toleration for all taints" Ref: Longhorn-5614 Signed-off-by: Chin-Ya Huang --- pkg/manager/manager.go | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/pkg/manager/manager.go b/pkg/manager/manager.go index 28ac8a7d..30592cd1 100644 --- a/pkg/manager/manager.go +++ b/pkg/manager/manager.go @@ -397,30 +397,25 @@ func (m *SupportBundleManager) getTaintToleration() []v1.Toleration { } taintToleration = append(taintToleration, *toleration) } - - if len(taintToleration) == 0 { - return []v1.Toleration{{Operator: v1.TolerationOpExists}} - } return taintToleration } func parseToleration(taintToleration string) (*v1.Toleration, error) { - toleration := &v1.Toleration{} - // The schema should be `key=value:effect` or `key:effect` parts := strings.Split(taintToleration, ":") if len(parts) != 2 { return nil, fmt.Errorf("missing key/value and effect pair") } - keyValue := parts[0] - key, value, operator, err := parseTolerationKeyAndValue(keyValue) + key, value, operator, err := parseTolerationKeyAndValue(parts[0]) if err != nil { return nil, err } - toleration.Key = key - toleration.Value = value - toleration.Operator = operator + toleration := &v1.Toleration{ + Key: key, + Value: value, + Operator: operator, + } toleration.Effect, err = parseTaintEffect(parts[1]) if err != nil { return nil, err