Revert "Fix master/pool logic of network states"
This reverts commit 79edb304a7d9bf9047d63f136aacdb1f8c76cd85.
Change-Id: I1e47615b62134b951a4ea5995f99d2440623936a
diff --git a/kubernetes/master/flannel.sls b/kubernetes/master/flannel.sls
index aaae1c5..c11283d 100644
--- a/kubernetes/master/flannel.sls
+++ b/kubernetes/master/flannel.sls
@@ -1,6 +1,8 @@
{%- from "kubernetes/map.jinja" import master with context %}
{%- if master.enabled %}
+{%- if not pillar.kubernetes.pool is defined %}
+
/etc/cni/net.d/12-flannel.conflist:
file.managed:
- source: salt://kubernetes/files/flannel/flannel.conflist
@@ -12,3 +14,5 @@
- template: jinja
{%- endif %}
+
+{%- endif %}
diff --git a/kubernetes/master/genie.sls b/kubernetes/master/genie.sls
index ff34e46..cb1b7e6 100644
--- a/kubernetes/master/genie.sls
+++ b/kubernetes/master/genie.sls
@@ -1,6 +1,8 @@
{%- from "kubernetes/map.jinja" import master with context %}
{%- if master.enabled %}
+{%- if not pillar.kubernetes.pool is defined %}
+
/etc/cni/net.d/00-genie.conf:
file.managed:
- source: salt://kubernetes/files/genie/genie.conf
@@ -28,3 +30,5 @@
{%- endif %}
{%- endif %}
+
+{%- endif %}
diff --git a/kubernetes/master/init.sls b/kubernetes/master/init.sls
index 3b04778..29cf645 100644
--- a/kubernetes/master/init.sls
+++ b/kubernetes/master/init.sls
@@ -9,11 +9,15 @@
- kubernetes.master.opencontrail
{%- endif %}
{%- if master.network.get('calico', {}).get('enabled', False) %}
+{%- if not pillar.kubernetes.pool is defined %}
- kubernetes.master.calico
{%- endif %}
+{%- endif %}
{%- if master.network.get('genie', {}).get('enabled', False) %}
+{%- if not pillar.kubernetes.pool is defined %}
- kubernetes.master.genie
{%- endif %}
+{%- endif %}
{%- if master.network.get('sriov', {}).get('enabled', False) %}
- kubernetes.master.sriov
{%- endif %}
diff --git a/kubernetes/master/sriov.sls b/kubernetes/master/sriov.sls
index 19ea51b..7091f35 100644
--- a/kubernetes/master/sriov.sls
+++ b/kubernetes/master/sriov.sls
@@ -1,6 +1,7 @@
{%- from "kubernetes/map.jinja" import master with context %}
{%- if master.enabled %}
+{%- if not pillar.kubernetes.pool is defined %}
/etc/cni/net.d/13-sriov.conf:
file.managed:
- source: salt://kubernetes/files/sriov/sriov.conf
@@ -28,3 +29,4 @@
{%- endif %}
{%- endif %}
+{%- endif %}
diff --git a/kubernetes/pool/flannel.sls b/kubernetes/pool/flannel.sls
index 006e21e..416a107 100644
--- a/kubernetes/pool/flannel.sls
+++ b/kubernetes/pool/flannel.sls
@@ -1,8 +1,6 @@
{%- from "kubernetes/map.jinja" import pool with context %}
{%- if pool.enabled %}
-{%- if not pillar.kubernetes.master is defined %}
-
/etc/cni/net.d/12-flannel.conflist:
file.managed:
- source: salt://kubernetes/files/flannel/flannel.conflist
@@ -14,5 +12,3 @@
- template: jinja
{%- endif %}
-
-{%- endif %}
diff --git a/kubernetes/pool/genie.sls b/kubernetes/pool/genie.sls
index 842ac05..fc05825 100644
--- a/kubernetes/pool/genie.sls
+++ b/kubernetes/pool/genie.sls
@@ -1,8 +1,6 @@
{%- from "kubernetes/map.jinja" import pool with context %}
{%- if pool.enabled %}
-{%- if not pillar.kubernetes.master is defined %}
-
/etc/cni/net.d/00-genie.conf:
file.managed:
- source: salt://kubernetes/files/genie/genie.conf
@@ -30,5 +28,3 @@
{%- endif %}
{%- endif %}
-
-{%- endif %}
diff --git a/kubernetes/pool/init.sls b/kubernetes/pool/init.sls
index 21d5bee..d5acd23 100644
--- a/kubernetes/pool/init.sls
+++ b/kubernetes/pool/init.sls
@@ -1,11 +1,9 @@
{%- from "kubernetes/map.jinja" import pool with context %}
{%- from "kubernetes/map.jinja" import common with context -%}
include:
-{%- if not pillar.kubernetes.master is defined %}
{%- if pool.network.get('calico', {}).get('enabled', False) %}
- kubernetes.pool.calico
{%- endif %}
-{%- endif %}
{%- if pool.network.get('opencontrail', {}).get('enabled', False) %}
- kubernetes.pool.opencontrail
{%- endif %}
@@ -13,11 +11,9 @@
{%- if pool.network.get('flannel', {}).get('enabled', False) %}
- kubernetes.pool.flannel
{%- endif %}
-{%- if not pillar.kubernetes.master is defined %}
{%- if pool.network.get('genie', {}).get('enabled', False) %}
- kubernetes.pool.genie
{%- endif %}
-{%- endif %}
{%- if pool.network.get('sriov', {}).get('enabled', False) %}
- kubernetes.pool.sriov
{%- endif %}
diff --git a/kubernetes/pool/sriov.sls b/kubernetes/pool/sriov.sls
index e55dd52..d471c37 100644
--- a/kubernetes/pool/sriov.sls
+++ b/kubernetes/pool/sriov.sls
@@ -1,7 +1,6 @@
{%- from "kubernetes/map.jinja" import pool with context %}
{%- if pool.enabled %}
-{%- if not pillar.kubernetes.master is defined %}
/etc/cni/net.d/13-sriov.conf:
file.managed:
- source: salt://kubernetes/files/sriov/sriov.conf
@@ -29,4 +28,3 @@
{%- endif %}
{%- endif %}
-{%- endif %}