Skip to content

Commit

Permalink
fix: only add encryption context to args when it is specified
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
  • Loading branch information
sagikazarmark committed Aug 3, 2023
1 parent 75531ba commit 5018b5b
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 5018b5b

Please # to comment.