Update KubernetesTest to filter environment variable replacements for DaemonSet of bunkerweb

This commit is contained in:
Théophile Diot 2024-12-29 12:26:01 +00:00
parent 3645151330
commit 26d70c1a54
No known key found for this signature in database
GPG key ID: FA995104A0BA376A

View file

@ -40,7 +40,7 @@ class KubernetesTest(Test):
}
replace_env = {"API_WHITELIST_IP": "127.0.0.1/8 100.64.0.0/10 192.168.0.0/16 172.16.0.0/12 10.0.0.0/8"}
for yaml in data:
if yaml["metadata"]["name"] == "bunkerweb":
if yaml["metadata"]["name"] == "bunkerweb" and yaml["kind"] == "DaemonSet":
for ele in yaml["spec"]["template"]["spec"]["containers"][0]["env"]:
if ele["name"] in replace_env:
ele["value"] = replace_env[ele["name"]]