Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a detection for a single member restoration when snapstore is not configured for zeroth pod. #761

Merged
merged 1 commit into from
Aug 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions pkg/initializer/initializer.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"fmt"
"os"
"path/filepath"
"strings"
"time"

"github.com/gardener/etcd-backup-restore/pkg/errors"
Expand Down Expand Up @@ -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) {
ishan16696 marked this conversation as resolved.
Show resolved Hide resolved
clientSet, err := miscellaneous.GetKubernetesClientSetOrError()
if err != nil {
logger.Fatalf("failed to create clientset, %v", err)
Expand Down