From 2eb06eea800a32949ac5c555accbd2591b4d39e8 Mon Sep 17 00:00:00 2001 From: Krisztian Litkey Date: Thu, 19 Sep 2024 08:10:52 +0300 Subject: [PATCH 1/2] e2e: set fedora CNI plugin path for containerd. Signed-off-by: Krisztian Litkey --- test/e2e/playbook/provision.yaml | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/test/e2e/playbook/provision.yaml b/test/e2e/playbook/provision.yaml index 4e1b72805..619c40098 100644 --- a/test/e2e/playbook/provision.yaml +++ b/test/e2e/playbook/provision.yaml @@ -290,12 +290,21 @@ - name: Configure containerd when: is_containerd - ansible.builtin.shell: "{{ item }}" - with_items: - - mkdir -p /etc/containerd - - containerd config default > /etc/containerd/config.toml - - sed -i 's/^.*disabled_plugins *= *.*$/disabled_plugins = []/' /etc/containerd/config.toml - - sed -i 's/SystemdCgroup = false/SystemdCgroup = true/g' /etc/containerd/config.toml + block: + - name: Create containerd configuration + ansible.builtin.shell: "{{ item }}" + with_items: + - mkdir -p /etc/containerd + - containerd config default > /etc/containerd/config.toml + - sed -i 's/^.*disabled_plugins *= *.*$/disabled_plugins = []/' /etc/containerd/config.toml + - sed -i 's/SystemdCgroup = false/SystemdCgroup = true/g' /etc/containerd/config.toml + + - name: Update CNI plugin directory on Fedora + when: ansible_facts['distribution'] == "Fedora" + ansible.builtin.lineinfile: + path: /etc/containerd/config.toml + regexp: ' *bin_dir *= *"/opt/cni/bin" *' + line: 'bin_dir = "/usr/libexec/cni"' - name: Setup NRI ansible.builtin.file: From e2b4e2bbae53cb129f5610f1ea931e34a3a871ad Mon Sep 17 00:00:00 2001 From: Krisztian Litkey Date: Thu, 19 Sep 2024 08:20:37 +0300 Subject: [PATCH 2/2] e2e: configure bridge plugin earlier. When using the bridge plugin, configure it earlier, right after the basic runtime configuration has been created, before NRI is enabled or the runtime restarted. This should make it sure that the node does not linger in a NotReady state causing false test failures. Signed-off-by: Krisztian Litkey --- test/e2e/playbook/provision.yaml | 34 ++++++++++++++++---------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/test/e2e/playbook/provision.yaml b/test/e2e/playbook/provision.yaml index 619c40098..c6a6f7482 100644 --- a/test/e2e/playbook/provision.yaml +++ b/test/e2e/playbook/provision.yaml @@ -306,6 +306,23 @@ regexp: ' *bin_dir *= *"/opt/cni/bin" *' line: 'bin_dir = "/usr/libexec/cni"' + - name: Configure bridge CNI plugin + when: cni_plugin == "bridge" + block: + - name: Copy CNI bridge plugin configuration + ansible.builtin.copy: + src: "{{ nri_resource_policy_src }}/test/e2e/files/10-bridge.conf.in" + dest: "/etc/cni/net.d/10-bridge.conf" + owner: root + group: root + mode: '0644' + + - name: Update CNI bridge plugin configuration + ansible.builtin.replace: + path: /etc/cni/net.d/10-bridge.conf + regexp: '(CNI_NETWORK)' + replace: "{{ network }}" + - name: Setup NRI ansible.builtin.file: path: "{{ item }}" @@ -426,23 +443,6 @@ - cilium install --wait - cilium status --wait - - name: Configure bridge CNI plugin - when: cni_plugin == "bridge" - block: - - name: Copy CNI bridge plugin configuration - ansible.builtin.copy: - src: "{{ nri_resource_policy_src }}/test/e2e/files/10-bridge.conf.in" - dest: "/etc/cni/net.d/10-bridge.conf" - owner: root - group: root - mode: '0644' - - - name: Update CNI bridge plugin configuration - ansible.builtin.replace: - path: /etc/cni/net.d/10-bridge.conf - regexp: 'CNI_NETWORK' - replace: "{{ network }}" - - name: Generate join command ansible.builtin.command: cmd: kubeadm token create --print-join-command