diff --git a/internal/repository/iam/events_step.go b/internal/repository/iam/events_step.go index 07255a22a8..50e324e2e2 100644 --- a/internal/repository/iam/events_step.go +++ b/internal/repository/iam/events_step.go @@ -3,6 +3,7 @@ package iam import ( "context" "encoding/json" + "github.com/caos/zitadel/internal/eventstore" "github.com/caos/zitadel/internal/domain" @@ -34,6 +35,10 @@ func SetupStepMapper(event *repository.Event) (eventstore.EventReader, error) { step := &SetupStepEvent{ BaseEvent: *eventstore.BaseEventFromRepo(event), Done: eventstore.EventType(event.Type) == SetupDoneEventType, + Step: domain.Step1, + } + if len(event.Data) == 0 { + return step, nil } err := json.Unmarshal(event.Data, step) if err != nil { diff --git a/operator/zitadel/kinds/iam/zitadel/configuration/desired.go b/operator/zitadel/kinds/iam/zitadel/configuration/desired.go index 32ae456623..9fbd545342 100644 --- a/operator/zitadel/kinds/iam/zitadel/configuration/desired.go +++ b/operator/zitadel/kinds/iam/zitadel/configuration/desired.go @@ -3,15 +3,16 @@ package configuration import "github.com/caos/orbos/pkg/secret" type Configuration struct { - Tracing *Tracing `yaml:"tracing,omitempty"` - Cache *Cache `yaml:"cache,omitempty"` - Secrets *Secrets `yaml:"secrets,omitempty"` - Notifications *Notifications `yaml:"notifications,omitempty"` - Passwords *Passwords `yaml:"passwords,omitempty"` - DebugMode bool `yaml:"debugMode"` - LogLevel string `yaml:"logLevel"` - DNS *DNS `yaml:"dns"` - ClusterDNS string `yaml:"clusterdns"` + Tracing *Tracing `yaml:"tracing,omitempty"` + Cache *Cache `yaml:"cache,omitempty"` + Secrets *Secrets `yaml:"secrets,omitempty"` + Notifications *Notifications `yaml:"notifications,omitempty"` + Passwords *Passwords `yaml:"passwords,omitempty"` + DebugMode bool `yaml:"debugMode"` + LogLevel string `yaml:"logLevel"` + MigrateEventStoreV1 bool `yaml:"migrateEventstoreV1"` + DNS *DNS `yaml:"dns"` + ClusterDNS string `yaml:"clusterdns"` } type DNS struct { diff --git a/operator/zitadel/kinds/iam/zitadel/configuration/literals.go b/operator/zitadel/kinds/iam/zitadel/configuration/literals.go index ca552f45fd..10283c7e7d 100644 --- a/operator/zitadel/kinds/iam/zitadel/configuration/literals.go +++ b/operator/zitadel/kinds/iam/zitadel/configuration/literals.go @@ -2,10 +2,12 @@ package configuration import ( "encoding/json" - "github.com/caos/orbos/pkg/kubernetes" - "github.com/caos/zitadel/operator/zitadel/kinds/iam/zitadel/database" "strconv" "strings" + + "github.com/caos/orbos/pkg/kubernetes" + + "github.com/caos/zitadel/operator/zitadel/kinds/iam/zitadel/database" ) const ( @@ -31,6 +33,7 @@ func literalsConfigMap( "ZITADEL_KEY_PATH": secretPath + "/" + zitadelKeysPath, "ZITADEL_LOG_LEVEL": "info", "DEBUG_MODE": strconv.FormatBool(desired.DebugMode), + "ZITADEL_MIGRATE_ES_V1": strconv.FormatBool(desired.MigrateEventStoreV1), "SMTP_TLS": tls, "CAOS_OIDC_DEV": "true", "CR_SSL_MODE": "require", diff --git a/operator/zitadel/kinds/iam/zitadel/configuration/literals_test.go b/operator/zitadel/kinds/iam/zitadel/configuration/literals_test.go index 3c99b45f68..b709bf2984 100644 --- a/operator/zitadel/kinds/iam/zitadel/configuration/literals_test.go +++ b/operator/zitadel/kinds/iam/zitadel/configuration/literals_test.go @@ -1,14 +1,16 @@ package configuration import ( + "testing" + kubernetesmock "github.com/caos/orbos/pkg/kubernetes/mock" "github.com/caos/orbos/pkg/secret" - "github.com/caos/zitadel/operator/zitadel/kinds/iam/zitadel/database" "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "testing" + + "github.com/caos/zitadel/operator/zitadel/kinds/iam/zitadel/database" ) var ( @@ -191,6 +193,7 @@ func TestConfiguration_LiteralsConfigMap(t *testing.T) { "SMTP_HOST": "", "CAOS_OIDC_DEV": "true", "DEBUG_MODE": "false", + "ZITADEL_MIGRATE_ES_V1": "false", "CR_AUTH_CERT": "test/client.auth.crt", "ZITADEL_OIDC_KEYS_ID": "", "CR_MIGRATION_CERT": "test/client.migration.crt", @@ -267,6 +270,7 @@ func TestConfiguration_LiteralsConfigMapFull(t *testing.T) { "ZITADEL_ISSUER": "https://issuer.domain", "ZITADEL_KEY_PATH": "test/test", "ZITADEL_LOG_LEVEL": "debug", + "ZITADEL_MIGRATE_ES_V1": "false", "ZITADEL_OAUTH": "https://api.domain/oauth/v2", "ZITADEL_OIDC_KEYS_ID": "oidcid", "ZITADEL_OTP_VERIFICATION_KEY": "otpid",