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".

Kubernetes-commit: 02b4e99c9f0afa4ef9fa0283670c1515e40a5278
This commit is contained in:
Patrick Ohly 2024-03-04 12:23:54 +01:00 committed by Kubernetes Publisher
parent 32d42093a4
commit 561da9109f
1 changed files with 1 additions and 1 deletions

View File

@ -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