flux: git url example

Created on 20 Jul 2019  路  15Comments  路  Source: fluxcd/flux

Describe the bug
In the values.yaml, an example has been provided in which it shows how to add the URL of the repository. An example is given below:

ssh://[email protected]/weaveworks/flux-get-started

The problem with this example is that it works well with Github but not works properly with bitbucket, for bitbucket we have to provide URL in this format

[email protected]/weaveworks/flux-get-started

I think an example for each version control service like Gitlab and bitbucket must be provided because it took a lot of time to figure out how it will work with bitbucket.

To Reproduce

  1. Run flux for bitbucket repository.

Expected behaviour
Examples must be provided for different version control services.

Logs
I haven't stored the logs but in logs it shows that it wasn't able to resolve the url.

Additional context
Add any other context about the problem here, e.g

  • Flux version: 1.13.2
  • Helm Operator version: NIL
  • Kubernetes version: NIL
  • Git provider: Bitbucket
  • Container registry provider: NIL

All 15 comments

@dholbach @hiddeco kindly review this issue. thank you!

The syntax [email protected]:weaveworks/flux-get-started is equivalent to ssh://[email protected]/weaveworks/flux-get-started -- it's just a shortcut, built into git. If you're having trouble with one working and not the other, it may be because there's a non-obvious difference: when using the scp-style syntax, you must use a colon rather than a slash between the host and the path (i.e., your second example is wrong).

By way of proof:

~/scratch $ git clone [email protected]:mbridgen/dummy.git dummy-1
Cloning into 'dummy-1'...
remote: Counting objects: 6, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 6 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (6/6), done.

~/scratch $ git clone ssh://[email protected]/mbridgen/dummy.git dummy-2
Cloning into 'dummy-2'...
remote: Counting objects: 6, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 6 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (6/6), 706 bytes | 706.00 KiB/s, done.

this is the real value I was using :

ssh://[email protected]:username/repo-name.git

@aliartiza75 if you change that to ssh://[email protected]/username/repo-name.git, it should work.

@hiddeco this is fine but I think this should be mentioned somewhere in the documentation so that someone else doesn't have to face this issue. By the way, the link that I coped was from the bitbucket repo dashboard.

By the way, the link that I coped was from the bitbucket repo dashboard.

I just logged in to Bitbucket and the format they give to copy is the following:

git clone [email protected]:hiddeco/<some repository>.git

If you remove git clone from that and give it to Flux, it will happily clone your repository.

but I think this should be mentioned somewhere in the documentation so that someone else doesn't have to face this issue

Which documentation were you following, and where do you reckon is the best place to mention this gotcha?

@hiddeco kindly get the clone url in ssh format. Because in documentation its is specified ssh:// not https.

@squaremo i think it should be added in values.yaml file.

https://github.com/fluxcd/flux/blob/77d2afbd180138597326848dba92c3142c7cff4f/chart/flux/values.yaml#L142-L162

after line 143? what do you think?

@squaremo waiting for your response?

@squaremo waiting for your response?

It's mentioned with the ssh format on line 143
What do you propose we add there?

@stealthybox ack, closing this issue.

Thank you for opening this issue :heart_decoration:
It documents the problem and makes this much more searchable for all flux users

Was this page helpful?
0 / 5 - 0 ratings