Skip to content

Commit

Permalink
Merge pull request #242 from gujingit/feature/exclude-node
Browse files Browse the repository at this point in the history
Feature/exclude node
  • Loading branch information
k8s-ci-robot authored Mar 3, 2021
2 parents 29e294c + 6f8114f commit 2194b6c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
3 changes: 2 additions & 1 deletion cloud-controller-manager/controller/node/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,8 @@ func (cnc *CloudNodeController) doAddCloudNode(node *v1.Node) error {
// This condition marks the node as unusable until routes are initialized in the cloud provider
// Aoxn: Hack for alibaba cloud
if route.Options.ConfigCloudRoutes &&
cnc.cloud.ProviderName() == "alicloud" {
cnc.cloud.ProviderName() == "alicloud" &&
!utils.IsExcludedNode(node) {
if err := cnc.setNodeCondition(node); err != nil {
klog.Errorf("set node %s condition error: %s", node.Name, err.Error())
return false, nil
Expand Down
7 changes: 3 additions & 4 deletions cloud-controller-manager/listeners.go
Original file line number Diff line number Diff line change
Expand Up @@ -1513,10 +1513,9 @@ func (n *Listener) listenerHasUserManagedNode(ctx context.Context) (bool, error)
}

for _, backend := range remoteVg.BackendServers.BackendServer {
klog.V(5).Infof("remote: %s, local: %s ", backend.Description, n.NamedKey.Reference(int32(backend.Port)))
if isUserManagedNode(backend.Description, n.NamedKey.Reference(int32(backend.Port))) {
klog.Infof("%s vgroup %s has user managed node, node ip is %s, node id is %s",
n.NamedKey, n.VServerGroupId, backend.ServerIp, backend.ServerId)
if isUserManagedNode(backend.Description, remoteVg.VServerGroupName) {
klog.Infof("%s has user managed node %s, description %s, vGroupName: %s",
n.VServerGroupId, backend.ServerId, backend.Description, remoteVg.VServerGroupName)
return true, nil
}
}
Expand Down

0 comments on commit 2194b6c

Please sign in to comment.