Skip to content

Commit

Permalink
Merge pull request #54 from geekflyer/master
Browse files Browse the repository at this point in the history
fix #52 for good
  • Loading branch information
avivl committed Jun 2, 2019
2 parents 576fb60 + 892df06 commit 9e6167f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions pkg/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func (c *Controller) processNextItem() bool {
return true
}

func (c *Controller) isNodePollMonitored(pool string) bool {
func (c *Controller) isNodePoolMonitored(pool string) bool {
if c.config.AllNodePools == true {
return true
}
Expand Down Expand Up @@ -252,7 +252,7 @@ func (c *Controller) processItem(newEvent Event) error {
var ok bool
if pool, ok = labels["cloud.google.com/gke-nodepool"]; ok {
logrus.Infof("Node pool found %s", pool)
if !c.isNodePollMonitored(pool) {
if !c.isNodePoolMonitored(pool) {
return nil
}
} else {
Expand Down Expand Up @@ -290,7 +290,7 @@ func (c *Controller) processAllNodes() {
for _, node := range nodelist.Items {
labels := node.GetLabels()
if pool, ok = labels["cloud.google.com/gke-nodepool"]; ok {
if !c.isNodePollMonitored(pool) {
if !c.isNodePoolMonitored(pool) {
continue
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion pkg/kipcompute/compute.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func FindFreeAddress(projectID string, region string, pool string, config *cfg.C
return "", err
}
var filter string
if strings.ToLower(pool) == strings.ToLower(config.NodePool) {
if config.AllNodePools || strings.ToLower(pool) == strings.ToLower(config.NodePool) {
filter = "(labels." + config.LabelKey + "=" + config.LabelValue + ")" + " AND (-labels." + config.LabelKey + "-node-pool:*)"
} else {
filter = "(labels." + config.LabelKey + "=" + config.LabelValue + ")" + " AND " + "(labels." + config.LabelKey + "-node-pool=" +pool + ")"
Expand Down

0 comments on commit 9e6167f

Please sign in to comment.