1
0
mirror of https://github.com/rancher/rke.git synced 2025-04-27 03:11:03 +00:00

Use node label when cloudprovider is configured

When cloud provider is configured, the node name can be set by the cloud provider. If we don't account for this, the node cannot be found when we do cluster operation (for example, node delete)
This commit is contained in:
Sebastiaan van Steenis 2020-07-27 14:06:50 +02:00 committed by Denise
parent 4849c2fc2b
commit 2c270fa5ab

View File

@ -24,8 +24,8 @@ const (
)
func DeleteNode(k8sClient *kubernetes.Clientset, nodeName, cloudProvider string) error {
if cloudProvider == AWSCloudProvider {
// If cloud provider is configured, the node name can be set by the cloud provider, which can be different from the original node name
if cloudProvider != "" {
node, err := GetNode(k8sClient, nodeName)
if err != nil {
return err