mirror of
https://github.com/zitadel/zitadel.git
synced 2025-01-09 07:13:40 +00:00
51 lines
984 B
Go
51 lines
984 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"flag"
|
||
|
"io/ioutil"
|
||
|
|
||
|
"github.com/caos/orbos/pkg/kubernetes"
|
||
|
|
||
|
"github.com/caos/zitadel/operator/start"
|
||
|
|
||
|
"github.com/caos/orbos/mntr"
|
||
|
"github.com/caos/zitadel/operator/helpers"
|
||
|
)
|
||
|
|
||
|
func main() {
|
||
|
|
||
|
orbconfig := flag.String("orbconfig", "~/.orb/config", "The orbconfig file to use")
|
||
|
kubeconfig := flag.String("kubeconfig", "~/.kube/config", "The kubeconfig file to use")
|
||
|
verbose := flag.Bool("verbose", false, "Print debug levelled logs")
|
||
|
|
||
|
flag.Parse()
|
||
|
|
||
|
monitor := mntr.Monitor{
|
||
|
OnInfo: mntr.LogMessage,
|
||
|
OnChange: mntr.LogMessage,
|
||
|
OnError: mntr.LogError,
|
||
|
}
|
||
|
|
||
|
if *verbose {
|
||
|
monitor = monitor.Verbose()
|
||
|
}
|
||
|
|
||
|
kc, err := ioutil.ReadFile(helpers.PruneHome(*kubeconfig))
|
||
|
if err != nil {
|
||
|
panic(err)
|
||
|
}
|
||
|
|
||
|
if err := start.Database(
|
||
|
monitor,
|
||
|
helpers.PruneHome(*orbconfig),
|
||
|
kubernetes.NewK8sClient(monitor, strPtr(string(kc))),
|
||
|
strPtr("database-development"),
|
||
|
); err != nil {
|
||
|
panic(err)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func strPtr(str string) *string {
|
||
|
return &str
|
||
|
}
|