package database import ( "github.com/caos/orbos/mntr" "github.com/caos/orbos/pkg/git" "github.com/caos/orbos/pkg/kubernetes" "github.com/caos/orbos/pkg/tree" "github.com/caos/zitadel/operator" ) func Takeoff(monitor mntr.Monitor, gitClient *git.Client, adapt operator.AdaptFunc, k8sClient *kubernetes.Client) func() { return func() { internalMonitor := monitor.WithField("operator", "database") internalMonitor.Info("Takeoff") treeDesired, err := operator.Parse(gitClient, "database.yml") if err != nil { monitor.Error(err) return } treeCurrent := &tree.Tree{} query, _, _, _, _, _, err := adapt(internalMonitor, treeDesired, treeCurrent) if err != nil { internalMonitor.Error(err) return } ensure, err := query(k8sClient, map[string]interface{}{}) if err != nil { internalMonitor.Error(err) return } if err := ensure(k8sClient); err != nil { internalMonitor.Error(err) return } } }