Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

init.sh script fails when grep for primary IP returns multiple matches #1246

Closed
kishorj opened this issue Oct 2, 2020 · 0 comments · Fixed by #1247
Closed

init.sh script fails when grep for primary IP returns multiple matches #1246

kishorj opened this issue Oct 2, 2020 · 0 comments · Fixed by #1247
Labels
bug priority/P0 Highest priority. Someone needs to actively work on this.

Comments

@kishorj
Copy link
Contributor

kishorj commented Oct 2, 2020

What happened:

The grep in the code

PRIMARY_IF=$(ip -4 -o a | grep "$HOST_IP" | awk '{print $2}')
could potentially return more than one match, causing the script to fail.
Here is an example when it fails -

eth0: 192.168.0.10
eth1: 192.168.0.100

Failure occurs during upgrade.
What you expected to happen:
Upgrade to amazon-k8s-cni:v1.7.3 is succcessful

How to reproduce it (as minimally and precisely as possible):
Use the IP addresses from the description.
Anything else we need to know?:

Environment:

  • Kubernetes version (use kubectl version): any
  • CNI Version: on upgrade to amazon-k8s-cni:v1.7.3 under right conditions
  • OS (e.g: cat /etc/os-release): any
  • Kernel (e.g. uname -a): any
@kishorj kishorj added the bug label Oct 2, 2020
@kishorj kishorj changed the title init.sh script fails when grep for primary IP matches multiple IPs init.sh script fails when grep for primary IP returns multiple matches Oct 2, 2020
@mogren mogren added the priority/P0 Highest priority. Someone needs to actively work on this. label Oct 2, 2020
mogren pushed a commit to mogren/amazon-vpc-cni-k8s that referenced this issue Oct 2, 2020
mogren pushed a commit that referenced this issue Oct 2, 2020
haouc pushed a commit to haouc/amazon-vpc-cni-k8s that referenced this issue Oct 6, 2020
haouc pushed a commit to haouc/amazon-vpc-cni-k8s that referenced this issue Oct 7, 2020
haouc pushed a commit to haouc/amazon-vpc-cni-k8s that referenced this issue Oct 7, 2020
jayanthvn pushed a commit that referenced this issue Oct 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug priority/P0 Highest priority. Someone needs to actively work on this.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants