diff --git a/openvswitch/templates/bin/_openvswitch-vswitchd.sh.tpl b/openvswitch/templates/bin/_openvswitch-vswitchd.sh.tpl index 23ef00d8c..3ba842e27 100644 --- a/openvswitch/templates/bin/_openvswitch-vswitchd.sh.tpl +++ b/openvswitch/templates/bin/_openvswitch-vswitchd.sh.tpl @@ -107,4 +107,12 @@ function stop () { ovs-appctl -T1 -t /run/openvswitch/ovs-vswitchd.${PID}.ctl exit } +function poststart () { + # This enables the usage of 'ovs-appctl' from neutron-ovs-agent pod. + + PID=$(cat $OVS_PID) + OVS_CTL=/run/openvswitch/ovs-vswitchd.${PID}.ctl + chown {{ .Values.pod.user.nova.uid }}.{{ .Values.pod.user.nova.uid }} ${OVS_CTL} +} + $COMMAND diff --git a/openvswitch/templates/daemonset-ovs-vswitchd.yaml b/openvswitch/templates/daemonset-ovs-vswitchd.yaml index 41dcf8f03..8c6849b46 100644 --- a/openvswitch/templates/daemonset-ovs-vswitchd.yaml +++ b/openvswitch/templates/daemonset-ovs-vswitchd.yaml @@ -112,6 +112,11 @@ It should be handled through lcore and pmd core masks. */}} - /tmp/openvswitch-vswitchd.sh - start lifecycle: + postStart: + exec: + command: + - /tmp/openvswitch-vswitchd.sh + - poststart preStop: exec: command: