From c31a8a787a44cfecad26bdf5682766c82fe1c29a Mon Sep 17 00:00:00 2001 From: Marcel_Henselin Date: Thu, 7 May 2026 07:13:50 +0000 Subject: [PATCH] fix: wrong data type (#110) ## Description relates to #1234 ## Checklist - [ ] Issue was linked above - [ ] Code format was applied: `make fmt` - [ ] Examples were added / adjusted (see `examples/` directory) - [x] Docs are up-to-date: `make generate-docs` (will be checked by CI) - [ ] Unit tests got implemented or updated - [ ] Acceptance tests got implemented or updated (see e.g. [here](https://github.com/stackitcloud/terraform-provider-stackit/blob/f5f99d170996b208672ae684b6da53420e369563/stackit/internal/services/dns/dns_acc_test.go)) - [x] Unit tests are passing: `make test` (will be checked by CI) - [x] No linter issues: `make lint` (will be checked by CI) Co-authored-by: Marcel S. Henselin Reviewed-on: https://tf-provider.git.onstackit.cloud/stackit-dev-tools/terraform-provider-stackitprivatepreview/pulls/110 --- .../postgresflexalpha/flavor/datasource.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/stackit/internal/services/postgresflexalpha/flavor/datasource.go b/stackit/internal/services/postgresflexalpha/flavor/datasource.go index 715c68ed..ee7177f6 100644 --- a/stackit/internal/services/postgresflexalpha/flavor/datasource.go +++ b/stackit/internal/services/postgresflexalpha/flavor/datasource.go @@ -220,14 +220,24 @@ func (r *flavorDataSource) Read(ctx context.Context, req datasource.ReadRequest, } else { var scList []attr.Value for _, sc := range f.StorageClasses { + mIop := types.Int32Null() + if val, ok := sc.GetMaxIoPerSecOk(); ok { + mIop = types.Int32Value(*val) + } + + mThrough := types.Int32Null() + if val, ok := sc.GetMaxThroughInMbOk(); ok { + mThrough = types.Int32Value(*val) + } + scList = append( scList, postgresflexalphaGen.NewStorageClassesValueMust( postgresflexalphaGen.StorageClassesValue{}.AttributeTypes(ctx), map[string]attr.Value{ "class": types.StringValue(sc.Class), - "max_io_per_sec": types.Int64Value(int64(sc.GetMaxIoPerSec())), - "max_through_in_mb": types.Int64Value(int64(sc.GetMaxThroughInMb())), + "max_io_per_sec": mIop, + "max_through_in_mb": mThrough, }, ), )