-
Notifications
You must be signed in to change notification settings - Fork 395
/
main.go
41 lines (34 loc) · 958 Bytes
/
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
34
35
36
37
38
39
40
41
package main
import (
"flag"
"github.com/golang/glog"
"github.com/spf13/cobra"
)
const (
componentName = "machine-config-server"
)
var (
rootCmd = &cobra.Command{
Use: componentName,
Short: "Run Machine Config Server",
Long: "",
}
rootOpts struct {
sport int
isport int
cert string
key string
}
)
func init() {
rootCmd.PersistentFlags().AddGoFlagSet(flag.CommandLine)
rootCmd.PersistentFlags().IntVar(&rootOpts.sport, "secure-port", 22623, "secure port to serve ignition configs")
rootCmd.PersistentFlags().StringVar(&rootOpts.cert, "cert", "/etc/ssl/mcs/tls.crt", "cert file for TLS")
rootCmd.PersistentFlags().StringVar(&rootOpts.key, "key", "/etc/ssl/mcs/tls.key", "key file for TLS")
rootCmd.PersistentFlags().IntVar(&rootOpts.isport, "insecure-port", 22624, "insecure port to serve ignition configs")
}
func main() {
if err := rootCmd.Execute(); err != nil {
glog.Exitf("Error executing MCS: %v", err)
}
}