fix: wrong data type (#110)
All checks were successful
Publish / Check GoReleaser config (push) Successful in 6s
Publish / Publish provider (push) Successful in 6m22s

## Description

<!-- **Please link some issue here describing what you are trying to achieve.**

In case there is no issue present for your PR, please consider creating one.
At least please give us some description what you are trying to achieve and why your change is needed. -->

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](f5f99d1709/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 <marcel.henselin@stackit.cloud>
Reviewed-on: #110
This commit is contained in:
Marcel_Henselin 2026-05-07 07:13:50 +00:00
parent 515b7b1357
commit c31a8a787a
Signed by: tf-provider.git.onstackit.cloud
GPG key ID: 6D7E8A1ED8955A9C

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