fix: allow setting a custom ip address as the ip pf the dokku server

This will provide the ability to override cases where the detected ip address is invalid for whatever reason.
This commit is contained in:
Jose Diaz-Gonzalez
2024-01-23 03:26:32 -05:00
parent c6838b645e
commit 204517074b
4 changed files with 72 additions and 56 deletions

View File

@@ -21,16 +21,18 @@ func main() {
case "initialize":
args := flag.NewFlagSet("scheduler-k3s:initialize", flag.ExitOnError)
taintScheduling := args.Bool("taint-scheduling", false, "taint-scheduling: add a taint against scheduling app workloads")
serverIP := args.String("server-ip", "", "server-ip: IP address of the dokku server node")
args.Parse(os.Args[2:])
err = scheduler_k3s.CommandInitialize(*taintScheduling)
err = scheduler_k3s.CommandInitialize(*serverIP, *taintScheduling)
case "cluster-add":
args := flag.NewFlagSet("scheduler-k3s:cluster-add", flag.ExitOnError)
allowUknownHosts := args.Bool("insecure-allow-unknown-hosts", false, "insecure-allow-unknown-hosts: allow unknown hosts")
taintScheduling := args.Bool("taint-scheduling", false, "taint-scheduling: add a taint against scheduling app workloads")
serverIP := args.String("server-ip", "", "server-ip: IP address of the dokku server node")
role := args.String("role", "worker", "role: [ server | worker ]")
args.Parse(os.Args[2:])
remoteHost := args.Arg(0)
err = scheduler_k3s.CommandClusterAdd(*role, remoteHost, *allowUknownHosts, *taintScheduling)
err = scheduler_k3s.CommandClusterAdd(*role, remoteHost, *serverIP, *allowUknownHosts, *taintScheduling)
case "cluster-list":
args := flag.NewFlagSet("scheduler-k3s:cluster-list", flag.ExitOnError)
format := args.String("format", "stdout", "format: [ stdout | json ]")