From d824c98ffc079dc4a9263bf5b32145593e9f07b0 Mon Sep 17 00:00:00 2001 From: Brad Davidson Date: Sun, 14 Jul 2024 00:14:43 +0000 Subject: [PATCH] Don't use server and token values from config file for etcd-snapshot commands Fixes an issue where running etcd-snapshot commands on a node that has a server address set in the config will manage snapshots on that server, instead of on the local node as intended. Signed-off-by: Brad Davidson --- pkg/cli/cmds/etcd_snapshot.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pkg/cli/cmds/etcd_snapshot.go b/pkg/cli/cmds/etcd_snapshot.go index e97228d1e21b..378b394f0a83 100644 --- a/pkg/cli/cmds/etcd_snapshot.go +++ b/pkg/cli/cmds/etcd_snapshot.go @@ -21,11 +21,14 @@ var EtcdSnapshotFlags = []cli.Flag{ Destination: &AgentConfig.NodeName, }, DataDirFlag, - ServerToken, &cli.StringFlag{ - Name: "server, s", - Usage: "(cluster) Server to connect to", - EnvVar: version.ProgramUpper + "_URL", + Name: "etcd-token,t", + Usage: "(cluster) Shared secret used to authenticate to etcd server", + Destination: &ServerConfig.Token, + }, + &cli.StringFlag{ + Name: "etcd-server, s", + Usage: "(cluster) Server with etcd role to connect to for snapshot management operations", Value: "https://127.0.0.1:6443", Destination: &ServerConfig.ServerURL, },