fix: wrong data type #110
1 changed files with 12 additions and 2 deletions
|
|
@ -220,14 +220,24 @@ func (r *flavorDataSource) Read(ctx context.Context, req datasource.ReadRequest,
|
||||||
} else {
|
} else {
|
||||||
var scList []attr.Value
|
var scList []attr.Value
|
||||||
for _, sc := range f.StorageClasses {
|
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 = append(
|
||||||
scList,
|
scList,
|
||||||
postgresflexalphaGen.NewStorageClassesValueMust(
|
postgresflexalphaGen.NewStorageClassesValueMust(
|
||||||
postgresflexalphaGen.StorageClassesValue{}.AttributeTypes(ctx),
|
postgresflexalphaGen.StorageClassesValue{}.AttributeTypes(ctx),
|
||||||
map[string]attr.Value{
|
map[string]attr.Value{
|
||||||
"class": types.StringValue(sc.Class),
|
"class": types.StringValue(sc.Class),
|
||||||
"max_io_per_sec": types.Int64Value(int64(sc.GetMaxIoPerSec())),
|
"max_io_per_sec": mIop,
|
||||||
"max_through_in_mb": types.Int64Value(int64(sc.GetMaxThroughInMb())),
|
"max_through_in_mb": mThrough,
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue