mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-12-03 06:43:53 +00:00
implement InstanceShutdownByProviderID for azure
This commit is contained in:
@@ -121,7 +121,17 @@ func (az *Cloud) InstanceExistsByProviderID(ctx context.Context, providerID stri
|
||||
|
||||
// InstanceShutdownByProviderID returns true if the instance is in safe state to detach volumes
|
||||
func (az *Cloud) InstanceShutdownByProviderID(ctx context.Context, providerID string) (bool, error) {
|
||||
return false, cloudprovider.NotImplemented
|
||||
nodeName, err := az.vmSet.GetNodeNameByProviderID(providerID)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
provisioningState, err := az.vmSet.GetProvisioningStateByNodeName(string(nodeName))
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
return strings.ToLower(provisioningState) == "stopped" || strings.ToLower(provisioningState) == "deallocated", nil
|
||||
}
|
||||
|
||||
// getComputeMetadata gets compute information from instance metadata.
|
||||
|
||||
Reference in New Issue
Block a user