From 65f86ae58e91d272592f1092f247f4bf956e4f77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dulko?= Date: Tue, 18 Dec 2018 13:17:05 +0100 Subject: [PATCH] Lookup container name in cni_ds_init If your kuryr-cni pod definition consists of multiple containers (e.g. you've added an initContainer), cni_ds_init script is prone to error when looking up the container running kuryr-daemon. This is becasue it's only looking at pod name and namespace. This commit extends it by adding container.name=kuryr-cni to the conditions. Change-Id: Ib45f6f9f366a62d373c6f37def07e7dcc862726d Closes-Bug: 1808969 --- cni_ds_init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cni_ds_init b/cni_ds_init index a6d50dfd5..77754f945 100755 --- a/cni_ds_init +++ b/cni_ds_init @@ -31,7 +31,7 @@ for container in containers: if (label_key in container and container[label_key].get('io.kubernetes.pod.name') == '${KURYR_CNI_POD_NAME}' and container[label_key].get('io.kubernetes.pod.namespace') == '${POD_NAMESPACE}' and - container[label_key].get('io.kubernetes.container.name') != 'POD'): + container[label_key].get('io.kubernetes.container.name') == 'kuryr-cni'): print(container[id_key]) break "