mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 15:58:37 +00:00
cloudprovider: aws InstanceID implementation
Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
This commit is contained in:
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.
|
// InstanceID returns the cloud provider ID of the specified instance.
|
||||||
func (aws *AWSCloud) InstanceID(name string) (string, error) {
|
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.
|
// Return the instances matching the relevant private dns name.
|
||||||
|
Loading…
Reference in New Issue
Block a user