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
  • Loading branch information
rifelpet committed Oct 5, 2023
1 parent ed6edaf commit 6030873
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 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)
}

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 6030873

Please sign in to comment.