Skip to content

Commit

Permalink
Merge pull request #1765 from deads2k/deads-disallow-empty-node-names
Browse files Browse the repository at this point in the history
Merged by openshift-bot
  • Loading branch information
OpenShift Bot committed Apr 16, 2015
2 parents b79a3bc + 5789426 commit 199355c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 7 additions & 0 deletions pkg/cmd/server/api/validation/master.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package validation

import (
"fmt"
"net"
"net/url"
"strings"
Expand Down Expand Up @@ -144,6 +145,12 @@ func ValidateKubernetesMasterConfig(config *api.KubernetesMasterConfig) fielderr
allErrs = append(allErrs, ValidateFile(config.SchedulerConfigFile, "schedulerConfigFile")...)
}

for i, nodeName := range config.StaticNodeNames {
if len(nodeName) == 0 {
allErrs = append(allErrs, fielderrors.NewFieldInvalid(fmt.Sprintf("staticNodeName[%d]", i), nodeName, "may not be empty"))
}
}

return allErrs
}

Expand Down
5 changes: 4 additions & 1 deletion pkg/cmd/server/start/master_args.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,10 +338,13 @@ func (args MasterArgs) BuildSerializeableKubeMasterConfig() (*configapi.Kubernet
masterIP = ip.String()
}

staticNodeList := util.NewStringSet(args.NodeList...)
staticNodeList.Delete("")

config := &configapi.KubernetesMasterConfig{
MasterIP: masterIP,
ServicesSubnet: servicesSubnet.String(),
StaticNodeNames: args.NodeList,
StaticNodeNames: staticNodeList.List(),
SchedulerConfigFile: args.SchedulerConfigFile,
}

Expand Down

0 comments on commit 199355c

Please sign in to comment.