mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-10 13:42:02 +00:00
Allow omitting -machines flag in apiserver when -cloud_provider and
-minion_regexp are specified because it is eventually overwritten by -minion_regexp.
This commit is contained in:
@@ -50,16 +50,25 @@ func init() {
|
|||||||
flag.Var(&machineList, "machines", "List of machines to schedule onto, comma separated.")
|
flag.Var(&machineList, "machines", "List of machines to schedule onto, comma separated.")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func verifyMinionFlags() {
|
||||||
|
if *cloudProvider == "" || *minionRegexp == "" {
|
||||||
|
if len(machineList) == 0 {
|
||||||
|
glog.Fatal("No machines specified!")
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if len(machineList) != 0 {
|
||||||
|
glog.Info("-machines is overwritten by -minion_regexp")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
util.InitLogs()
|
util.InitLogs()
|
||||||
defer util.FlushLogs()
|
defer util.FlushLogs()
|
||||||
|
|
||||||
version.PrintAndExitIfRequested()
|
version.PrintAndExitIfRequested()
|
||||||
|
verifyMinionFlags()
|
||||||
if len(machineList) == 0 {
|
|
||||||
glog.Fatal("No machines specified!")
|
|
||||||
}
|
|
||||||
|
|
||||||
var cloud cloudprovider.Interface
|
var cloud cloudprovider.Interface
|
||||||
switch *cloudProvider {
|
switch *cloudProvider {
|
||||||
|
Reference in New Issue
Block a user