Commit 7bc205fc authored by realfake's avatar realfake

Implement *ByProviderID methods

parent fc748662
...@@ -17,7 +17,6 @@ limitations under the License. ...@@ -17,7 +17,6 @@ limitations under the License.
package azure package azure
import ( import (
"errors"
"fmt" "fmt"
"k8s.io/kubernetes/pkg/api/v1" "k8s.io/kubernetes/pkg/api/v1"
...@@ -44,7 +43,12 @@ func (az *Cloud) NodeAddresses(name types.NodeName) ([]v1.NodeAddress, error) { ...@@ -44,7 +43,12 @@ func (az *Cloud) NodeAddresses(name types.NodeName) ([]v1.NodeAddress, error) {
// This method will not be called from the node that is requesting this ID. i.e. metadata service // This method will not be called from the node that is requesting this ID. i.e. metadata service
// and other local methods cannot be used here // and other local methods cannot be used here
func (az *Cloud) NodeAddressesByProviderID(providerID string) ([]v1.NodeAddress, error) { func (az *Cloud) NodeAddressesByProviderID(providerID string) ([]v1.NodeAddress, error) {
return []v1.NodeAddress{}, errors.New("unimplemented") name, err := splitProviderID(providerID)
if err != nil {
return nil, err
}
return az.NodeAddresses(name)
} }
// ExternalID returns the cloud provider ID of the specified instance (deprecated). // ExternalID returns the cloud provider ID of the specified instance (deprecated).
...@@ -68,7 +72,12 @@ func (az *Cloud) InstanceID(name types.NodeName) (string, error) { ...@@ -68,7 +72,12 @@ func (az *Cloud) InstanceID(name types.NodeName) (string, error) {
// This method will not be called from the node that is requesting this ID. i.e. metadata service // This method will not be called from the node that is requesting this ID. i.e. metadata service
// and other local methods cannot be used here // and other local methods cannot be used here
func (az *Cloud) InstanceTypeByProviderID(providerID string) (string, error) { func (az *Cloud) InstanceTypeByProviderID(providerID string) (string, error) {
return "", errors.New("unimplemented") name, err := splitProviderID(providerID)
if err != nil {
return "", err
}
return az.InstanceID(name)
} }
// InstanceType returns the type of the specified instance. // InstanceType returns the type of the specified instance.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment