From 1294fd57308b9e3a21d30ed20ebc13b50173d45d Mon Sep 17 00:00:00 2001
From: Samuel Liu <liupeng0518@gmail.com>
Date: Fri, 29 Apr 2022 15:35:13 +0800
Subject: [PATCH] check calico ipv6 (#8738)

* check calico ipv6

* just check ipip mode for ipv6
---
 roles/network_plugin/calico/defaults/main.yml |  1 +
 roles/network_plugin/calico/tasks/check.yml   | 10 ++++++++++
 2 files changed, 11 insertions(+)

diff --git a/roles/network_plugin/calico/defaults/main.yml b/roles/network_plugin/calico/defaults/main.yml
index 17f1706c4..ae1b65dc1 100644
--- a/roles/network_plugin/calico/defaults/main.yml
+++ b/roles/network_plugin/calico/defaults/main.yml
@@ -10,6 +10,7 @@ calico_ipv4pool_ipip: "Off"
 calico_ipip_mode: Never  # valid values are 'Always', 'Never' and 'CrossSubnet'
 calico_vxlan_mode: Always  # valid values are 'Always', 'Never' and 'CrossSubnet'
 
+# Calico doesn't support ipip tunneling for the IPv6.
 calico_ipip_mode_ipv6: Never
 calico_vxlan_mode_ipv6: Never
 calico_pool_blocksize_ipv6: 116
diff --git a/roles/network_plugin/calico/tasks/check.yml b/roles/network_plugin/calico/tasks/check.yml
index 0b164534a..b961bdf40 100644
--- a/roles/network_plugin/calico/tasks/check.yml
+++ b/roles/network_plugin/calico/tasks/check.yml
@@ -173,3 +173,13 @@
     - typha_enabled
   run_once: True
   delegate_to: "{{ groups['kube_control_plane'][0] }}"
+
+- name: "Check ipip mode is Nerver for calco ipv6"
+  assert:
+    that:
+      - "calico_ipip_mode_ipv6 in ['Never']"
+    msg: "Calico doesn't support ipip tunneling for the IPv6"
+  when:
+    - enable_dual_stack_networks
+  run_once: True
+  delegate_to: "{{ groups['kube_control_plane'][0] }}"
-- 
GitLab