bootstrapper: only err if no control plane IPs available (#3496)

Previously we errored out of the entire join if retrieval
of either LB IP or control plane public IP failed. This resulted
in the entire "use either IP" logic not working as intended. This now
makes it log a warning only if the IP retrievals fail, and only errors
out of the join if no IP can be found at all.
This commit is contained in:
Moritz Sanft 2024-11-26 10:38:18 +01:00 committed by GitHub
parent fbdf1db053
commit 52372ae808
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -173,13 +173,13 @@ func (c *JoinClient) tryJoinWithAvailableServices() (ticket *joinproto.IssueJoin
endpoint, _, err := c.metadataAPI.GetLoadBalancerEndpoint(ctx)
if err != nil {
return nil, nil, fmt.Errorf("failed to get load balancer endpoint: %w", err)
c.log.Warn("Failed to get load balancer endpoint", "err", err)
}
endpoints = append(endpoints, endpoint)
ips, err := c.getControlPlaneIPs(ctx)
if err != nil {
return nil, nil, fmt.Errorf("failed to get control plane IPs: %w", err)
c.log.Warn("Failed to get control plane IPs", "err", err)
}
endpoints = append(endpoints, ips...)