Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

how to connect to a TFS git repo? #1152

Closed
mrmojo666 opened this issue Jun 19, 2018 · 8 comments
Closed

how to connect to a TFS git repo? #1152

mrmojo666 opened this issue Jun 19, 2018 · 8 comments
Labels

Comments

@mrmojo666
Copy link

I've tried to use flux aganist a TFS git repo:

but i always get : component=sync-loop error="getting unlocked automated services: git repo not ready"

the ssh git link provided by tfs is something like that ssh://url:22/tfs/collectionname/teamname/_git/reponame

Is flux working only with github ?

Thank you

@squaremo
Copy link
Member

Using git+ssh with any server is supported, but it needs a bit of extra work if it's not github.com, gitlab.com or bitbucket.com.

Have a look at https://github.com/weaveworks/flux/blob/1a399296bb4c63c5f2121e5f2f5f8d3778b072a7/site/standalone/setup.md#using-a-private-git-host (sorry, it's still in a PR!), which explains what needs to be done. (when it refers to the example deployment, that means https://github.com/weaveworks/flux/blob/1a399296bb4c63c5f2121e5f2f5f8d3778b072a7/deploy/flux-deployment.yaml).

@mrmojo666
Copy link
Author

Thank you, I'm going to have a try, I'll let you know.

@mrmojo666
Copy link
Author

i still think that flux is not accepting the tfs git url (that is way different from the ones used in examples
ssh://url:22/tfs/collectionname/teamname/_git/reponame

because deploying flux pointing to a git url like this, $GITHOST and $GITREPO are blank (or have i missed something?)

C:\WINDOWS\system32>kubectl get pods --all-namespaces -l name=flux
NAMESPACE   NAME                    READY     STATUS    RESTARTS   AGE
default     flux-744785ddb7-4npz2   1/1       Running   0          1d

C:\WINDOWS\system32>kubectl exec -n default flux-744785ddb7-4npz2 -ti -- /bin/sh
/home/flux # env GITHOST="$GITHOST" GITREPO="$GITREPO" PS1="container$ " /bin/sh
container$ git clone $GITREPO
fatal: You must specify a repository to clone.

container$ printenv GITREPO

container$ printenv GITHOST

container$

Thank you for any help

@squaremo
Copy link
Member

GITHOST and GITREPO are just for making the example less verbose. You can substitute the actual values, something like

kubectl exec -n default flux-744785ddb7-4npz2 -ti -- /bin/sh
# git clone ssh://url:22/tfs/collectionname/teamname/_git/reponame

@mrmojo666
Copy link
Author

Hi @squaremo
thank you now I cloned the repo and created the configmap

git clone ssh://***********:22/tfs/*****/******/_git/********** Cloning into '**************'... remote: remote: fTfs remote: fSSSSSSSs remote: fSSSSSSSSSS remote: TSSf fSSSSSSSSSSSS remote: SSSSSF fSSSSSSST SSSSS remote: SSfSSSSSsfSSSSSSSt SSSSS remote: SS tSSSSSSSSSs SSSSS remote: SS fSSSSSSST SSSSS remote: SS fSSSSSFSSSSSSf SSSSS remote: SSSSSST FSSSSSSFt SSSSS remote: SSSSt FSSSSSSSSSSSS remote: FSSSSSSSSSS remote: FSSSSSSs remote: FSFs (TM) remote: remote: Microsoft (R) Visual Studio (R) Team Foundation Server remote: Receiving objects: 100% (1241/1241), 191.72 KiB | 3.00 MiB/s, done. Resolving deltas: 100% (656/656), done. /home/flux # kubectl create configmap flux-known-hosts --from-file=$HOME/.ssh/known_hosts configmap "flux-known-hosts" created /home/flux # command terminated with exit code 137

I've added commands to mount configmap in flux deploy yaml

and now i see the corret configmap in the namespace of flux

but I still getting

ts=2018-06-26T09:34:22.824839358Z caller=main.go:368 url=ssh://***********:22/tfs/*****/******/_git/********** user="Weave Flux" [email protected] sync-tag=flux-sync notes-ref=flux set-author=false ts=2018-06-26T09:34:22.825032759Z caller=main.go:423 upstream="no upstream URL given" ts=2018-06-26T09:34:22.827901868Z caller=main.go:440 addr=:3030 ts=2018-06-26T09:34:22.832167781Z caller=images.go:15 component=sync-loop msg="polling images" ts=2018-06-26T09:34:22.832200981Z caller=images.go:21 component=sync-loop error="getting unlocked automated services: git repo not ready" ts=2018-06-26T09:34:22.832244081Z caller=loop.go:89 component=sync-loop err="git repo not ready" ts=2018-06-26T09:34:23.208674521Z caller=checkpoint.go:24 component=checkpoint msg="up to date" latest=1.4.1 ts=2018-06-26T09:34:27.869557624Z caller=warming.go:205 component=warmer fetching=k8s-gcrio.azureedge.net/hyperkube-amd64 total=76 expired=76 missing=0 ts=2018-06-26T09:34:28.658508808Z caller=warming.go:253 component=warmer updated=k8s-gcrio.azureedge.net/hyperkube-amd64 count=76 ts=2018-06-26T09:34:31.109649709Z caller=warming.go:205 component=warmer fetching=k8s-gcrio.azureedge.net/addon-resizer total=7 expired=7 missing=0 ts=2018-06-26T09:34:31.127414162Z caller=warming.go:253 component=warmer updated=k8s-gcrio.azureedge.net/addon-resizer count=7

any ideas ?

Thank you

@mrmojo666
Copy link
Author

Hi @squaremo ,
there are other logs to understand what's going on ? thank you

@squaremo
Copy link
Member

Aha, so you were able to clone from within the container, that's progress!

The log messages are a little mysterious, aren't they -- #1171 will put more info in them, so it's easier to diagnose problems.

In the meantime: fluxd wants to have write access to the repo -- you could check that in the container shell by trying to push a tag:

container$ git clone ssh://<etc>/ tmp-clone
container$ cd tmp-clone
container$ git tag test-write
container$ git push origin test-write

If this fails, it may mean that the SSH key you've installed in TFS doesn't have write permissions.

@squaremo
Copy link
Member

@mrmojo666 I'm going to close this, just to take it off the radar. If you didn't get it to work (and you're still interested in getting it to work!), please feel free to re-open the issue.

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

No branches or pull requests

2 participants