Skip to content

Commit

Permalink
Update default route interface lookup: (#70)
Browse files Browse the repository at this point in the history
## Description


If multiple default routes exists, we should only use the first one.

## Why is this needed



Fixes: #

## How Has This Been Tested?





## How are existing users impacted? What migration steps/scripts do we need?





## Checklist:

I have:

- [ ] updated the documentation and/or roadmap (if required)
- [ ] added unit or e2e tests
- [ ] provided instructions on how to upgrade
  • Loading branch information
mergify[bot] authored Oct 27, 2023
2 parents d38e9b0 + 6e104bc commit 4ccc28d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tinkerbell/stack/templates/nginx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ spec:
# if sourceInterface is not set use the interface from the default route
srcInterface="{{ $sourceInterface }}"
if [ -z "$srcInterface" ]; then
srcInterface=$(nsenter -t1 -n ip route | awk '/default/ {print $5}')
srcInterface=$(nsenter -t1 -n ip route | awk '/default/ {print $5}' | head -n1)
fi
# Create a macvlan interface. TODO: If this fails, try again with a different name?
nsenter -t1 -n ip link add {{ $macvlanInterfaceName }} link ${srcInterface} type macvlan mode bridge
Expand Down

0 comments on commit 4ccc28d

Please sign in to comment.