mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-02-28 09:39:12 +03:00
Refactor: simpify cloud_provider is defined condition
For this change, `cloud_provider` change the default value to empty string. Signed-off-by: ChengHao Yang <17496418+tico88612@users.noreply.github.com>
This commit is contained in:
@@ -24,7 +24,7 @@ nodeRegistration:
|
||||
taints: []
|
||||
{% endif %}
|
||||
criSocket: {{ cri_socket }}
|
||||
{% if cloud_provider is defined and cloud_provider in ["external"] %}
|
||||
{% if cloud_provider == "external" %}
|
||||
kubeletExtraArgs:
|
||||
cloud-provider: external
|
||||
{% endif %}
|
||||
|
||||
@@ -21,7 +21,7 @@ KUBELET_VOLUME_PLUGIN="--volume-plugin-dir={{ kubelet_flexvolumes_plugins_dir }}
|
||||
{% if kube_network_plugin is defined and kube_network_plugin == "cloud" %}
|
||||
KUBELET_NETWORK_PLUGIN="--hairpin-mode=promiscuous-bridge --network-plugin=kubenet"
|
||||
{% endif %}
|
||||
{% if cloud_provider is defined and cloud_provider in ["external"] %}
|
||||
{% if cloud_provider == "external" %}
|
||||
KUBELET_CLOUDPROVIDER="--cloud-provider={{ cloud_provider }}"
|
||||
{% else %}
|
||||
KUBELET_CLOUDPROVIDER=""
|
||||
|
||||
@@ -166,10 +166,9 @@
|
||||
|
||||
- name: Check cloud_provider value
|
||||
assert:
|
||||
that: cloud_provider in ['external']
|
||||
msg: "If set the 'cloud_provider' var must be set either to 'external'"
|
||||
that: cloud_provider == 'external'
|
||||
when:
|
||||
- cloud_provider is defined
|
||||
- cloud_provider
|
||||
- not ignore_assert_errors
|
||||
tags:
|
||||
- cloud-provider
|
||||
|
||||
Reference in New Issue
Block a user