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:
parent
4849c2fc2b
commit
2c270fa5ab
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user