mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-07 11:13:48 +00:00
Fix a bug in framework.IgnoreNotFound where it will panic when a function type's final input parameter is a "..." parameter.
This commit is contained in:
parent
475ee33f69
commit
cd6f4153e0
@ -97,7 +97,12 @@ func IgnoreNotFound(in any) any {
|
||||
inType := reflect.TypeOf(in)
|
||||
inValue := reflect.ValueOf(in)
|
||||
return reflect.MakeFunc(inType, func(args []reflect.Value) []reflect.Value {
|
||||
out := inValue.Call(args)
|
||||
var out []reflect.Value
|
||||
if inType.IsVariadic() {
|
||||
out = inValue.CallSlice(args)
|
||||
} else {
|
||||
out = inValue.Call(args)
|
||||
}
|
||||
if len(out) > 0 {
|
||||
lastValue := out[len(out)-1]
|
||||
last := lastValue.Interface()
|
||||
|
Loading…
Reference in New Issue
Block a user