diff --git a/plugins/catalog-backend-module-gitlab/src/providers/GitlabOrgDiscoveryEntityProvider.ts b/plugins/catalog-backend-module-gitlab/src/providers/GitlabOrgDiscoveryEntityProvider.ts index 67a5134f25..ce545ebe84 100644 --- a/plugins/catalog-backend-module-gitlab/src/providers/GitlabOrgDiscoveryEntityProvider.ts +++ b/plugins/catalog-backend-module-gitlab/src/providers/GitlabOrgDiscoveryEntityProvider.ts @@ -368,9 +368,7 @@ export class GitlabOrgDiscoveryEntityProvider implements EntityProvider { per_page: 100, }, ); - } - - if ( + } else if ( this.gitLabClient.isSelfManaged() && !this.config.restrictUsersToGroup ) { @@ -387,9 +385,8 @@ export class GitlabOrgDiscoveryEntityProvider implements EntityProvider { { page: 1, per_page: 100, active: true }, ); } - // For SaaS, the only difference is the root group - if (!this.gitLabClient.isSelfManaged()) { + else { groups = (await this.gitLabClient.listDescendantGroups(this.config.group)) .items; const rootGroup = this.config.restrictUsersToGroup