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
2024-01-21 23:48:38 -05:00
parent d494e01c7b
commit 0730647af7
6 changed files with 229 additions and 8 deletions

View File

@@ -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 ]")