Skip to content

Commit

Permalink
Don't early return if there are errors setting up sso/org-related cli…
Browse files Browse the repository at this point in the history
…ents. (#45)

Previously if we ran into an error in one of these, we'd return the resource syncers and not sync sso/org-related resources.

Now we return bad resource syncers so we'll correctly error during sync.
  • Loading branch information
ggreer authored Jul 16, 2024
1 parent 5d8479c commit 6a941ea
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions pkg/connector/connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -355,27 +355,27 @@ func (c *AWS) ResourceSyncers(ctx context.Context) []connectorbuilder.ResourceSy
if err == nil {
rs = append(rs, iamUserBuilder(iamClient), iamRoleBuilder(iamClient), iamGroupBuilder(iamClient))
}
if !c.ssoEnabled && !c.orgsEnabled {
return rs
}

ix, err := c.getIdentityInstance(ctx)
if err != nil {
l.Error("getIdentityInstance error", zap.Error(err))
return rs
}
ssoAdminClient, err := c.ssoAdminClient(ctx)
if err != nil {
l.Error("ssoAdminClient error", zap.Error(err))
return rs
}
identityStoreClient, err := c.identityStoreClient(ctx)
if err != nil {
l.Error("identityStoreClient error", zap.Error(err))
return rs
}
scimClient, err := c.ssoSCIMClient(ctx)
if err != nil {
l.Error("scimClient error", zap.Error(err))
return rs
}
if c.ssoEnabled {
scimClient, err := c.ssoSCIMClient(ctx)
if err != nil {
l.Error("scimClient error", zap.Error(err))
}
rs = append(rs, ssoUserBuilder(c.ssoRegion, ssoAdminClient, identityStoreClient, ix, scimClient))
rs = append(rs, ssoGroupBuilder(c.ssoRegion, ssoAdminClient, identityStoreClient, ix))
}
Expand Down

0 comments on commit 6a941ea

Please sign in to comment.