Produce mount volume only if OVS_HOST_PATH is defined
In case of empty $OVS_HOST_PATH
tools/generate_k8s_resource_definitions generates incorrect
cni_ds.yaml.
openvswitch mount volume is necessary for ovn use case
and maybe for vhostuser use case.
So it's better to omit it when $OVS_HOST_PATH is empty.
Closes-Bug:
@@ -649,9 +649,13 @@ spec:
subPath: kuryr-cni.conf
- name: proc
mountPath: /host_proc
+EOF
+ if [[ -n "$OVS_HOST_PATH" ]]; then
+ cat >> "${output_dir}/cni_ds.yml" << EOF
- name: openvswitch
mountPath: /var/run/openvswitch
EOF
+ fi
if [ "$cni_daemon" == "True" ]; then
cat >> "${output_dir}/cni_ds.yml" << EOF
readinessProbe:
@@ -682,10 +686,14 @@ EOF
- name: proc
hostPath:
path: /proc
+EOF
+ if [[ -n "$OVS_HOST_PATH" ]]; then
+ cat >> "${output_dir}/cni_ds.yml" << EOF
- name: openvswitch
hostPath:
path: ${OVS_HOST_PATH}
EOF
+ fi
}
# install_openshift_binary
