From a31c176cc7f3edfc48cd7977f5dc9e6f388483e5 Mon Sep 17 00:00:00 2001 From: Andrew Minkin Date: Thu, 21 Sep 2023 19:37:13 +0600 Subject: [PATCH] EVEREST-434 handle error properly for configs --- pkg/kubernetes/configs.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/kubernetes/configs.go b/pkg/kubernetes/configs.go index 9039b64a..675ab329 100644 --- a/pkg/kubernetes/configs.go +++ b/pkg/kubernetes/configs.go @@ -225,9 +225,9 @@ func (k *Kubernetes) updateConfigWithSecret( if err := k.client.UpdateResource(ctx, obj, &metav1.UpdateOptions{}); err != nil { // rollback the changes - _, err := k.UpdateSecret(ctx, oldSecret) - if err != nil { - k.l.Error(errors.Join(err, fmt.Errorf("could not revert back secret %s", oldSecret.Name))) + _, uErr := k.UpdateSecret(ctx, oldSecret) + if uErr != nil { + k.l.Error(errors.Join(uErr, fmt.Errorf("could not revert back secret %s", oldSecret.Name))) } return errors.Join(err, errors.New("could not update config in Kubernetes"))