Skip to content

Commit a03d12d

Browse files
committed
fixed after rebase
1 parent 03b7681 commit a03d12d

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

stackit/internal/services/sfs/sfs_acc_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,7 @@ func testAccResourcePoolDestroyed(s *terraform.State) error {
919919
resourcePoolsToDestroy = append(resourcePoolsToDestroy, resourcePoolId)
920920
}
921921

922-
resourcePoolsResp, err := client.ListResourcePoolsExecute(ctx, testutil.ProjectId, testutil.Region)
922+
resourcePoolsResp, err := client.DefaultAPI.ListResourcePools(ctx, testutil.ProjectId, testutil.Region).Execute()
923923
if err != nil {
924924
return fmt.Errorf("getting resource pools: %w", err)
925925
}
@@ -929,20 +929,20 @@ func testAccResourcePoolDestroyed(s *terraform.State) error {
929929
id := pool.Id
930930

931931
if utils.Contains(resourcePoolsToDestroy, *id) {
932-
shares, err := client.ListSharesExecute(ctx, testutil.ProjectId, testutil.Region, *id)
932+
shares, err := client.DefaultAPI.ListShares(ctx, testutil.ProjectId, testutil.Region, *id).Execute()
933933
if err != nil {
934934
return fmt.Errorf("cannot list shares: %w", err)
935935
}
936936
if shares.Shares != nil {
937-
for _, share := range *shares.Shares {
938-
_, err := client.DeleteShareExecute(ctx, testutil.ProjectId, testutil.Region, *id, *share.Id)
937+
for _, share := range shares.Shares {
938+
_, err := client.DefaultAPI.DeleteShare(ctx, testutil.ProjectId, testutil.Region, *id, *share.Id).Execute()
939939
if err != nil {
940940
return fmt.Errorf("cannot delete share %q in pool %q: %w", *share.Id, *id, err)
941941
}
942942
}
943943
}
944944

945-
_, err = client.DeleteResourcePool(ctx, testutil.ProjectId, testutil.Region, *id).
945+
_, err = client.DefaultAPI.DeleteResourcePool(ctx, testutil.ProjectId, testutil.Region, *id).
946946
Execute()
947947
if err != nil {
948948
return fmt.Errorf("deleting resourcepool %s during CheckDestroy: %w", *pool.Id, err)

stackit/internal/services/sfs/share/datasource.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ func mapDataSourceFields(_ context.Context, region string, share *sfs.Share, mod
208208
utils.Coalesce(model.ShareId, types.StringPointerValue(share.Id)).ValueString(),
209209
)
210210
model.Name = types.StringPointerValue(share.Name)
211-
if share.ExportPolicy != nil {
211+
if share.ExportPolicy.IsSet() {
212212
if policy := share.ExportPolicy.Get(); policy != nil {
213213
model.ExportPolicyName = types.StringPointerValue(policy.Name)
214214
}

stackit/internal/services/sfs/share/resource.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ func mapFields(_ context.Context, share *sfs.Share, region string, model *Model)
496496
)
497497
model.Name = types.StringPointerValue(share.Name)
498498

499-
if share.ExportPolicy != nil {
499+
if share.ExportPolicy.IsSet() {
500500
if policy := share.ExportPolicy.Get(); policy != nil {
501501
model.ExportPolicyName = types.StringPointerValue(policy.Name)
502502
}

0 commit comments

Comments
 (0)