fixed wrong iteration on list when getting random pod

This commit is contained in:
Daniel Sagi
2020-06-26 14:29:20 +03:00
parent 77ccd4a20b
commit de764e192f
+1 -1
View File
@@ -425,7 +425,7 @@ class SecureKubeletPortHunter(Hunter):
pod_data = next(filter(is_kubesystem_pod, pods_data), None)
if pod_data:
container_data = next(pod_data["spec"]["containers"], None)
container_data = pod_data["spec"]["containers"][0]
if container_data:
return {
"name": pod_data["metadata"]["name"],