Skip to content

Commit

Permalink
Merge pull request #644 from rramkumar1/small-cleanup
Browse files Browse the repository at this point in the history
Move lone function in kubeapi.go into existing utils.go
  • Loading branch information
k8s-ci-robot authored Feb 19, 2019
2 parents 91fa0b8 + f18939d commit 1fffa09
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 31 deletions.
31 changes: 0 additions & 31 deletions pkg/utils/kubeapi.go

This file was deleted.

11 changes: 11 additions & 0 deletions pkg/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,17 @@ func GetReadyNodeNames(lister listers.NodeLister) ([]string, error) {
return nodeNames, nil
}

// NodeIsReady returns true if a node contains at least one condition of type "Ready"
func NodeIsReady(node *api_v1.Node) bool {
for i := range node.Status.Conditions {
condition := &node.Status.Conditions[i]
if condition.Type == api_v1.NodeReady {
return condition.Status == api_v1.ConditionTrue
}
}
return false
}

// This is a duplicate definition of the function in:
// kubernetes/kubernetes/pkg/controller/service/service_controller.go
func GetNodeConditionPredicate() listers.NodeConditionPredicate {
Expand Down

0 comments on commit 1fffa09

Please sign in to comment.