Skip to content

Commit

Permalink
Merge pull request #148 from bank-vaults/backport-147
Browse files Browse the repository at this point in the history
fix: only add encryption context to args when it is specified
  • Loading branch information
sagikazarmark authored Aug 3, 2023
2 parents 75531ba + 5018b5b commit ccb081e
Showing 1 changed file with 7 additions and 2 deletions.
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 @@ -704,8 +704,6 @@ func (usc *UnsealConfig) ToArgs(vault *Vault) []string {
usc.AWS.KMSKeyID,
"--aws-kms-region",
usc.AWS.KMSRegion,
"--aws-kms-encryption-context",
usc.AWS.KMSEncryptionContext,
"--aws-s3-bucket",
usc.AWS.S3Bucket,
"--aws-s3-prefix",
Expand All @@ -715,6 +713,13 @@ func (usc *UnsealConfig) ToArgs(vault *Vault) []string {
"--aws-s3-sse-algo",
usc.AWS.S3SSE,
)

if usc.AWS.KMSEncryptionContext != "" {
args = append(args,
"--aws-kms-encryption-context",
usc.AWS.KMSEncryptionContext,
)
}
} else if usc.Alibaba != nil {
args = append(args,
"--mode",
Expand Down

0 comments on commit ccb081e

Please # to comment.