Skip to content

Commit

Permalink
Fix a detection for a single member restoration when snapstore is not…
Browse files Browse the repository at this point in the history
… configured for zeroth pod. (#761) (#766)
  • Loading branch information
ishan16696 authored Aug 30, 2024
1 parent f69d584 commit ea9a6be
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions pkg/initializer/initializer.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"fmt"
"os"
"path/filepath"
"strings"
"time"

"github.com/gardener/etcd-backup-restore/pkg/errors"
Expand Down Expand Up @@ -58,15 +57,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)
Expand Down

0 comments on commit ea9a6be

Please sign in to comment.