ClusterLabs / resource-agents

Combined repository of OCF agents from the RHCS and Linux-HA projects
GNU General Public License v2.0
489 stars 577 forks source link

ocivip: Fix PRIMARY_IFACE variable. In some cases ip returns two lines #1895

Closed garutilorenzo closed 9 months ago

garutilorenzo commented 9 months ago

Fix PRIMARY_IFACE variable. In some cases ip commands returns two lines

knet-jenkins[bot] commented 9 months ago

Can one of the admins check and authorise this run please: https://ci.kronosnet.org/job/resource-agents/job/resource-agents-pipeline/job/PR-1895/1/input

oalbrigt commented 9 months ago

Thanks.

oalbrigt commented 8 months ago

Can you give us an example of the 2 lines ip returns, so we might improve the patch or have an idea why it happens?

garutilorenzo commented 8 months ago

Hi @oalbrigt here one example

ubuntu@ubuntu-instance:~$ ip -4 route ls | grep default
default via 10.0.0.1 dev ens3 
default via 10.0.0.1 dev ens3 proto dhcp src 10.0.0.88 metric 100 
ubuntu@ubuntu-instance:~$

OS version:

ubuntu@ubuntu-instance:~$ cat /etc/os-release 
PRETTY_NAME="Ubuntu 22.04.3 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.3 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
oalbrigt commented 8 months ago

Thanks. I dont see that issue on our distros, but I guess it could happen, and I can confirm that it shouldnt cause any harm.