mirror of https://github.com/k3s-io/k3s
cloudprovider: aws InstanceID implementation
Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>pull/6/head
parent
466a7daaa8
commit
185d0e19d5
|
@ -438,7 +438,13 @@ func (aws *AWSCloud) ExternalID(name string) (string, error) {
|
|||
|
||||
// InstanceID returns the cloud provider ID of the specified instance.
|
||||
func (aws *AWSCloud) InstanceID(name string) (string, error) {
|
||||
return "", nil
|
||||
inst, err := aws.getInstancesByDnsName(name)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
// In the future it is possible to also return an endpoint as:
|
||||
// <endpoint>/<zone>/<instanceid>
|
||||
return "/" + *inst.Placement.AvailabilityZone + "/" + *inst.InstanceID, nil
|
||||
}
|
||||
|
||||
// Return the instances matching the relevant private dns name.
|
||||
|
|
Loading…
Reference in New Issue