From c84a5a418fddc0df42ef51f89df79ec90cbdb440 Mon Sep 17 00:00:00 2001 From: Nick Meves Date: Sun, 13 Jun 2021 14:29:56 -0700 Subject: [PATCH] Adjust GitLab options configuration --- pkg/validation/options.go | 6 ++---- providers/gitlab_test.go | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/pkg/validation/options.go b/pkg/validation/options.go index 37c2aa24..ce1d219e 100644 --- a/pkg/validation/options.go +++ b/pkg/validation/options.go @@ -276,13 +276,11 @@ func parseProviderInfo(o *options.Options, msgs []string) []string { msgs = append(msgs, "oidc provider requires an oidc issuer URL") } case *providers.GitLabProvider: - p.Groups = o.Providers[0].GitLabConfig.Group - err := p.AddProjects(o.Providers[0].GitLabConfig.Projects) + p.SetAllowedGroups(o.Providers[0].GitLabConfig.Group) + err := p.SetAllowedProjects(o.Providers[0].GitLabConfig.Projects) if err != nil { msgs = append(msgs, "failed to setup gitlab project access level") } - p.SetAllowedGroups(p.PrefixAllowedGroups()) - p.SetProjectScope() if p.Verifier == nil { // Initialize with default verifier for gitlab.com diff --git a/providers/gitlab_test.go b/providers/gitlab_test.go index 3a41cb7b..699ebb0f 100644 --- a/providers/gitlab_test.go +++ b/providers/gitlab_test.go @@ -228,7 +228,7 @@ var _ = Describe("Gitlab Provider Tests", func() { p.SetAllowedGroups(in.allowedGroups) err := p.SetAllowedProjects(in.allowedProjects) - if err == nil { + if in.expectedError == nil { Expect(err).To(BeNil()) } else { Expect(err).To(MatchError(in.expectedError))