feat: implement :cluster-list and :cluster-remove

These - and the existing :cluster-add command - do not require root.
This commit is contained in:
Jose Diaz-Gonzalez committed 2024-01-23 03:00:27 -05:00
1 parent d494e01c7b
commit 0730647af7
6 files changed
+229 -8

No files matched your search

@@ -31,6 +31,16 @@ func main() {
args.Parse(os.Args[2:])
remoteHost := args.Arg(0)
err = scheduler_k3s.CommandClusterAdd(*role, remoteHost, *allowUknownHosts, *taintScheduling)
case "cluster-list":
args := flag.NewFlagSet("scheduler-k3s:cluster-list", flag.ExitOnError)
format := args.String("format", "stdout", "format: [ stdout | json ]")
args.Parse(os.Args[2:])
err = scheduler_k3s.CommandClusterList(*format)
case "cluster-remove":
args := flag.NewFlagSet("scheduler-k3s:cluster-remove", flag.ExitOnError)
args.Parse(os.Args[2:])
nodeName := args.Arg(0)
err = scheduler_k3s.CommandClusterRemove(nodeName)
case "report":
args := flag.NewFlagSet("scheduler-k3s:report", flag.ExitOnError)
format := args.String("format", "stdout", "format: [ stdout | json ]")