From bcb5dfa11cc5c4ee03f36e88709946817fb46438 Mon Sep 17 00:00:00 2001 From: Brian Goff Date: Tue, 14 Jul 2020 15:33:59 -0700 Subject: [PATCH] Fix running pods handler on nil lister This follows suit with other hanlders and returns a NotImplemented http.HandlerFunc when the lister is nil. Signed-off-by: Brian Goff --- node/api/pods.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/node/api/pods.go b/node/api/pods.go index 071220505..0faf12fe7 100644 --- a/node/api/pods.go +++ b/node/api/pods.go @@ -27,6 +27,10 @@ import ( type PodListerFunc func(context.Context) ([]*v1.Pod, error) func HandleRunningPods(getPods PodListerFunc) http.HandlerFunc { + if getPods == nil { + return NotImplemented + } + scheme := runtime.NewScheme() v1.SchemeBuilder.AddToScheme(scheme) //nolint:errcheck codecs := serializer.NewCodecFactory(scheme)