Skip to content

Commit 46b1096

Browse files
committed
transformSize accept UnitBytes created by interpolation
Signed-off-by: Nicolas De Loof <[email protected]>
1 parent 81485a4 commit 46b1096

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

loader/loader.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1005,10 +1005,13 @@ var transformSize TransformerFunc = func(value interface{}) (interface{}, error)
10051005
switch value := value.(type) {
10061006
case int:
10071007
return int64(value), nil
1008+
case int64, types.UnitBytes:
1009+
return value, nil
10081010
case string:
10091011
return units.RAMInBytes(value)
1012+
default:
1013+
return value, errors.Errorf("invalid type for size %T", value)
10101014
}
1011-
panic(errors.Errorf("invalid type for size %T", value))
10121015
}
10131016

10141017
var transformStringToDuration TransformerFunc = func(value interface{}) (interface{}, error) {

0 commit comments

Comments
 (0)