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 6, 2024
1 parent 1b2d7ed commit 4f4699e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
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
2 changes: 1 addition & 1 deletion dockerfile/anaconda-live-iso-creator/lmc-build.j2
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,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 4f4699e

Please sign in to comment.