Skip to content

Commit

Permalink
Have kops-controller authorize droplet names instead of IPs
Browse files Browse the repository at this point in the history
  • Loading branch information
rifelpet committed Oct 5, 2023
1 parent a2ac9d3 commit 7a37a36
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions upup/pkg/fi/cloudup/do/verifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,20 +98,12 @@ func (o digitalOceanVerifier) VerifyToken(ctx context.Context, rawRequest *http.

// The node challenge is important here though, verifying the caller has control of the IP address.

nodeName := ""
if len(addresses) == 0 {
// Name seems a better default than the first IP, but we have to match what other components are expecting
nodeName = droplet.Name
} else {
nodeName = addresses[0]
}

if len(challengeEndpoints) == 0 {
return nil, fmt.Errorf("cannot determine challenge endpoint for server %q", serverID)
}

result := &bootstrap.VerifyResult{
NodeName: nodeName,
NodeName: droplet.Name,
CertificateNames: addresses,
ChallengeEndpoint: challengeEndpoints[0],
}
Expand Down

0 comments on commit 7a37a36

Please sign in to comment.