Skip to content

Commit

Permalink
Add checking local_volume with volume_type #303 (#324)
Browse files Browse the repository at this point in the history
Co-authored-by: Artem Minasyan <[email protected]>
Co-authored-by: Ilya Kulakov <[email protected]>
  • Loading branch information
3 people authored Jan 21, 2025
1 parent 8abd879 commit 99e1d5a
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 99e1d5a

Please sign in to comment.