Skip to content

Commit

Permalink
Block cmk operation if invalid cmk spec (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
arishta-yb authored Aug 17, 2023
1 parent 0d09bf9 commit 499e50d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions managed/resource_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,7 @@ func (r resourceCluster) Create(ctx context.Context, req tfsdk.CreateResourceReq
createClusterRequest.SecurityCmkSpec = *openapiclient.NewNullableCMKSpec(cmkSpec)
} else {
resp.Diagnostics.AddError("Error creating CMK Spec.", err.Error())
return
}
}

Expand Down Expand Up @@ -1607,6 +1608,7 @@ func (r resourceCluster) Update(ctx context.Context, req tfsdk.UpdateResourceReq
cmkSpec, err := createCmkSpec(plan)
if err != nil {
resp.Diagnostics.AddError("Error creating CMK Spec: ", err.Error())
return
} else {
err = editClusterCmk(ctx, apiClient, accountId, projectId, clusterId, *cmkSpec)
if err != nil {
Expand Down

0 comments on commit 499e50d

Please sign in to comment.