jx icon indicating copy to clipboard operation
jx copied to clipboard

jx project quickstart automatically override my github organization

Open laucapgemini opened this issue 3 years ago • 1 comments

After a few days try to learn about jenkins X and especially project quickstart, I end up in creating this ticket since the problem encountered below seem to me a bug

Context :

  • jenkins X cluster deployed on GKE using the template https://github.com/jx3-gitops-repositories/jx3-terraform-gke forked into my organization
  • gitops repo initialized using the template https://github.com/jx3-gitops-repositories/jx3-gke-gsm
  • the cluster has been deployed using the variables TF_VAR_jx_bot_username using my organization name (and not m ypersonal github account name)

Sequence of actions :

  1. jx project quickstart
  2. selection of my organization got credentials to access github
  3. selection of the project type 'golang-http'
  4. selection (again) of my github credentials -- jx seem to access a secret store since a selection among 2 possible credential names are proposed, with the same name which does not help. Where is the repository of this store? I cannot find it out
  5. selection of a (new) repository name, initialize git, commit

At that stage, jx will display "WARNING: organisation xxxx detected from URL https://github.com/xxxx/golang-test3.git. '--org yyyy' will be ignored". xxxx corrrespond to the name of my personal github account whereas yyyy would be the organization name, and I would expect the project to be pushed there

  1. then the pull request for the creation of the source-config.yaml is created, the associated pipeline runs ok, add the commit for updating jx workspace for the new repo and merge the pull request
  2. after a timeout of 20min the yyyy/golang-test3.git repo is not found and so the rest of the installation fails

Thank you for your help on that topic

Regards Laurent

laucapgemini avatar Sep 12 '22 16:09 laucapgemini

I could make it work under the following condition ! but at first sight the jx code tries to detect the organisation (too) smartly for me, and I still don't undertand how it works in fact (especially I saw that JX even call github API to check the user organisation : you can try it yourself :-)

curl -H "Accept: application/vnd.github+json" -H "Authorization: Bearer <my token>" https://api.github.com/user/orgs

Here is the command to make it work :

export TF_VAR_jx_bot_username="<my personal github username>"
jx project quickstart --git-kind github --git-server https://github.com --git-token <my token> --git-username <my personal github username> --org <my github organization name>

Hope it can help Laurent

laucapgemini avatar Sep 13 '22 19:09 laucapgemini