Set ctl socket ownership

This is moved from neutron-ovs-agent init script[0] to
openvswitch poststart to ensure that ovs ctl socket
has the required permissions even if the openvswitch
pods are restarted.

[0] https://github.com/openstack/openstack-helm/blob/master/neutron/templates/bin/_neutron-openvswitch-agent-init.sh.tpl#L22-L25

Change-Id: I09e604576e2408a8dec9905d1ad070422351ed99
This commit is contained in:
rajesh.kudaka 2020-04-23 08:22:04 -05:00 committed by Kudaka Poorna Rajesh
parent bbfa550361
commit f2b8bacb26
2 changed files with 13 additions and 0 deletions

View File

@ -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

View File

@ -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: