From e9a816672540cd34d452509eac84933f0ed3a9a6 Mon Sep 17 00:00:00 2001 From: ricolin Date: Thu, 29 Jun 2023 01:05:29 +0800 Subject: [PATCH] Add buffer to wait for ovs pid file This fixes for cases file not yet generated from start(), but already required on poststart() in openvswitch-vswitchd.sh. Add wait condition until file exists. Change-Id: Iae041046fd6e7e7f991b4cd1aa101c97bcaa150c --- openvswitch/Chart.yaml | 2 +- openvswitch/templates/bin/_openvswitch-vswitchd.sh.tpl | 6 +++++- releasenotes/notes/openvswitch.yaml | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/openvswitch/Chart.yaml b/openvswitch/Chart.yaml index f0e783807..107dc2f87 100644 --- a/openvswitch/Chart.yaml +++ b/openvswitch/Chart.yaml @@ -15,7 +15,7 @@ apiVersion: v1 appVersion: v1.0.0 description: OpenStack-Helm OpenVSwitch name: openvswitch -version: 0.1.13 +version: 0.1.14 home: http://openvswitch.org icon: https://www.openstack.org/themes/openstack/images/project-mascots/Neutron/OpenStack_Project_Neutron_vertical.png sources: diff --git a/openvswitch/templates/bin/_openvswitch-vswitchd.sh.tpl b/openvswitch/templates/bin/_openvswitch-vswitchd.sh.tpl index a1a29ccdd..93aaa60c9 100644 --- a/openvswitch/templates/bin/_openvswitch-vswitchd.sh.tpl +++ b/openvswitch/templates/bin/_openvswitch-vswitchd.sh.tpl @@ -109,7 +109,11 @@ function stop () { function poststart () { # This enables the usage of 'ovs-appctl' from neutron-ovs-agent pod. - + until [ -f $OVS_PID ] + do + echo "Waiting for file $OVS_PID" + sleep 1 + done 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} diff --git a/releasenotes/notes/openvswitch.yaml b/releasenotes/notes/openvswitch.yaml index 3babdee61..bc5d7d4bc 100644 --- a/releasenotes/notes/openvswitch.yaml +++ b/releasenotes/notes/openvswitch.yaml @@ -14,5 +14,5 @@ openvswitch: - 0.1.11 Add ovn.yaml in values_override, Enable ptcp_port 6640 which needed when use ovn - 0.1.12 Replace node-role.kubernetes.io/master with control-plane - 0.1.13 Upgrade openvswitch image to latest-ubuntu_focal to fix qos issue - + - 0.1.14 Add buffer before accesses pid file ...