Skip to content

Commit

Permalink
fixup! [CC-30640] allow manual version control for standard clusters
Browse files Browse the repository at this point in the history
  • Loading branch information
fantapop committed Dec 5, 2024
1 parent 4914afc commit d54a3d0
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions internal/provider/cluster_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -845,17 +845,17 @@ func (r *clusterResource) Update(
if stateUpgradeTypeString != planUpgradeTypeString {
resp.Diagnostics.AddError("Error updating cluster", "upgrade_type and version must not be changed during the same plan.")
return
} else {
stateUpgradeTypePtr, err := client.NewUpgradeTypeTypeFromValue(stateUpgradeTypeString)
if err != nil {
resp.Diagnostics.AddError("Error updating cluster", err.Error())
return
}
stateUpgradeType := *stateUpgradeTypePtr
if stateUpgradeType != client.UPGRADETYPETYPE_MANUAL {
resp.Diagnostics.AddError("Error updating cluster", "upgrade_type must be set to MANUAL before setting cockroach_version.")
return
}
}

stateUpgradeTypePtr, err := client.NewUpgradeTypeTypeFromValue(stateUpgradeTypeString)
if err != nil {
resp.Diagnostics.AddError("Error updating cluster", err.Error())
return
}
stateUpgradeType := *stateUpgradeTypePtr
if stateUpgradeType != client.UPGRADETYPETYPE_MANUAL {
resp.Diagnostics.AddError("Error updating cluster", "upgrade_type must be set to MANUAL before setting cockroach_version.")
return
}
}

Expand Down

0 comments on commit d54a3d0

Please sign in to comment.