cloudprovider: add support for InstanceID method

Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
This commit is contained in:
Federico Simoncelli
2015-05-08 11:19:17 -04:00
parent 194343267d
commit faba12951a
9 changed files with 51 additions and 8 deletions

View File

@@ -427,7 +427,7 @@ func (aws *AWSCloud) NodeAddresses(name string) ([]api.NodeAddress, error) {
return addresses, nil
}
// ExternalID returns the cloud provider ID of the specified instance.
// ExternalID returns the cloud provider ID of the specified instance (deprecated).
func (aws *AWSCloud) ExternalID(name string) (string, error) {
inst, err := aws.getInstancesByDnsName(name)
if err != nil {
@@ -436,6 +436,11 @@ func (aws *AWSCloud) ExternalID(name string) (string, error) {
return *inst.InstanceID, nil
}
// InstanceID returns the cloud provider ID of the specified instance.
func (aws *AWSCloud) InstanceID(name string) (string, error) {
return "", nil
}
// Return the instances matching the relevant private dns name.
func (aws *AWSCloud) getInstancesByDnsName(name string) (*ec2.Instance, error) {
f := &ec2InstanceFilter{}