mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-12 02:54:20 +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) {
|
||||
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
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user