Skip to content

Commit

Permalink
infra: Fix live image generation if machine has multiple IPs
Browse files Browse the repository at this point in the history
In some cases a machine running live image creation might have more than
one valid IP address. As either of them should be usable for us,
lets just pick the first one and use it.

Otherwise we would end up with corrupted kickstart where multiple
lines of addresses would be added, failing validation later on in LMC.
  • Loading branch information
M4rtinK committed Aug 5, 2024
1 parent 1b2d7ed commit ea262d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dockerfile/anaconda-live-iso-creator/lmc-build
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ start_http_server() {
echo "$!" > $HTTP_PID

# extract container IP
IP=$(ip -4 addr show scope global | grep -oP 'inet \K[\d.]+')
IP=$(ip -4 addr show scope global | grep -oP 'inet \K[\d.]+' | head -n1)
echo "http://$IP:8000/"
}

Expand Down

0 comments on commit ea262d4

Please sign in to comment.