Bug 1925319 - bash syntax error in configure-ovs.sh script
Summary: bash syntax error in configure-ovs.sh script
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Networking
Version: 4.7
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 4.7.0
Assignee: Tim Rozet
QA Contact: Ross Brattain
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-02-04 20:59 UTC by Ross Brattain
Modified: 2021-02-24 15:58 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-02-24 15:58:18 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift machine-config-operator pull 2392 0 None closed Bug 1925319: configure-ovs: fix bash syntax error 2021-02-09 08:31:18 UTC
Red Hat Product Errata RHSA-2020:5633 0 None None None 2021-02-24 15:58:31 UTC

Description Ross Brattain 2021-02-04 20:59:42 UTC
Description of problem:

Syntax error in MCO template 

machine-config-operator/templates/common/_base/files/configure-ovs-network.yaml:144

    if [ -z "$vlan_id"]; then



Version-Release number of selected component (if applicable):

MCO origin/master

4.7.0-0.nightly-2021-02-04-075559

How reproducible:

Always

Steps to Reproduce:
1. extract inline bash script to file
2. shellcheck file
3.

Actual results:

configure-ovs-network.sh:140:5: note: The mentioned syntax error was in this if expression. [SC1009]
configure-ovs-network.sh:140:8: error: Couldn't parse this test expression. Fix to allow more checks. [SC1073]
configure-ovs-network.sh:140:13: error: Expected this to be an argument to the unary condition. [SC1019]
configure-ovs-network.sh:140:24: error: You need a space before the ]. [SC1020]
configure-ovs-network.sh:140:24: error: Missing space before ]. Fix any mentioned problems and try again. [SC1072]

Expected results:

No bash syntax errors

Comment 1 Ross Brattain 2021-02-04 21:01:57 UTC
Once fixed we should test OVN on VLAN interfaces on baremetal somehow.

Comment 3 Ross Brattain 2021-02-04 21:28:21 UTC
Relates to Bonding/VLAN fix for https://bugzilla.redhat.com/show_bug.cgi?id=1887545

Comment 5 zhaozhanqi 2021-02-09 08:37:04 UTC
Verified this bug on 4.7.0-0.nightly-2021-02-06-084550

cat /usr/local/bin/configure-ovs.sh | grep -i "vlan_id"
    vlan_id=$(nmcli --get-values vlan.id conn show ${old_conn})
    if [ -z "$vlan_id" ]; then
      echo "ERROR: unable to determine vlan_id for vlan connection: ${old_conn}"
    extra_phys_args="dev ${vlan_parent} id ${vlan_id}"

Comment 8 errata-xmlrpc 2021-02-24 15:58:18 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Container Platform 4.7.0 security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:5633


Note You need to log in before you can comment on or make changes to this bug.