fix: wrong flavor data type
All checks were successful
CI Workflow / Check GoReleaser config (pull_request) Successful in 1m1s
Notify on new PR / Notify via Google Chat (pull_request) Successful in 1m21s
CI Workflow / Prepare GO cache (pull_request) Successful in 3m32s
CI Workflow / CI run build and linting (pull_request) Successful in 4m41s
CI Workflow / CI run tests (pull_request) Successful in 6m10s
CI Workflow / Code coverage report (pull_request) Successful in 46s
TF Acceptance Tests Workflow / Acceptance Tests (pull_request) Successful in 22m26s
CI Workflow / Test readiness for publishing provider (pull_request) Successful in 19m30s

This commit is contained in:
Marcel S. Henselin 2026-05-07 09:12:54 +02:00
parent ad221b9bc0
commit 01f91fb613

View file

@ -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,
},
),
)