Skip to content

Commit

Permalink
Don't use server and token values from config file for etcd-snapshot …
Browse files Browse the repository at this point in the history
…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 <brad.davidson@rancher.com>
  • Loading branch information
brandond committed Jul 14, 2024
1 parent 864d74b commit 01d516d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions pkg/cli/cmds/etcd_snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down

0 comments on commit 01d516d

Please sign in to comment.