Wait for either a IPv4 or IPv6 IP address#108
Wait for either a IPv4 or IPv6 IP address#108derekhiggins wants to merge 1 commit intometal3-io:masterfrom
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: derekhiggins The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
| PROVISIONING_INTERFACE=${PROVISIONING_INTERFACE:-"provisioning"} | ||
| HTTP_PORT=${HTTP_PORT:-"80"} | ||
| HTTP_IP=$(ip -4 address show dev "$PROVISIONING_INTERFACE" | grep -oP '(?<=inet\s)\d+(\.\d+){3}' | head -n 1) | ||
| HTTP_IP=$(ip -br addr show dev em2 | grep -Po "[^\s]+/[0-9]+" | grep -e "^fd" -e "\." | sed -e 's%/.*%%' | head -n 1) |
There was a problem hiding this comment.
shouldn't we keep "$PROVISIONING_INTERFACE" instead of em2 ?
There was a problem hiding this comment.
yup, thanks, that was a mistake from where I was testing, will fix
| echo "Waiting for ${PROVISIONING_INTERFACE} interface to be configured" | ||
| sleep 1 | ||
| HTTP_IP=$(ip -4 address show dev "$PROVISIONING_INTERFACE" | grep -oP '(?<=inet\s)\d+(\.\d+){3}' | head -n 1) | ||
| HTTP_IP=$(ip -br addr show dev em2 | grep -Po "[^\s]+/[0-9]+" | grep -e "^fd" -e "\." | sed -e 's%/.*%%' | head -n 1) |
Add support for IPv6 IP addfresses on the provisioning interface. Now greps for any ip address containeing a "." or beginning in "fd".
cf9384f to
854caf0
Compare
| PROVISIONING_INTERFACE=${PROVISIONING_INTERFACE:-"provisioning"} | ||
| HTTP_PORT=${HTTP_PORT:-"80"} | ||
| HTTP_IP=$(ip -4 address show dev "$PROVISIONING_INTERFACE" | grep -oP '(?<=inet\s)\d+(\.\d+){3}' | head -n 1) | ||
| HTTP_IP=$(ip -br addr show dev $PROVISIONING_INTERFACE | grep -Po "[^\s]+/[0-9]+" | grep -e "^fd" -e "\." | sed -e 's%/.*%%' | head -n 1) |
There was a problem hiding this comment.
I think we need to replace the grep -Po "[^\s]+/[0-9]+" because the minikube busybox shell doesn't support the -P option, and also I think that numeric regex is now wrong for the hex ipv6 addresses?
There was a problem hiding this comment.
Actually this doesn't run on the host so ignore the busybox remark, but I think the regex still needs adjustment?
There was a problem hiding this comment.
I think we need to replace the
grep -Po "[^\s]+/[0-9]+"because the minikube busybox shell doesn't support the-Poption,
I can submit an alternative without the -P, is this scripts being used somewhere outside of the container is being built in?
and also I think that numeric regex is now wrong for the hex ipv6 addresses?
I'm not sure what you mean here which regex is wrong?
@hardys hardys referenced this pull request 28 minutes ago
Listen IPv6 addresses for HTTPD #107
Sorry I hadn't seen this had already started in another PR, I can abandon if ye want to continue with the other approach.
There was a problem hiding this comment.
Ah sorry, I misread the regex - it's fine as it's matching string/NN - the reason I hit the -P issue is I tried testing it via copy/paste on busybox, so that's probably not an issue.
Re the other PR there has been some good discussion there so lets see if we can reach conclusion re the approach there then update whichever PR makes sense
stbenjam
left a comment
There was a problem hiding this comment.
If we go with this approach you would need to make sure to have a way to detect its IPv6 so the inspector url is correctly surrounded with brackets as well
|
Killing this in favour of the earlier PR that has had more discussion #107 |
…ift-4.7-ironic Updating ironic builder & base images to be consistent with ART
Add support for IPv6 IP addfresses on the provisioning
interface. Now greps for any ip address containeing a "." or
beginning in "fd".