mirror of
https://github.com/andwati/zitadel.git
synced 2026-12-01 08:28:51 +00:00
feat: enable running ZITADEL offline (#1894)
* feat: enable running ZITADEL offline * refactor: move operator image to common images * test: remove empty test
This commit is contained in:
@@ -27,6 +27,7 @@ func Adapt(
|
||||
action string,
|
||||
version *string,
|
||||
features []string,
|
||||
customImageRegistry string,
|
||||
) (
|
||||
query operator.QueryFunc,
|
||||
destroy operator.DestroyFunc,
|
||||
@@ -46,7 +47,17 @@ func Adapt(
|
||||
switch desiredTree.Common.Kind {
|
||||
case "zitadel.caos.ch/ZITADEL":
|
||||
apiLabels := labels.MustForAPI(operatorLabels, "ZITADEL", desiredTree.Common.Version)
|
||||
return zitadel.AdaptFunc(apiLabels, nodeselector, tolerations, dbClient, namespace, action, version, features)(monitor, desiredTree, currentTree)
|
||||
return zitadel.AdaptFunc(
|
||||
apiLabels,
|
||||
nodeselector,
|
||||
tolerations,
|
||||
dbClient,
|
||||
namespace,
|
||||
action,
|
||||
version,
|
||||
features,
|
||||
customImageRegistry,
|
||||
)(monitor, desiredTree, currentTree)
|
||||
default:
|
||||
return nil, nil, nil, nil, nil, false, errors.Errorf("unknown iam kind %s", desiredTree.Common.Kind)
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ func AdaptFunc(
|
||||
action string,
|
||||
version *string,
|
||||
features []string,
|
||||
customImageRegistry string,
|
||||
) operator.AdaptFunc {
|
||||
return func(
|
||||
monitor mntr.Monitor,
|
||||
@@ -141,6 +142,7 @@ func AdaptFunc(
|
||||
usersWithoutPWs,
|
||||
nodeselector,
|
||||
tolerations,
|
||||
customImageRegistry,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, nil, nil, nil, nil, false, err
|
||||
@@ -162,6 +164,7 @@ func AdaptFunc(
|
||||
consoleCMName,
|
||||
secretVarsName,
|
||||
secretPasswordName,
|
||||
customImageRegistry,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, nil, nil, nil, nil, false, err
|
||||
@@ -189,6 +192,7 @@ func AdaptFunc(
|
||||
migration.GetDoneFunc(monitor, namespace, action),
|
||||
configuration.GetReadyFunc(monitor, namespace, secretName, secretVarsName, secretPasswordName, cmName, consoleCMName),
|
||||
setup.GetDoneFunc(monitor, namespace, action),
|
||||
customImageRegistry,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, nil, nil, nil, nil, false, err
|
||||
|
||||
@@ -21,8 +21,7 @@ const (
|
||||
containerName = "zitadel"
|
||||
RunAsUser = int64(1000)
|
||||
//zitadelImage can be found in github.com/caos/zitadel repo
|
||||
zitadelImage = "ghcr.io/caos/zitadel"
|
||||
timeout = 60 * time.Second
|
||||
timeout = 60 * time.Second
|
||||
)
|
||||
|
||||
func AdaptFunc(
|
||||
@@ -47,6 +46,7 @@ func AdaptFunc(
|
||||
migrationDone operator.EnsureFunc,
|
||||
configurationDone operator.EnsureFunc,
|
||||
setupDone operator.EnsureFunc,
|
||||
customImageRegistry string,
|
||||
) (
|
||||
func(
|
||||
necessaryUsers map[string]string,
|
||||
@@ -93,6 +93,7 @@ func AdaptFunc(
|
||||
consoleCMName,
|
||||
secretVarsName,
|
||||
secretPasswordsName,
|
||||
customImageRegistry,
|
||||
)
|
||||
|
||||
hashes, err := getConfigurationHashes(k8sClient, queried, necessaryUsers)
|
||||
@@ -126,7 +127,26 @@ func AdaptFunc(
|
||||
|
||||
}
|
||||
|
||||
func deploymentDef(nameLabels *labels.Name, namespace string, replicaCount int, podSelector *labels.Selector, nodeSelector map[string]string, tolerations []corev1.Toleration, affinity *k8s.Affinity, users []string, version *string, resources *k8s.Resources, cmName string, certPath string, secretName string, secretPath string, consoleCMName string, secretVarsName string, secretPasswordsName string) *appsv1.Deployment {
|
||||
func deploymentDef(
|
||||
nameLabels *labels.Name,
|
||||
namespace string,
|
||||
replicaCount int,
|
||||
podSelector *labels.Selector,
|
||||
nodeSelector map[string]string,
|
||||
tolerations []corev1.Toleration,
|
||||
affinity *k8s.Affinity,
|
||||
users []string,
|
||||
version *string,
|
||||
resources *k8s.Resources,
|
||||
cmName string,
|
||||
certPath string,
|
||||
secretName string,
|
||||
secretPath string,
|
||||
consoleCMName string,
|
||||
secretVarsName string,
|
||||
secretPasswordsName string,
|
||||
customImageRegistry string,
|
||||
) *appsv1.Deployment {
|
||||
deploymentDef := &appsv1.Deployment{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: nameLabels.Name(),
|
||||
@@ -161,6 +181,7 @@ func deploymentDef(nameLabels *labels.Name, namespace string, replicaCount int,
|
||||
dbSecrets,
|
||||
users,
|
||||
RunAsUser,
|
||||
customImageRegistry,
|
||||
),
|
||||
},
|
||||
Containers: []corev1.Container{
|
||||
@@ -180,6 +201,7 @@ func deploymentDef(nameLabels *labels.Name, namespace string, replicaCount int,
|
||||
users,
|
||||
dbSecrets,
|
||||
"start",
|
||||
customImageRegistry,
|
||||
),
|
||||
},
|
||||
Volumes: GetVolumes(
|
||||
|
||||
@@ -32,6 +32,8 @@ func TestDeployment_Adapt(t *testing.T) {
|
||||
secretName := "testSecret"
|
||||
consoleCMName := "testConsoleCM"
|
||||
cmName := "testCM"
|
||||
customImageRegistry := ""
|
||||
|
||||
usersMap := map[string]string{"test": "test"}
|
||||
users := []string{}
|
||||
for _, user := range usersMap {
|
||||
@@ -86,6 +88,7 @@ func TestDeployment_Adapt(t *testing.T) {
|
||||
dbSecrets,
|
||||
users,
|
||||
RunAsUser,
|
||||
customImageRegistry,
|
||||
),
|
||||
},
|
||||
Containers: []corev1.Container{
|
||||
@@ -105,6 +108,7 @@ func TestDeployment_Adapt(t *testing.T) {
|
||||
users,
|
||||
dbSecrets,
|
||||
"start",
|
||||
customImageRegistry,
|
||||
),
|
||||
},
|
||||
Volumes: GetVolumes(
|
||||
@@ -154,6 +158,7 @@ func TestDeployment_Adapt(t *testing.T) {
|
||||
migrationDone,
|
||||
configurationDone,
|
||||
setupDone,
|
||||
customImageRegistry,
|
||||
)
|
||||
assert.NoError(t, err)
|
||||
queried := map[string]interface{}{}
|
||||
|
||||
@@ -4,6 +4,8 @@ import (
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"github.com/caos/zitadel/operator/common"
|
||||
|
||||
"github.com/caos/orbos/pkg/kubernetes/k8s"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
"k8s.io/apimachinery/pkg/util/intstr"
|
||||
@@ -25,6 +27,7 @@ func GetContainer(
|
||||
users []string,
|
||||
dbSecrets string,
|
||||
command string,
|
||||
customImageRegistry string,
|
||||
) corev1.Container {
|
||||
|
||||
envVars := []corev1.EnvVar{
|
||||
@@ -107,7 +110,7 @@ func GetContainer(
|
||||
RunAsNonRoot: &runAsNonRoot,
|
||||
},
|
||||
Name: containerName,
|
||||
Image: zitadelImage + ":" + version,
|
||||
Image: common.ZITADELImage.Reference(customImageRegistry, version),
|
||||
ImagePullPolicy: corev1.PullIfNotPresent,
|
||||
Ports: []corev1.ContainerPort{
|
||||
{Name: "grpc", ContainerPort: 50001},
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
package deployment
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/caos/zitadel/operator/common"
|
||||
|
||||
"github.com/caos/orbos/pkg/kubernetes/k8s"
|
||||
"github.com/caos/zitadel/operator/helpers"
|
||||
"github.com/stretchr/testify/assert"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
"k8s.io/apimachinery/pkg/api/resource"
|
||||
"k8s.io/apimachinery/pkg/util/intstr"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestDeployment_GetContainer(t *testing.T) {
|
||||
@@ -108,7 +112,7 @@ func TestDeployment_GetContainer(t *testing.T) {
|
||||
RunAsNonRoot: helpers.PointerBool(true),
|
||||
},
|
||||
Name: containerName,
|
||||
Image: zitadelImage + ":" + version,
|
||||
Image: fmt.Sprintf("ghcr.io/%s:%s", common.ZITADELImage, version),
|
||||
ImagePullPolicy: corev1.PullIfNotPresent,
|
||||
Ports: []corev1.ContainerPort{
|
||||
{Name: "grpc", ContainerPort: 50001},
|
||||
@@ -164,6 +168,7 @@ func TestDeployment_GetContainer(t *testing.T) {
|
||||
users,
|
||||
dbSecrets,
|
||||
"start",
|
||||
"",
|
||||
)
|
||||
|
||||
assert.Equal(t, equals, container)
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
package deployment
|
||||
|
||||
import (
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/caos/zitadel/operator/common"
|
||||
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -17,6 +20,7 @@ func GetInitContainer(
|
||||
dbSecrets string,
|
||||
users []string,
|
||||
runAsUser int64,
|
||||
customImageRegistry string,
|
||||
) corev1.Container {
|
||||
|
||||
initVolumeMounts := []corev1.VolumeMount{
|
||||
@@ -47,7 +51,7 @@ func GetInitContainer(
|
||||
|
||||
return corev1.Container{
|
||||
Name: "fix-permissions",
|
||||
Image: "alpine:3.11",
|
||||
Image: common.AlpineImage.Reference(customImageRegistry),
|
||||
Command: []string{"/bin/sh", "-c"},
|
||||
Args: []string{strings.Join(initCommands, " && ")},
|
||||
VolumeMounts: initVolumeMounts,
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package deployment
|
||||
|
||||
import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
)
|
||||
|
||||
func TestDeployment_GetInitContainer(t *testing.T) {
|
||||
@@ -35,7 +36,7 @@ func TestDeployment_GetInitContainer(t *testing.T) {
|
||||
TerminationMessagePath: "/dev/termination-log",
|
||||
}
|
||||
|
||||
init := GetInitContainer(rootSecret, dbSecrets, users, RunAsUser)
|
||||
init := GetInitContainer(rootSecret, dbSecrets, users, RunAsUser, "")
|
||||
|
||||
assert.Equal(t, equals, init)
|
||||
}
|
||||
@@ -68,7 +69,7 @@ func TestDeployment_GetInitContainer1(t *testing.T) {
|
||||
ImagePullPolicy: corev1.PullIfNotPresent,
|
||||
}
|
||||
|
||||
init := GetInitContainer(rootSecret, dbSecrets, users, RunAsUser)
|
||||
init := GetInitContainer(rootSecret, dbSecrets, users, RunAsUser, "")
|
||||
|
||||
assert.Equal(t, equals, init)
|
||||
}
|
||||
@@ -104,7 +105,7 @@ func TestDeployment_GetInitContainer2(t *testing.T) {
|
||||
TerminationMessagePath: "/dev/termination-log",
|
||||
}
|
||||
|
||||
init := GetInitContainer(rootSecret, dbSecrets, users, RunAsUser)
|
||||
init := GetInitContainer(rootSecret, dbSecrets, users, RunAsUser, "")
|
||||
|
||||
assert.Equal(t, equals, init)
|
||||
}
|
||||
|
||||
@@ -4,13 +4,14 @@ import (
|
||||
"crypto/sha512"
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/rakyll/statik/fs"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"sort"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/rakyll/statik/fs"
|
||||
|
||||
"github.com/caos/orbos/mntr"
|
||||
"github.com/caos/orbos/pkg/kubernetes"
|
||||
"github.com/caos/orbos/pkg/kubernetes/resources/configmap"
|
||||
@@ -49,6 +50,7 @@ func AdaptFunc(
|
||||
users []string,
|
||||
nodeselector map[string]string,
|
||||
tolerations []corev1.Toleration,
|
||||
customImageRegistry string,
|
||||
) (
|
||||
operator.QueryFunc,
|
||||
operator.DestroyFunc,
|
||||
@@ -103,9 +105,9 @@ func AdaptFunc(
|
||||
Spec: corev1.PodSpec{
|
||||
NodeSelector: nodeselector,
|
||||
Tolerations: tolerations,
|
||||
InitContainers: getPreContainer(dbHost, dbPort, migrationUser, secretPasswordName),
|
||||
InitContainers: getPreContainer(dbHost, dbPort, migrationUser, secretPasswordName, customImageRegistry),
|
||||
Containers: []corev1.Container{
|
||||
getMigrationContainer(dbHost, dbPort, migrationUser, secretPasswordName, users),
|
||||
getMigrationContainer(dbHost, dbPort, migrationUser, secretPasswordName, users, customImageRegistry),
|
||||
},
|
||||
RestartPolicy: "Never",
|
||||
DNSPolicy: "ClusterFirst",
|
||||
|
||||
@@ -99,9 +99,9 @@ func TestMigration_AdaptFunc(t *testing.T) {
|
||||
Spec: corev1.PodSpec{
|
||||
NodeSelector: nodeselector,
|
||||
Tolerations: tolerations,
|
||||
InitContainers: getPreContainer(dbHost, dbPort, migrationUser, secretPasswordName),
|
||||
InitContainers: getPreContainer(dbHost, dbPort, migrationUser, secretPasswordName, ""),
|
||||
Containers: []corev1.Container{
|
||||
getMigrationContainer(dbHost, dbPort, migrationUser, secretPasswordName, users),
|
||||
getMigrationContainer(dbHost, dbPort, migrationUser, secretPasswordName, users, ""),
|
||||
},
|
||||
RestartPolicy: "Never",
|
||||
DNSPolicy: "ClusterFirst",
|
||||
@@ -163,6 +163,7 @@ func TestMigration_AdaptFunc(t *testing.T) {
|
||||
users,
|
||||
nodeselector,
|
||||
tolerations,
|
||||
"",
|
||||
)
|
||||
|
||||
queried := map[string]interface{}{}
|
||||
|
||||
@@ -3,6 +3,8 @@ package migration
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/caos/zitadel/operator/common"
|
||||
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
)
|
||||
|
||||
@@ -12,10 +14,12 @@ func getMigrationContainer(
|
||||
migrationUser string,
|
||||
secretPasswordName string,
|
||||
users []string,
|
||||
customImageRegistry string,
|
||||
) corev1.Container {
|
||||
|
||||
return corev1.Container{
|
||||
Name: "db-migration",
|
||||
Image: "flyway/flyway:7.5.1",
|
||||
Image: common.FlywayImage.Reference(customImageRegistry),
|
||||
Args: []string{
|
||||
"-url=jdbc:postgresql://" + dbHost + ":" + dbPort + "/defaultdb?&sslmode=verify-full&ssl=true&sslrootcert=" + rootUserPath + "/ca.crt&sslfactory=org.postgresql.ssl.NonValidatingFactory",
|
||||
"-locations=filesystem:" + migrationsPath,
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package migration
|
||||
|
||||
import (
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
"strings"
|
||||
|
||||
"github.com/caos/zitadel/operator/common"
|
||||
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
)
|
||||
|
||||
func getPostContainers(
|
||||
@@ -10,11 +13,13 @@ func getPostContainers(
|
||||
dbPort string,
|
||||
migrationUser string,
|
||||
secretPasswordName string,
|
||||
customImageRegistry string,
|
||||
) []corev1.Container {
|
||||
|
||||
return []corev1.Container{
|
||||
{
|
||||
Name: "delete-flyway-user",
|
||||
Image: "cockroachdb/cockroach:v20.2.3",
|
||||
Image: common.CockroachImage.Reference(customImageRegistry),
|
||||
Command: []string{"/bin/bash", "-c", "--"},
|
||||
Args: []string{
|
||||
strings.Join([]string{
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package migration
|
||||
|
||||
import (
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
"strings"
|
||||
|
||||
"github.com/caos/zitadel/operator/common"
|
||||
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
)
|
||||
|
||||
func getPreContainer(
|
||||
@@ -10,11 +13,13 @@ func getPreContainer(
|
||||
dbPort string,
|
||||
migrationUser string,
|
||||
secretPasswordName string,
|
||||
customImageRegistry string,
|
||||
) []corev1.Container {
|
||||
|
||||
return []corev1.Container{
|
||||
{
|
||||
Name: "check-db-ready",
|
||||
Image: "postgres:9.6.17",
|
||||
Image: common.PostgresImage.Reference(customImageRegistry),
|
||||
Command: []string{
|
||||
"sh",
|
||||
"-c",
|
||||
@@ -26,7 +31,7 @@ func getPreContainer(
|
||||
},
|
||||
{
|
||||
Name: "create-flyway-user",
|
||||
Image: "cockroachdb/cockroach:v20.2.3",
|
||||
Image: common.CockroachImage.Reference(customImageRegistry),
|
||||
Env: baseEnvVars(envMigrationUser, envMigrationPW, migrationUser, secretPasswordName),
|
||||
VolumeMounts: []corev1.VolumeMount{{
|
||||
Name: rootUserInternal,
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
package migration
|
||||
|
||||
import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestMigration_CreateUserCommand(t *testing.T) {
|
||||
|
||||
@@ -37,6 +37,7 @@ func AdaptFunc(
|
||||
consoleCMName string,
|
||||
secretVarsName string,
|
||||
secretPasswordsName string,
|
||||
customImageRegistry string,
|
||||
) (
|
||||
func(
|
||||
necessaryUsers map[string]string,
|
||||
@@ -82,9 +83,9 @@ func AdaptFunc(
|
||||
secretVarsName,
|
||||
secretPasswordsName,
|
||||
namespace,
|
||||
componentLabels,
|
||||
nodeselector,
|
||||
tolerations,
|
||||
customImageRegistry,
|
||||
)
|
||||
|
||||
hashes, err := getConfigurationHashes(k8sClient, queried, necessaryUsers)
|
||||
@@ -115,13 +116,30 @@ func AdaptFunc(
|
||||
|
||||
}
|
||||
|
||||
func jobDef(name *labels.Name, users []string, version *string, resources *k8s.Resources, cmName string, certPath string, secretName string, secretPath string, consoleCMName string, secretVarsName string, secretPasswordsName string, namespace string, componentLabels *labels.Component, nodeselector map[string]string, tolerations []corev1.Toleration) *batchv1.Job {
|
||||
func jobDef(
|
||||
name *labels.Name,
|
||||
users []string,
|
||||
version *string,
|
||||
resources *k8s.Resources,
|
||||
cmName string,
|
||||
certPath string,
|
||||
secretName string,
|
||||
secretPath string,
|
||||
consoleCMName string,
|
||||
secretVarsName string,
|
||||
secretPasswordsName string,
|
||||
namespace string,
|
||||
nodeselector map[string]string,
|
||||
tolerations []corev1.Toleration,
|
||||
customImageRegistry string,
|
||||
) *batchv1.Job {
|
||||
initContainers := []corev1.Container{
|
||||
deployment.GetInitContainer(
|
||||
rootSecret,
|
||||
dbSecrets,
|
||||
users,
|
||||
deployment.RunAsUser,
|
||||
customImageRegistry,
|
||||
)}
|
||||
|
||||
containers := []corev1.Container{
|
||||
@@ -141,6 +159,7 @@ func jobDef(name *labels.Name, users []string, version *string, resources *k8s.R
|
||||
users,
|
||||
dbSecrets,
|
||||
"setup",
|
||||
customImageRegistry,
|
||||
)}
|
||||
|
||||
volumes := deployment.GetVolumes(secretName, secretPasswordsName, consoleCMName, users)
|
||||
|
||||
@@ -60,7 +60,7 @@ func TestSetup_AdaptFunc(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
initContainers := []corev1.Container{deployment.GetInitContainer(rootSecret, dbSecrets, users, deployment.RunAsUser)}
|
||||
initContainers := []corev1.Container{deployment.GetInitContainer(rootSecret, dbSecrets, users, deployment.RunAsUser, "")}
|
||||
containers := []corev1.Container{deployment.GetContainer(
|
||||
containerName,
|
||||
version,
|
||||
@@ -77,6 +77,7 @@ func TestSetup_AdaptFunc(t *testing.T) {
|
||||
users,
|
||||
dbSecrets,
|
||||
"setup",
|
||||
"",
|
||||
)}
|
||||
volumes := deployment.GetVolumes(secretName, secretPasswordsName, consoleCMName, users)
|
||||
|
||||
@@ -133,6 +134,7 @@ func TestSetup_AdaptFunc(t *testing.T) {
|
||||
consoleCMName,
|
||||
secretVarsName,
|
||||
secretPasswordsName,
|
||||
"",
|
||||
)
|
||||
|
||||
queried := map[string]interface{}{}
|
||||
|
||||
@@ -93,6 +93,7 @@ func AdaptFunc(
|
||||
action,
|
||||
&desiredKind.Spec.Version,
|
||||
features,
|
||||
desiredKind.Spec.CustomImageRegistry,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, nil, nil, nil, nil, false, err
|
||||
|
||||
@@ -19,8 +19,8 @@ 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"`
|
||||
//Use this registry to pull the zitadel operator image from
|
||||
//@default: ghcr.io
|
||||
//Use this registry to pull container images from
|
||||
//@default: <multiple public registries>
|
||||
CustomImageRegistry string `json:"customImageRegistry,omitempty" yaml:"customImageRegistry,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
@@ -24,11 +24,6 @@ func Reconcile(
|
||||
return err
|
||||
}
|
||||
|
||||
imageRegistry := spec.CustomImageRegistry
|
||||
if imageRegistry == "" {
|
||||
imageRegistry = "ghcr.io"
|
||||
}
|
||||
|
||||
if spec.SelfReconciling {
|
||||
desiredTree := &tree.Tree{
|
||||
Common: &tree.Common{
|
||||
@@ -37,7 +32,7 @@ func Reconcile(
|
||||
},
|
||||
}
|
||||
|
||||
if err := kubernetes.EnsureZitadelOperatorArtifacts(monitor, treelabels.MustForAPI(desiredTree, mustZITADELOperator(&spec.Version)), k8sClient, spec.Version, spec.NodeSelector, spec.Tolerations, imageRegistry, gitops); err != nil {
|
||||
if err := kubernetes.EnsureZitadelOperatorArtifacts(monitor, treelabels.MustForAPI(desiredTree, mustZITADELOperator(&spec.Version)), k8sClient, spec.Version, spec.NodeSelector, spec.Tolerations, spec.CustomImageRegistry, 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