From 918945da45c3690fb6c4f6d5d9fbc3bdad0592f4 Mon Sep 17 00:00:00 2001 From: Derek Nola Date: Fri, 22 Oct 2021 12:03:32 -0700 Subject: [PATCH] Added configuration input to etcd-snapshot (#4280) Signed-off-by: dereknola --- pkg/cli/cmds/etcd_snapshot.go | 3 ++- pkg/configfilearg/defaultparser.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/cli/cmds/etcd_snapshot.go b/pkg/cli/cmds/etcd_snapshot.go index 1b5a777172..59585a515f 100644 --- a/pkg/cli/cmds/etcd_snapshot.go +++ b/pkg/cli/cmds/etcd_snapshot.go @@ -11,6 +11,7 @@ const EtcdSnapshotCommand = "etcd-snapshot" var EtcdSnapshotFlags = []cli.Flag{ DebugFlag, + ConfigFlag, LogFile, AlsoLogToStderr, cli.StringFlag{ @@ -25,7 +26,7 @@ var EtcdSnapshotFlags = []cli.Flag{ Destination: &ServerConfig.DataDir, }, &cli.StringFlag{ - Name: "name,etcd-snapshot-name", + Name: "name", Usage: "(db) Set the base name of the etcd on-demand snapshot (appended with UNIX timestamp).", Destination: &ServerConfig.EtcdSnapshotName, Value: "on-demand", diff --git a/pkg/configfilearg/defaultparser.go b/pkg/configfilearg/defaultparser.go index 2eb1bf536c..3b17b95115 100644 --- a/pkg/configfilearg/defaultparser.go +++ b/pkg/configfilearg/defaultparser.go @@ -7,7 +7,7 @@ import ( func MustParse(args []string) []string { parser := &Parser{ - After: []string{"server", "agent"}, + After: []string{"server", "agent", "etcd-snapshot"}, FlagNames: []string{"--config", "-c"}, EnvName: version.ProgramUpper + "_CONFIG_FILE", DefaultConfig: "/etc/rancher/" + version.Program + "/config.yaml",