mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-07-24 15:55:17 -04:00
terraform-provider: validate microservice and image version during plan (#2814)
This commit is contained in:
parent
baad7d8310
commit
9a814f91b1
3 changed files with 45 additions and 32 deletions
|
@ -460,6 +460,18 @@ func (r *ClusterResource) ModifyPlan(ctx context.Context, req resource.ModifyPla
|
|||
"For details, see https://docs.edgeless.systems/constellation/overview/license")
|
||||
}
|
||||
|
||||
// Validate during plan. Must be done in ModifyPlan to read provider data.
|
||||
// See https://developer.hashicorp.com/terraform/plugin/framework/resources/configure#define-resource-configure-method.
|
||||
_, diags := r.getMicroserviceVersion(&plannedState)
|
||||
resp.Diagnostics.Append(diags...)
|
||||
|
||||
_, _, diags = r.getImageVersion(ctx, &plannedState)
|
||||
resp.Diagnostics.Append(diags...)
|
||||
|
||||
if resp.Diagnostics.HasError() {
|
||||
return
|
||||
}
|
||||
|
||||
// Checks running on updates to the resource. (i.e. state and plan != nil)
|
||||
if !req.State.Raw.IsNull() {
|
||||
// Read currentState supplied by Terraform runtime into the model
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue