-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
33 lines (29 loc) · 1.06 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package main
import (
"github.com/duncanpierce/hetzanetes/cmd"
"github.com/duncanpierce/hetzanetes/label"
"github.com/spf13/cobra"
"os"
)
func main() {
var defaultCmd = &cobra.Command{
Use: label.AppName,
Run: func(cmd *cobra.Command, args []string) {
_ = cmd.Help()
},
}
// TODO work out how to read cluster name from command line without using a --flag
// TODO need to be able to pass a --context arg
defaultCmd.AddCommand(
cmd.List(),
cmd.Create(),
cmd.Delete(),
cmd.Internal(),
)
// TODO it would be nice to add hetzner CLI's 'context' command here, since we share the context, but it's package-private
// TODO implement "repair" which scans the cluster and recreates resources that are missing, according to the cluster manifest - this would be run as a cronjob in the cluster
// should probably kick unlabelled servers off the private network, update SSH keys on all servers to latest matching, provision any servers that are missing, update incorrect server and network labels
if err := defaultCmd.Execute(); err != nil {
os.Exit(1)
}
}