1
0
mirror of https://github.com/rancher/os.git synced 2025-09-10 19:20:55 +00:00

Add operator

This commit is contained in:
Darren Shepherd
2021-10-20 10:58:54 -07:00
parent 0e46d19194
commit 5675644d9f
60 changed files with 5387 additions and 60 deletions

30
cmd/ros-operator/main.go Normal file
View File

@@ -0,0 +1,30 @@
package main
import (
"context"
"flag"
"os"
"github.com/rancher/os/pkg/operator"
"github.com/rancher/wrangler/pkg/signals"
"github.com/sirupsen/logrus"
)
var (
namespace = flag.String("namespace", "cattle-rancheros-operator-system", "Namespace of the pod")
)
func main() {
flag.Parse()
logrus.Info("Starting controller")
ctx := signals.SetupSignalHandler(context.Background())
if os.Getenv("NAMESPACE") != "" {
*namespace = os.Getenv("NAMESPACE")
}
if err := operator.Run(ctx, *namespace); err != nil {
logrus.Fatalf("Error starting: %s", err.Error())
}
<-ctx.Done()
}