Skip to content

Commit

Permalink
Make HSM pin an optional argument to allow setting it via the BANK_VA…
Browse files Browse the repository at this point in the history
…ULTS_HSM_PIN env var
  • Loading branch information
mark64 committed Oct 29, 2023
1 parent 38cc62a commit cacd2d5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 0 additions & 1 deletion deploy/crd/bases/vault.banzaicloud.com_vaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1150,7 +1150,6 @@ spec:
required:
- keyLabel
- modulePath
- pin
type: object
kubernetes:
properties:
Expand Down
9 changes: 7 additions & 2 deletions pkg/apis/vault/v1alpha1/vault_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -781,10 +781,15 @@ func (usc *UnsealConfig) ToArgs(vault *Vault) []string {
fmt.Sprint(usc.HSM.SlotID),
"--hsm-key-label",
usc.HSM.KeyLabel,
"--hsm-pin",
usc.HSM.Pin,
)

if usc.HSM.Pin != "" {
args = append(args,
"--hsm-pin",
usc.HSM.Pin,
)
}

if usc.HSM.TokenLabel != "" {
args = append(args,
"--hsm-token-label",
Expand Down

0 comments on commit cacd2d5

Please # to comment.