From 5fad0b48e757869aae645fbd6487dd59c1c18bdd Mon Sep 17 00:00:00 2001 From: Ishan Tyagi Date: Tue, 13 Aug 2024 10:06:53 +0530 Subject: [PATCH] Fix a detection for a single member restoration when snapstore is not configured for zeroth pod. --- pkg/initializer/initializer.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pkg/initializer/initializer.go b/pkg/initializer/initializer.go index 1247a4501..48aa994b0 100644 --- a/pkg/initializer/initializer.go +++ b/pkg/initializer/initializer.go @@ -9,7 +9,6 @@ import ( "fmt" "os" "path/filepath" - "strings" "time" "github.com/gardener/etcd-backup-restore/pkg/errors" @@ -48,15 +47,12 @@ func (e *EtcdInitializer) Initialize(mode validator.Mode, failBelowRevision int6 ctx := context.Background() var err error - podName, err := miscellaneous.GetEnvVarOrError("POD_NAME") if err != nil { logger.Fatalf("Error reading POD_NAME env var : %v", err) } // Etcd cluster scale-up case - // Note: first member of etcd cluster can never be part of scale-up case. - // TODO: consider removing this special check for first cluster member when backup-restore can check presence of any member in cluster. - if miscellaneous.IsMultiNode(logger) && !strings.HasSuffix(podName, "0") { + if miscellaneous.IsMultiNode(logger) { clientSet, err := miscellaneous.GetKubernetesClientSetOrError() if err != nil { logger.Fatalf("failed to create clientset, %v", err)