1
0
mirror of https://github.com/rancher/steve.git synced 2025-09-01 07:27:46 +00:00

Initial commit

This commit is contained in:
Darren Shepherd
2019-08-04 10:41:32 -07:00
commit c0299c1506
2045 changed files with 724722 additions and 0 deletions

51
main.go Normal file
View File

@@ -0,0 +1,51 @@
package main
import (
"context"
"os"
"github.com/rancher/naok/pkg/server"
"github.com/rancher/naok/pkg/version"
"github.com/rancher/wrangler/pkg/signals"
"github.com/sirupsen/logrus"
"github.com/urfave/cli"
)
var (
config server.Config
)
func main() {
app := cli.NewApp()
app.Name = "naok"
app.Version = version.FriendlyVersion()
app.Usage = ""
app.Flags = []cli.Flag{
cli.StringFlag{
Name: "kubeconfig",
EnvVar: "KUBECONFIG",
Value: "",
Destination: &config.Kubeconfig,
},
cli.StringFlag{
Name: "namespace",
EnvVar: "NAMESPACE",
Value: "default",
Destination: &config.Namespace,
},
cli.BoolFlag{Name: "debug"},
}
app.Action = run
if err := app.Run(os.Args); err != nil {
logrus.Fatal(err)
}
}
func run(c *cli.Context) error {
if c.Bool("debug") {
logrus.SetLevel(logrus.DebugLevel)
}
ctx := signals.SetupSignalHandler(context.Background())
return server.Run(ctx, config)
}