Commit d327ac6c authored by Miao Luo's avatar Miao Luo

vSphere for cloud-controller-manager

Implement NodeAddressesByProviderID and InstanceTypeByProviderID for vsphere cloud provider.
parent 8c52c8f1
...@@ -580,7 +580,8 @@ func (vs *VSphere) NodeAddresses(nodeName k8stypes.NodeName) ([]v1.NodeAddress, ...@@ -580,7 +580,8 @@ func (vs *VSphere) NodeAddresses(nodeName k8stypes.NodeName) ([]v1.NodeAddress,
// 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 (vs *VSphere) NodeAddressesByProviderID(providerID string) ([]v1.NodeAddress, error) { func (vs *VSphere) NodeAddressesByProviderID(providerID string) ([]v1.NodeAddress, error) {
return []v1.NodeAddress{}, errors.New("unimplemented") vmName := path.Base(providerID)
return vs.NodeAddresses(vmNameToNodeName(vmName))
} }
func (vs *VSphere) AddSSHKeyToAllInstances(user string, keyData []byte) error { func (vs *VSphere) AddSSHKeyToAllInstances(user string, keyData []byte) error {
...@@ -663,7 +664,7 @@ func (vs *VSphere) InstanceID(nodeName k8stypes.NodeName) (string, error) { ...@@ -663,7 +664,7 @@ func (vs *VSphere) InstanceID(nodeName k8stypes.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 (vs *VSphere) InstanceTypeByProviderID(providerID string) (string, error) { func (vs *VSphere) InstanceTypeByProviderID(providerID string) (string, error) {
return "", errors.New("unimplemented") return "", nil
} }
func (vs *VSphere) InstanceType(name k8stypes.NodeName) (string, error) { func (vs *VSphere) InstanceType(name k8stypes.NodeName) (string, error) {
......
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