From f6a2ccf88e9238e3ddea8b1c787430bc5e482626 Mon Sep 17 00:00:00 2001 From: roehlerw Date: Wed, 5 Apr 2023 16:40:46 -0400 Subject: [PATCH] fix(vault): fix vault init command resolves DATAINT-1504 --- .goreleaser.yml | 21 +++++++++++---------- cmd/vault.go | 8 +++----- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index e58a7ba..b25bb18 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -17,16 +17,17 @@ builds: - darwin goarch: - amd64 -archive: - name_template: '{{ .ProjectName }}_{{ .Tag }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}' - replacements: - darwin: darwin - linux: linux - windows: windows - amd64: amd64 - format_overrides: - - goos: windows - format: zip +archives: + - id: output + name_template: '{{ .ProjectName }}_{{ .Tag }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}' + replacements: + darwin: darwin + linux: linux + windows: windows + amd64: amd64 + format_overrides: + - goos: windows + format: zip checksum: name_template: 'checksums.txt' snapshot: diff --git a/cmd/vault.go b/cmd/vault.go index 81c8ad0..00a6338 100644 --- a/cmd/vault.go +++ b/cmd/vault.go @@ -143,11 +143,8 @@ Any values provided using --values will be in {{ .Values.xxx }} }) const argVaultApplyDumpValues = "dump-values" -const argVaultForceGenerateRootToken = "generate-root" -func vaultInitFlags(cmd *cobra.Command) { - cmd.Flags().Bool(argVaultForceGenerateRootToken, false, "Generate a root token named 'root'.") -} +const argVaultForceGenerateRootToken = "generate-token-root" var vaultInitCmd = &cobra.Command{ Use: "init [namespace]", @@ -494,7 +491,8 @@ func init() { vaultCmd.AddCommand(vaultJWTCmd) addVaultFlags(vaultInitCmd) - vaultCmd.AddCommand(vaultInitCmd, initFlags) + vaultCmd.AddCommand(vaultInitCmd) + vaultInitCmd.Flags().Bool(argVaultForceGenerateRootToken, false, "Generate a root token with id 'root'") addVaultFlags(vaultUnsealCmd) vaultCmd.AddCommand(vaultUnsealCmd)