From 962333df313e04a01923ca8394d2a44f2afbb714 Mon Sep 17 00:00:00 2001 From: astebenkova Date: Fri, 31 Jan 2025 13:10:09 +0200 Subject: [PATCH] [openvswitch] Make --user flag optional Add the ability to run the OVS server as root since the following change lacks backward compatibility: https://review.opendev.org/c/openstack/openstack-helm-infra/+/939580 Change-Id: I071f77be0d329fbe98ce283324466bf129fe190d --- openvswitch/templates/bin/_openvswitch-vswitchd.sh.tpl | 6 ++++-- openvswitch/values.yaml | 4 +++- releasenotes/notes/openvswitch-e761d6733b84bdc7.yaml | 4 ++++ 3 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 releasenotes/notes/openvswitch-e761d6733b84bdc7.yaml diff --git a/openvswitch/templates/bin/_openvswitch-vswitchd.sh.tpl b/openvswitch/templates/bin/_openvswitch-vswitchd.sh.tpl index 1c35e1c8f..89f882a32 100644 --- a/openvswitch/templates/bin/_openvswitch-vswitchd.sh.tpl +++ b/openvswitch/templates/bin/_openvswitch-vswitchd.sh.tpl @@ -119,8 +119,10 @@ function start () { -vconsole:err \ -vconsole:info \ --pidfile=${OVS_PID} \ - --mlockall \ - --user="{{ .Values.conf.ovs_user_name }}" + {{- if .Values.conf.ovs_user_name }} + --user="{{ .Values.conf.ovs_user_name }}" \ + {{- end }} + --mlockall } function stop () { diff --git a/openvswitch/values.yaml b/openvswitch/values.yaml index 6cf823373..89aeb88f6 100644 --- a/openvswitch/values.yaml +++ b/openvswitch/values.yaml @@ -243,6 +243,8 @@ conf: # vhost_iommu_support: true ## OVS supports run in non-root for both OVS and OVS DPDK mode, the user # for OVS need to be added to container image with user id 42424. - # useradd -u 42424 openvswitch, groupmod -g 42424 openvswitch + # useradd -u 42424 openvswitch; groupmod -g 42424 openvswitch + # + # Leave empty to run as user that invokes the command (default: root) ovs_user_name: "openvswitch:openvswitch" ... diff --git a/releasenotes/notes/openvswitch-e761d6733b84bdc7.yaml b/releasenotes/notes/openvswitch-e761d6733b84bdc7.yaml new file mode 100644 index 000000000..e818af28c --- /dev/null +++ b/releasenotes/notes/openvswitch-e761d6733b84bdc7.yaml @@ -0,0 +1,4 @@ +--- +openvswitch: + - Make the --user flag for OVS server optional +...