Skip to content

Commit

Permalink
Use hostnames for node names in DO
Browse files Browse the repository at this point in the history
This matches GCE and AWS and matches an assumption in failing e2e tests that node names match their hostname

Signed-off-by: Peter Rifel <[email protected]>
  • Loading branch information
rifelpet committed Oct 5, 2023
1 parent ed6edaf commit a2ac9d3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions docs/releases/1.29-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ This is a document to gather the release notes prior to the release.

## Openstack

## DigitalOcean

* Node names have changed from the droplet's private IP to the droplet hostname

# Breaking changes

## Other breaking changes
Expand Down
6 changes: 3 additions & 3 deletions upup/pkg/fi/nodeup/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -460,14 +460,14 @@ func evaluateHostnameOverride(cloudProvider api.CloudProviderID) (string, error)
bareHostname := strings.Split(fullyQualified, ".")[0]
return bareHostname, nil
case api.CloudProviderDO:
vBytes, err := vfs.Context.ReadFile("metadata://digitalocean/interfaces/private/0/ipv4/address")
vBytes, err := vfs.Context.ReadFile("metadata://digitalocean/hostname")
if err != nil {
return "", fmt.Errorf("error reading droplet private IP from DigitalOcean metadata: %v", err)
return "", fmt.Errorf("error reading droplet hostname from DigitalOcean metadata: %v", err)
}

hostname := string(vBytes)
if hostname == "" {
return "", errors.New("private IP for digitalocean droplet was empty")
return "", errors.New("hostname for digitalocean droplet was empty")
}

return hostname, nil
Expand Down

0 comments on commit a2ac9d3

Please sign in to comment.