Fix path handling

This commit is contained in:
Simon Beck 2022-04-07 18:32:28 +02:00
parent 79d54b65fb
commit 9b7b73f4b8
2 changed files with 22 additions and 23 deletions

View File

@ -16,31 +16,11 @@ func newKopiaCommand() *cli.Command {
newKopiaBackupCommand(),
newKopiaMaintenanceCommand(),
},
Flags: append([]cli.Flag{
&cli.PathFlag{
Name: "config",
Aliases: []string{"c"},
Usage: "Path to the folder where the config should be written",
EnvVars: envVars("CONFIG_PATH"),
Value: "/tmp",
},
&cli.PathFlag{
Name: "kopia-bin-path",
Usage: "Kopia binary path",
EnvVars: envVars("KOPIA_PATH"),
Value: "/usr/local/bin/kopia",
},
&cli.PathFlag{
Name: "cache-path",
Usage: "Path where the cache is stored",
EnvVars: envVars("KOPIA_CACHE_PATH"),
Value: "/cache",
},
}, getRepositoryParams()...),
Flags: getKopiaParams(),
}
}
func getRepositoryParams() []cli.Flag {
func getKopiaParams() []cli.Flag {
return []cli.Flag{
&cli.StringFlag{
Name: "access-key-id",
@ -67,6 +47,25 @@ func getRepositoryParams() []cli.Flag {
Usage: "Kopia S3 endpoint",
EnvVars: envVars("ENDPOINT"),
},
&cli.PathFlag{
Name: "config",
Aliases: []string{"c"},
Usage: "Path to the folder where the config should be written",
EnvVars: envVars("CONFIG_PATH"),
Value: "/tmp",
},
&cli.PathFlag{
Name: "kopia-bin-path",
Usage: "Kopia binary path",
EnvVars: envVars("KOPIA_PATH"),
Value: "/usr/local/bin/kopia",
},
&cli.PathFlag{
Name: "cache-path",
Usage: "Path where the cache is stored",
EnvVars: envVars("KOPIA_CACHE_PATH"),
Value: "/cache",
},
}
}

View File

@ -32,7 +32,7 @@ func newOperatorBackupCommand() *cli.Command {
Usage: "Random ID for jobs, so that each kopia-k8s instance can operate on their own jobs",
EnvVars: envVars("UUID"),
},
}, getRepositoryParams()...),
}, getKopiaParams()...),
}
}