mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-14 12:41:16 +00:00
fix: operator reconciling (#1478)
* fix(operator): align backup and restore commands (#1465) * fix: crd mode broke backup and restore commands * fix: remove obscure gitops-per-operator flags (cherry picked from commit041cacc4af
) * fix: gitops backup and restore need a kubernetes client too (#1475) (cherry picked from commit50bc317d27
) Co-authored-by: Elio Bischof <eliobischof@gmail.com>
This commit is contained in:
@@ -99,7 +99,7 @@ func AdaptFunc(timestamp string, binaryVersion *string, gitops bool, features ..
|
||||
case "operator":
|
||||
queriers = append(queriers,
|
||||
operator.ResourceQueryToZitadelQuery(queryNS),
|
||||
operator.EnsureFuncToQueryFunc(Reconcile(monitor, desiredKind.Spec)),
|
||||
operator.EnsureFuncToQueryFunc(Reconcile(monitor, desiredKind.Spec, gitops)),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@@ -19,7 +19,6 @@ type Spec struct {
|
||||
Tolerations []corev1.Toleration `json:"tolerations,omitempty" yaml:"tolerations,omitempty"`
|
||||
Version string `json:"version,omitempty" yaml:"version,omitempty"`
|
||||
SelfReconciling bool `json:"selfReconciling" yaml:"selfReconciling"`
|
||||
GitOps bool `json:"gitOps,omitempty" yaml:"gitOps,omitempty"`
|
||||
//Use this registry to pull the Database operator image from
|
||||
//@default: ghcr.io
|
||||
CustomImageRegistry string `json:"customImageRegistry,omitempty" yaml:"customImageRegistry,omitempty"`
|
||||
|
@@ -13,6 +13,7 @@ import (
|
||||
func Reconcile(
|
||||
monitor mntr.Monitor,
|
||||
spec *Spec,
|
||||
gitops bool,
|
||||
) operator.EnsureFunc {
|
||||
return func(k8sClient kubernetes.ClientInt) (err error) {
|
||||
recMonitor := monitor.WithField("version", spec.Version)
|
||||
@@ -36,7 +37,7 @@ func Reconcile(
|
||||
},
|
||||
}
|
||||
|
||||
if err := zitadelKubernetes.EnsureDatabaseArtifacts(monitor, treelabels.MustForAPI(desiredTree, mustDatabaseOperator(&spec.Version)), k8sClient, spec.Version, spec.NodeSelector, spec.Tolerations, imageRegistry, spec.GitOps); err != nil {
|
||||
if err := zitadelKubernetes.EnsureDatabaseArtifacts(monitor, treelabels.MustForAPI(desiredTree, mustDatabaseOperator(&spec.Version)), k8sClient, spec.Version, spec.NodeSelector, spec.Tolerations, imageRegistry, gitops); err != nil {
|
||||
recMonitor.Error(errors.Wrap(err, "Failed to deploy database-operator into k8s-cluster"))
|
||||
return err
|
||||
}
|
||||
|
@@ -112,7 +112,7 @@ func AdaptFunc(
|
||||
case "operator":
|
||||
queriers = append(queriers,
|
||||
operator.ResourceQueryToZitadelQuery(queryNS),
|
||||
operator.EnsureFuncToQueryFunc(Reconcile(monitor, desiredKind.Spec)),
|
||||
operator.EnsureFuncToQueryFunc(Reconcile(monitor, desiredKind.Spec, gitops)),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@@ -19,7 +19,6 @@ type Spec struct {
|
||||
Tolerations []corev1.Toleration `json:"tolerations,omitempty" yaml:"tolerations,omitempty"`
|
||||
Version string `json:"version,omitempty" yaml:"version,omitempty"`
|
||||
SelfReconciling bool `json:"selfReconciling" yaml:"selfReconciling"`
|
||||
GitOps bool `json:"gitops,omitempty" yaml:"gitops,omitempty"`
|
||||
//Use this registry to pull the zitadel operator image from
|
||||
//@default: ghcr.io
|
||||
CustomImageRegistry string `json:"customImageRegistry,omitempty" yaml:"customImageRegistry,omitempty"`
|
||||
|
@@ -13,6 +13,7 @@ import (
|
||||
func Reconcile(
|
||||
monitor mntr.Monitor,
|
||||
spec *Spec,
|
||||
gitops bool,
|
||||
) operator.EnsureFunc {
|
||||
return func(k8sClient kubernetes2.ClientInt) (err error) {
|
||||
recMonitor := monitor.WithField("version", spec.Version)
|
||||
@@ -36,7 +37,7 @@ func Reconcile(
|
||||
},
|
||||
}
|
||||
|
||||
if err := kubernetes.EnsureZitadelOperatorArtifacts(monitor, treelabels.MustForAPI(desiredTree, mustZITADELOperator(&spec.Version)), k8sClient, spec.Version, spec.NodeSelector, spec.Tolerations, imageRegistry, spec.GitOps); err != nil {
|
||||
if err := kubernetes.EnsureZitadelOperatorArtifacts(monitor, treelabels.MustForAPI(desiredTree, mustZITADELOperator(&spec.Version)), k8sClient, spec.Version, spec.NodeSelector, spec.Tolerations, imageRegistry, gitops); err != nil {
|
||||
recMonitor.Error(errors.Wrap(err, "Failed to deploy zitadel-operator into k8s-cluster"))
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user