mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-06 10:43:56 +00:00
cel: fix conversion of quantity to quantity
The code in ConvertToType checked for conversion into typeValue (= "kubernetes.URL") instead of conversion into quantityTypeValue (= "kubernetes.Quantity") and thus most likely failed with an incorrect "type conversion error".
This commit is contained in:
parent
e798fa67b5
commit
02b4e99c9f
@ -50,7 +50,7 @@ func (d Quantity) ConvertToNative(typeDesc reflect.Type) (interface{}, error) {
|
|||||||
|
|
||||||
func (d Quantity) ConvertToType(typeVal ref.Type) ref.Val {
|
func (d Quantity) ConvertToType(typeVal ref.Type) ref.Val {
|
||||||
switch typeVal {
|
switch typeVal {
|
||||||
case typeValue:
|
case quantityTypeValue:
|
||||||
return d
|
return d
|
||||||
case types.TypeType:
|
case types.TypeType:
|
||||||
return quantityTypeValue
|
return quantityTypeValue
|
||||||
|
Loading…
Reference in New Issue
Block a user