Skip to content

Commit

Permalink
[MKS-4439]Add checking local_volume with volume_type
Browse files Browse the repository at this point in the history
  • Loading branch information
Artem Minasyan committed Nov 27, 2024
1 parent 4b87dd2 commit 431a65d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
1 change: 0 additions & 1 deletion selectel/import_selectel_iam_user_v1_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (

func TestAccIAMV1UserImportBasic(t *testing.T) {
resourceName := "selectel_iam_user_v1.user_tf_acc_test_1"
//nolint:goconst
userEmail := acctest.RandomWithPrefix("tf-acc") + "@example.com"

resource.Test(t, resource.TestCase{
Expand Down
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 @@ -256,6 +255,10 @@ func resourceMKSNodegroupV1Create(ctx context.Context, d *schema.ResourceData, m
InstallNvidiaDevicePlugin: &installNvidiaDevicePlugin,
}

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 431a65d

Please sign in to comment.