Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flux bootstrap gitlab ignores --owner when creating the repo #3867

Closed
1 task done
abderrahim opened this issue May 10, 2023 · 4 comments · Fixed by #4324
Closed
1 task done

flux bootstrap gitlab ignores --owner when creating the repo #3867

abderrahim opened this issue May 10, 2023 · 4 comments · Fixed by #4324

Comments

@abderrahim
Copy link

Describe the bug

Following the installation guide for gitlab to create my first flux repo, the repo is created in the wrong location (under my username) rather than the group specified with --owner.

Steps to reproduce

I ran the following command:
flux bootstrap gitlab --hostname gitlab.codethink.co.uk --owner software-factory/playground/abderrahim --repository flux-test1 --token-auth --personal

I got the following output

► connecting to https://gitlab.codethink.co.uk
✔ repository "https://gitlab.codethink.co.uk/software-factory/playground/abderrahim/flux-test1" created
► cloning branch "main" from Git repository "https://gitlab.codethink.co.uk/software-factory/playground/abderrahim/flux-test1.git"
⚠️  clone failure: unable to clone: repository not found: git repository: 'https://gitlab.codethink.co.uk/software-factory/playground/abderrahim/flux-test1.git'
⚠️  clone failure: unable to clone 'https://gitlab.codethink.co.uk/software-factory/playground/abderrahim/flux-test1.git': repository already exists
✗ failed to clone repository: unable to clone 'https://gitlab.codethink.co.uk/software-factory/playground/abderrahim/flux-test1.git': repository already exists

Expected behavior

It should work, creating the repository and setting it up.

Instead, the repository was created under my username (rather than the group I specified), and subsequently cloning it failed.

This might be due to the fact I was using a personal token rather than a project/group token, but it should either figure it out or explicitly throw an error.

Screenshots and recordings

No response

OS / Distro

Debian testing

Flux version

2.0.0-rc.1

Flux check

► checking prerequisites
✔ Kubernetes 1.26.3 >=1.20.6-0
► checking controllers
✗ no controllers found in the 'flux-system' namespace with the label selector 'app.kubernetes.io/part-of=flux'
► checking crds
✗ no crds found with the label selector 'app.kubernetes.io/part-of=flux'
✗ check failed

Git provider

gitlab entreprise

Container Registry provider

No response

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@stefanprodan
Copy link
Member

Can you please using flux bootstrap git --url? You'll need to set the deploy key by hand but it should unblock you until we figure out a fix.

@abderrahim
Copy link
Author

I forgot to update this. I got it working by using --deploy-token-auth as recommended in the gitlab documentation instead of --token-auth --personal as recommended in the flux documentation.

Not sure what to make of this, but at least I'm not blocked.

@stefanprodan
Copy link
Member

@abderrahim we also have --deploy-token-auth in docs, it's right there in the link you posted.

@somtochiama
Copy link
Member

@abderrahim The --personal flag tells flux to create the repository on your personal account. It should work if you only --token-auth. The documentation says:

Run the bootstrap for a repository on your personal GitLab account:

flux bootstrap gitlab
--owner=my-gitlab-username \

However, I think the UX in the CLI should be improved to either return a better error or use the personal repository url when a group is specified instead of a username (and maybe the docs should be updated too, to tell the user to look further down the page for the cli command if the repository is under a group)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants