taint also node controller

fix function

fix gofmt

fix function return value

fix tests

skip notimplemented error

remove factory unused

in openstack we should try to find instanceid from all states instead of ACTIVE, all other cloudproviders do this already

fix tests and lint

fix gofmt

fix nodelifecycletest

fix lint errors
This commit is contained in:
Jesse Haka
2018-02-09 23:05:05 +02:00
parent 3cf5b172fa
commit 6665fa7144
5 changed files with 179 additions and 8 deletions

View File

@@ -187,6 +187,21 @@ func ExistsInCloudProvider(cloud cloudprovider.Interface, nodeName types.NodeNam
return true, nil
}
// ShutdownInCloudProvider returns true if the node is shutdowned in
// cloud provider.
func ShutdownInCloudProvider(cloud cloudprovider.Interface, nodeName types.NodeName) (bool, error) {
instances, ok := cloud.Instances()
if !ok {
return false, fmt.Errorf("%v", ErrCloudInstance)
}
providerID, err := cloudprovider.GetInstanceProviderID(context.TODO(), cloud, nodeName)
if err != nil {
return false, err
}
shutdown, err := instances.InstanceShutdownByProviderID(context.TODO(), providerID)
return shutdown, err
}
// RecordNodeEvent records a event related to a node.
func RecordNodeEvent(recorder record.EventRecorder, nodeName, nodeUID, eventtype, reason, event string) {
ref := &v1.ObjectReference{