This commit is contained in:
Chao Xu
2016-11-18 13:31:44 -08:00
parent d0a725a522
commit 31ed340eec
8 changed files with 99 additions and 53 deletions

View File

@@ -18,12 +18,10 @@ package system
import (
"regexp"
"k8s.io/kubernetes/pkg/api"
)
// TODO: find a better way of figuring out if given node is a registered master.
func IsMasterNode(node *api.Node) bool {
func IsMasterNode(nodeName string) bool {
r := regexp.MustCompile("master(-...)?$")
return r.MatchString(node.Name)
return r.MatchString(nodeName)
}