Skip to content

Commit

Permalink
Add checking local_volume with volume_type selectel#303
Browse files Browse the repository at this point in the history
  • Loading branch information
Artem Minasyan committed Jan 20, 2025
1 parent 86a50d1 commit 9e9bf3b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions selectel/resource_selectel_mks_nodegroup_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,9 @@ func resourceMKSNodegroupV1() *schema.Resource {
Computed: true,
},
"volume_type": {
Type: schema.TypeString,
ConflictsWith: []string{"local_volume"},
Optional: true,
ForceNew: true,
Type: schema.TypeString,
Optional: true,
ForceNew: true,
},
"local_volume": {
Type: schema.TypeBool,
Expand Down Expand Up @@ -263,6 +262,10 @@ func resourceMKSNodegroupV1Create(ctx context.Context, d *schema.ResourceData, m
Preemptible: &preemptible,
}

if createOpts.VolumeType != "" && !createOpts.LocalVolume {
return diag.FromErr(fmt.Errorf("can't use volume_type with local_volume: %w", err))
}

projectQuotas, _, err := quotas.GetProjectQuotas(selvpcClient, projectID, region)
if err != nil {
return diag.FromErr(errGettingObject(objectProjectQuotas, projectID, err))
Expand Down

0 comments on commit 9e9bf3b

Please sign in to comment.