diff --git a/cmd/flux/bootstrap_gitlab.go b/cmd/flux/bootstrap_gitlab.go index 1d387ba6..c2b0b609 100644 --- a/cmd/flux/bootstrap_gitlab.go +++ b/cmd/flux/bootstrap_gitlab.go @@ -129,18 +129,22 @@ func bootstrapGitLabCmdRun(cmd *cobra.Command, args []string) error { return fmt.Errorf("cluster already bootstrapped to %v path", usedPath) } - repository, err := git.NewRepository(glRepository, glOwner, glHostname, glToken, "flux", glOwner+"@users.noreply.gitlab.com") + provider := &git.GitLabProvider{ + IsPrivate: glPrivate, + IsPersonal: glPersonal, + } + owner, err := provider.GetRepositoryOwner(ctx, glToken, glOwner) if err != nil { return err } - if glSSHHostname != "" { - repository.SSHHost = glSSHHostname + repository, err := git.NewRepository(glRepository, owner, glHostname, glToken, "flux", glOwner+"@users.noreply.gitlab.com") + if err != nil { + return err } - provider := &git.GitLabProvider{ - IsPrivate: glPrivate, - IsPersonal: glPersonal, + if glSSHHostname != "" { + repository.SSHHost = glSSHHostname } tmpDir, err := ioutil.TempDir("", namespace)