k8sutil: GetPodNames() return nil if slice is empty
@@ -60,6 +60,9 @@ func SetEtcdVersion(pod *v1.Pod, version string) {
}
func GetPodNames(pods []*v1.Pod) []string {
+ if len(pods) == 0 {
+ return nil
+ }
res := []string{}
for _, p := range pods {
res = append(res, p.Name)
