From 333137d8151e93635567f73d5abc12893359f57d Mon Sep 17 00:00:00 2001 From: bzd111 Date: Wed, 23 Aug 2023 18:09:45 +0800 Subject: [PATCH] kubelet's metric label name has been updated from camel case to snake case from k8s 1.19 --- kube_hunter/modules/hunting/kubelet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kube_hunter/modules/hunting/kubelet.py b/kube_hunter/modules/hunting/kubelet.py index 6f9e8f6b..75f7bd7c 100644 --- a/kube_hunter/modules/hunting/kubelet.py +++ b/kube_hunter/modules/hunting/kubelet.py @@ -256,7 +256,7 @@ def get_k8s_version(self): if line.startswith("kubernetes_build_info"): for info in line[line.find("{") + 1 : line.find("}")].split(","): k, v = info.split("=") - if k == "gitVersion": + if k == "gitVersion" or k == "git_version": return v.strip('"') # returns list of tuples of Privileged container and their pod.