mirror of
https://github.com/zitadel/zitadel.git
synced 2025-01-05 22:52:46 +00:00
fix: log setup step (#1495)
* fix: log setup step * fix: unique constraint setup step
This commit is contained in:
parent
2d65b94df3
commit
e8e8015aa5
@ -56,6 +56,7 @@ func setSetUpContextData(ctx context.Context) context.Context {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Commands) StartSetup(ctx context.Context, step domain.Step) (*domain.IAM, error) {
|
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)
|
iamWriteModel, err := c.getIAMWriteModel(ctx)
|
||||||
if err != nil && !caos_errs.IsNotFound(err) {
|
if err != nil && !caos_errs.IsNotFound(err) {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -52,12 +52,18 @@ func (rm *UniqueConstraintReadModel) Reduce() error {
|
|||||||
case *iam.IDPConfigAddedEvent:
|
case *iam.IDPConfigAddedEvent:
|
||||||
rm.addUniqueConstraint(e.Aggregate().ID, e.ConfigID, idpconfig.NewAddIDPConfigNameUniqueConstraint(e.Name, e.Aggregate().ResourceOwner))
|
rm.addUniqueConstraint(e.Aggregate().ID, e.ConfigID, idpconfig.NewAddIDPConfigNameUniqueConstraint(e.Name, e.Aggregate().ResourceOwner))
|
||||||
case *iam.IDPConfigChangedEvent:
|
case *iam.IDPConfigChangedEvent:
|
||||||
|
if e.Name != nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
rm.changeUniqueConstraint(e.Aggregate().ID, e.ConfigID, idpconfig.NewAddIDPConfigNameUniqueConstraint(*e.Name, e.Aggregate().ResourceOwner))
|
rm.changeUniqueConstraint(e.Aggregate().ID, e.ConfigID, idpconfig.NewAddIDPConfigNameUniqueConstraint(*e.Name, e.Aggregate().ResourceOwner))
|
||||||
case *iam.IDPConfigRemovedEvent:
|
case *iam.IDPConfigRemovedEvent:
|
||||||
rm.removeUniqueConstraint(e.Aggregate().ID, e.ConfigID, idpconfig.UniqueIDPConfigNameType)
|
rm.removeUniqueConstraint(e.Aggregate().ID, e.ConfigID, idpconfig.UniqueIDPConfigNameType)
|
||||||
case *org.IDPConfigAddedEvent:
|
case *org.IDPConfigAddedEvent:
|
||||||
rm.addUniqueConstraint(e.Aggregate().ID, e.ConfigID, idpconfig.NewAddIDPConfigNameUniqueConstraint(e.Name, e.Aggregate().ResourceOwner))
|
rm.addUniqueConstraint(e.Aggregate().ID, e.ConfigID, idpconfig.NewAddIDPConfigNameUniqueConstraint(e.Name, e.Aggregate().ResourceOwner))
|
||||||
case *org.IDPConfigChangedEvent:
|
case *org.IDPConfigChangedEvent:
|
||||||
|
if e.Name != nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
rm.changeUniqueConstraint(e.Aggregate().ID, e.ConfigID, idpconfig.NewAddIDPConfigNameUniqueConstraint(*e.Name, e.Aggregate().ResourceOwner))
|
rm.changeUniqueConstraint(e.Aggregate().ID, e.ConfigID, idpconfig.NewAddIDPConfigNameUniqueConstraint(*e.Name, e.Aggregate().ResourceOwner))
|
||||||
case *org.IDPConfigRemovedEvent:
|
case *org.IDPConfigRemovedEvent:
|
||||||
rm.removeUniqueConstraint(e.Aggregate().ID, e.ConfigID, idpconfig.UniqueIDPConfigNameType)
|
rm.removeUniqueConstraint(e.Aggregate().ID, e.ConfigID, idpconfig.UniqueIDPConfigNameType)
|
||||||
@ -70,6 +76,9 @@ func (rm *UniqueConstraintReadModel) Reduce() error {
|
|||||||
case *project.ProjectAddedEvent:
|
case *project.ProjectAddedEvent:
|
||||||
rm.addUniqueConstraint(e.Aggregate().ID, e.Aggregate().ID, project.NewAddProjectNameUniqueConstraint(e.Name, e.Aggregate().ResourceOwner))
|
rm.addUniqueConstraint(e.Aggregate().ID, e.Aggregate().ID, project.NewAddProjectNameUniqueConstraint(e.Name, e.Aggregate().ResourceOwner))
|
||||||
case *project.ProjectChangeEvent:
|
case *project.ProjectChangeEvent:
|
||||||
|
if e.Name != nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
rm.changeUniqueConstraint(e.Aggregate().ID, e.Aggregate().ID, project.NewAddProjectNameUniqueConstraint(*e.Name, e.Aggregate().ResourceOwner))
|
rm.changeUniqueConstraint(e.Aggregate().ID, e.Aggregate().ID, project.NewAddProjectNameUniqueConstraint(*e.Name, e.Aggregate().ResourceOwner))
|
||||||
case *project.ProjectRemovedEvent:
|
case *project.ProjectRemovedEvent:
|
||||||
rm.removeUniqueConstraint(e.Aggregate().ID, e.Aggregate().ID, project.UniqueProjectnameType)
|
rm.removeUniqueConstraint(e.Aggregate().ID, e.Aggregate().ID, project.UniqueProjectnameType)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user