Skip to content

Commit 9f7ce09

Browse files
authored
Import Fix storagepool-tier (#283)
1 parent 8438d9b commit 9f7ce09

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

powerscale/provider/storagepool_tier_resource.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,6 @@ func (r *StoragepoolTierResource) Update(ctx context.Context, req resource.Updat
251251
resp.Diagnostics.Append(diags...)
252252
return
253253
}
254-
255254
helper.StoragepoolTierListsDiff(ctx, planBackup, &state)
256255
resp.Diagnostics.Append(resp.State.Set(ctx, &state)...)
257256
tflog.Info(ctx, "Done with Update Storagepool Tier resource state")
@@ -291,6 +290,14 @@ func (r *StoragepoolTierResource) ImportState(ctx context.Context, req resource.
291290
resp.Diagnostics.Append(diags...)
292291
return
293292
}
293+
if len(state.Children.Elements()) == 0 {
294+
state.Children = types.ListNull(types.StringType)
295+
}
296+
if len(state.Lnns.Elements()) == 0 {
297+
state.Lnns = types.ListNull(types.Int32Type)
298+
}
299+
300+
helper.StoragepoolTierListsDiff(ctx, state, &state)
294301
resp.Diagnostics.Append(resp.State.Set(ctx, &state)...)
295302
tflog.Info(ctx, "Done with Update Storagepool Tier resource state")
296303

0 commit comments

Comments
 (0)