Skip to content

Commit

Permalink
Fix port-forward name clash
Browse files Browse the repository at this point in the history
If you have two pods, with similar hostnames, such as:
- somepod
- somepod2
Then the grep would previously capture both, and try to assign IPs
like `192.168.252.10\n11`, which is obviously not quite valid.
This should make it such that the grep will only match when the
name is complete
  • Loading branch information
FrederikNJS committed May 12, 2023
1 parent cec35c3 commit dea38ed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bin/client_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ ip route
# Derived settings
K8S_DNS_IP="$(cut -d ' ' -f 1 <<< "$K8S_DNS_IPS")"
GATEWAY_IP="$(dig +short "$GATEWAY_NAME" "@${K8S_DNS_IP}")"
NAT_ENTRY="$(grep "$(hostname)" /config/nat.conf || true)"
NAT_ENTRY="$(grep "^$(hostname) " /config/nat.conf || true)"
VXLAN_GATEWAY_IP="${VXLAN_IP_NETWORK}.1"

# Make sure there is correct route for gateway
Expand Down

0 comments on commit dea38ed

Please sign in to comment.