You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the BYOIPv4 feature was introduced to the terraform provisioning in
50c0a9d, a new EIP resource was created unconditionally. The
bootstrap VM was first getting a public IP from the `associate_public_ip_address` config in the instance and that IP was
then discarded when the EIP was created and associated with the instance.
However, a "race" could happen in which, at the end of the bootstrap
stage, we saved the first (and now dead) IP address:
```
DEBUG Outputs:
DEBUG
DEBUG bootstrap_ip = "18.222.119.149"
DEBUG [INFO] running Terraform command: /c/terraform/bin/terraform output -no-color -json
DEBUG {
DEBUG "bootstrap_ip": {
DEBUG "sensitive": false,
DEBUG "type": "string",
DEBUG "value": "18.222.119.149"
DEBUG }
DEBUG }
```
In case of bootstrap failure, the `gather bootstrap` would use the stale
IP address and fail to connect:
```
time="2024-04-12T15:08:49Z" level=info msg="Failed to gather bootstrap logs: failed to connect to the bootstrap machine: dial tcp 18.222.119.149:22: connect: connection timed out"
```
instead of using the actual EIP address "18.225.29.102".
This changes proposes the following fixes:
1. Only create an EIP if a public IPv4 pool has been specified.
2. Only `associate_public_ip_address` to the bootstrap instance if
public IPv4 pools have *not* been specified.
3. At the end of the bootstrap stage, save the correct IP address by
considering whether the bootstrap EIP was created or not.
0 commit comments