Skip to content

Commit

Permalink
Merge pull request #862 from TrekkieCoder/main
Browse files Browse the repository at this point in the history
PR: updated crd script to use local-ipv4 as localCIDR
  • Loading branch information
UltraInstinct14 authored Nov 2, 2024
2 parents d65e8e7 + 2eb244b commit 499c95c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tools/k8s/mkllb-url
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ if [[ ${cloud} == "aws" ]]; then
unzip awscliv2.zip && ./aws/install
fi
token=`curl -s -m 10 -X PUT http://169.254.169.254/latest/api/token -H "X-aws-ec2-metadata-token-ttl-seconds: 21600"` && \
if [[ "x$addr" == "x0.0.0.0" ]]; then
laddr=`curl -s -m 10 -H "X-aws-ec2-metadata-token: $token" http://169.254.169.254/latest/meta-data/local-ipv4`
laddr=`curl -s -m 10 -H "X-aws-ec2-metadata-token: $token" http://169.254.169.254/latest/meta-data/local-ipv4`
if [[ "x$addr" == "xlocal" ]]; then
addr=$laddr
else
addr=`curl -s -m 10 -H "X-aws-ec2-metadata-token: $token" http://169.254.169.254/latest/meta-data/public-ipv4`
fi
addr=`curl -s -m 10 -H "X-aws-ec2-metadata-token: $token" http://169.254.169.254/latest/meta-data/public-ipv4`
else
if [[ "x$addr" == "x0.0.0.0" ]]; then
laddr=`ip route get 8.8.8.8 | head -1 | cut -d' ' -f3`
Expand Down

0 comments on commit 499c95c

Please sign in to comment.