Skip to content

Commit

Permalink
remove downgrade version checking, rely on API response
Browse files Browse the repository at this point in the history
  • Loading branch information
dcrosta committed Oct 8, 2024
1 parent fee94b7 commit afb2c01
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions internal/provider/cluster_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -732,31 +732,6 @@ func (r *clusterResource) Update(
return
}

if downgrade, _ := isDowngrade(stateVersion, planVersion); downgrade {
var targetVersionInfo client.ClusterMajorVersion
for _, v := range apiResp.Versions {
if v.Version == planVersion {
targetVersionInfo = v
break
}
}

var validDowngrade bool
for _, v := range targetVersionInfo.AllowedUpgrades {
if v == stateVersion {
validDowngrade = true
break
}
}
if !validDowngrade {
resp.Diagnostics.AddError("Invalid CockroachDB version",
fmt.Sprintf(
"Cannot roll back to to '%s'.",
planVersion))
return
}
}

traceAPICall("UpdateCluster")
clusterObj, _, err := r.provider.service.UpdateCluster(ctx, plan.ID.ValueString(), &client.UpdateClusterSpecification{
CockroachVersion: &planVersion,
Expand Down

0 comments on commit afb2c01

Please sign in to comment.