mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-28 13:03:43 +00:00
Implement *ByProviderID methods
This commit is contained in:
parent
fc748662ef
commit
7bc205fc59
@ -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) {
|
|||||||
// 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) {
|
|||||||
// 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.
|
||||||
|
Loading…
Reference in New Issue
Block a user