Skip to content

Commit

Permalink
CLOUDGA-13901-Restrict updating KMS provider during updateCmk (#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
arishta-yb authored May 24, 2023
1 parent ad9bc77 commit aa794ec
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/cluster/encryption/encryption.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ var updateCmk = &cobra.Command{
logrus.Fatalf("Unable to parse new CMK spec: %v", err)
}

if newCmkSpec.GetProviderType() != oldCmkSpec.GetProviderType() {
logrus.Fatalf("Modifying KMS provider is not allowed.")
}

// Need to copy over the AWS ARNs
if newCmkSpec.GetProviderType() == "AWS" {
newCmkSpec.AwsCmkSpec.Get().ArnList = oldCmkSpec.AwsCmkSpec.Get().ArnList
Expand Down

0 comments on commit aa794ec

Please sign in to comment.