From e8e8015aa5dca99c1d46ac0da13846ae144e3260 Mon Sep 17 00:00:00 2001 From: Fabi <38692350+fgerschwiler@users.noreply.github.com> Date: Tue, 30 Mar 2021 10:59:16 +0200 Subject: [PATCH] fix: log setup step (#1495) * fix: log setup step * fix: unique constraint setup step --- internal/command/setup.go | 1 + internal/command/unique_constraints_model.go | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/internal/command/setup.go b/internal/command/setup.go index 484277353d..7c829d672c 100644 --- a/internal/command/setup.go +++ b/internal/command/setup.go @@ -56,6 +56,7 @@ func setSetUpContextData(ctx context.Context) context.Context { } func (c *Commands) StartSetup(ctx context.Context, step domain.Step) (*domain.IAM, error) { + logging.Log("COMMA-3M9fs").Infof("start setup step %v", step) iamWriteModel, err := c.getIAMWriteModel(ctx) if err != nil && !caos_errs.IsNotFound(err) { return nil, err diff --git a/internal/command/unique_constraints_model.go b/internal/command/unique_constraints_model.go index 4995bdbf42..8fffde15fe 100644 --- a/internal/command/unique_constraints_model.go +++ b/internal/command/unique_constraints_model.go @@ -52,12 +52,18 @@ func (rm *UniqueConstraintReadModel) Reduce() error { case *iam.IDPConfigAddedEvent: rm.addUniqueConstraint(e.Aggregate().ID, e.ConfigID, idpconfig.NewAddIDPConfigNameUniqueConstraint(e.Name, e.Aggregate().ResourceOwner)) case *iam.IDPConfigChangedEvent: + if e.Name != nil { + continue + } rm.changeUniqueConstraint(e.Aggregate().ID, e.ConfigID, idpconfig.NewAddIDPConfigNameUniqueConstraint(*e.Name, e.Aggregate().ResourceOwner)) case *iam.IDPConfigRemovedEvent: rm.removeUniqueConstraint(e.Aggregate().ID, e.ConfigID, idpconfig.UniqueIDPConfigNameType) case *org.IDPConfigAddedEvent: rm.addUniqueConstraint(e.Aggregate().ID, e.ConfigID, idpconfig.NewAddIDPConfigNameUniqueConstraint(e.Name, e.Aggregate().ResourceOwner)) case *org.IDPConfigChangedEvent: + if e.Name != nil { + continue + } rm.changeUniqueConstraint(e.Aggregate().ID, e.ConfigID, idpconfig.NewAddIDPConfigNameUniqueConstraint(*e.Name, e.Aggregate().ResourceOwner)) case *org.IDPConfigRemovedEvent: rm.removeUniqueConstraint(e.Aggregate().ID, e.ConfigID, idpconfig.UniqueIDPConfigNameType) @@ -70,6 +76,9 @@ func (rm *UniqueConstraintReadModel) Reduce() error { case *project.ProjectAddedEvent: rm.addUniqueConstraint(e.Aggregate().ID, e.Aggregate().ID, project.NewAddProjectNameUniqueConstraint(e.Name, e.Aggregate().ResourceOwner)) case *project.ProjectChangeEvent: + if e.Name != nil { + continue + } rm.changeUniqueConstraint(e.Aggregate().ID, e.Aggregate().ID, project.NewAddProjectNameUniqueConstraint(*e.Name, e.Aggregate().ResourceOwner)) case *project.ProjectRemovedEvent: rm.removeUniqueConstraint(e.Aggregate().ID, e.Aggregate().ID, project.UniqueProjectnameType)