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

jx upgrade ingress update environment webhooks looks at wrong GitHub org #3115

Closed
1 of 2 tasks
joostvdg opened this issue Feb 15, 2019 · 2 comments · Fixed by #3527 or #3811
Closed
1 of 2 tasks

jx upgrade ingress update environment webhooks looks at wrong GitHub org #3115

joostvdg opened this issue Feb 15, 2019 · 2 comments · Fixed by #3527 or #3811

Comments

@joostvdg
Copy link

Summary

When updating ingress configuration via the jx upgrade ingress command, it does not update the environment webhooks. I believe this goes wrong because it uses the wrong GitHub organization.

As user and organization I've set joostvdg and that all works. When I do jx upgrade ingress and select Y on Do you want to update all existing webhooks? I get a drop down of every other GitHub organization I have access to.

Updating Jenkins with new external URL details https://jenkins.jx.jx.kearos.net
Previous webhook endpoint https://jenkins.jx.jx.kearos.net/github-webhook/
Updated webhook endpoint https://jenkins.jx.jx.kearos.net/github-webhook/
? Do you want to update all existing webhooks? Yes

Updating all webHooks from https://jenkins.jx.jx.kearos.net/github-webhook/ to https://jenkins.jx.jx.kearos.net/github-webhook/
? Which organisation do you want to use?  [Use arrows to move, type to filter]
> CatAndMonster
  FlussoBV
  abnamrocoesd
  cloudbees

My currently configured organisation, joostvdg, does not show up in the list.

Steps to reproduce the behavior

Create a JX cluster in GKE:

jx create cluster gke \                                                                                                                                              
    --cluster-name="${JX_CLUSTER_NAME}" \
    --default-admin-password="${JX_ADMIN_PSS}" \
    --domain="${JX_DOMAIN}" \
    --kubernetes-version="${JX_K8S_VERSION}" \
    --machine-type='n1-standard-2' \
    --max-num-nodes=3 \
    --min-num-nodes=2 \
    --project-id=${JX_GCE_PROJECT} \
    --zone="${JX_K8S_ZONE}" \
    --skip-login

Use a custom domain, in this case, jx.kearos.net.
Then update ingress configuration via jx upgrade ingress, install cert-manager, use production lets encrypt, update webhooks to tls, and recreate all the ingress rules.

Expected behavior

I get a dropdown with my current GitHub organization pre-selected. I select it and the webhooks get updated.

Actual behavior

Nothing happens. There is not even a mention of the repositories not being found.

Previous webhook endpoint http://jenkins.jx.jx.kearos.net/github-webhook/
Updated webhook endpoint https://jenkins.jx.jx.kearos.net/github-webhook/
? Do you want to update all existing webhooks? Yes

Updating all webHooks from http://jenkins.jx.jx.kearos.net/github-webhook/ to https://jenkins.jx.jx.kearos.net/github-webhook/
? Which organisation do you want to use? demomon

Here I selected an organisation, which does exist but doesn't hold the environment repositories.
And after this, line, there's nothing, no webhook update, no complain about the repository not existing, nothing.

Jx version

The output of jx version is:

NAME               VERSION
jx                 1.3.885
jenkins x platform 0.0.3402
Kubernetes cluster v1.11.7-gke.4
kubectl            v1.13.3
helm client        v2.12.3+geecf22f
helm server        v2.12.2+g7d2b0c7
git                git version 2.17.2 (Apple Git-113)
Operating System   Mac OS X 10.14.2 build 18C54

Jenkins type

  • Classic Jenkins
  • Serverless Jenkins

Kubernetes cluster

GKE, see above.

Operating system / Environment

MacOS -> Mac OS X 10.14.2 build 18C54

@a-type
Copy link

a-type commented Feb 23, 2019

I was able to get past this by manually typing in my Github username and pressing Enter. I guess the CLI doesn't necessarily enforce that you use one of the provided values.

Small edit: I've been continually re-creating my environment for other reasons. I tried typing it in again and it did not work. On a third attempt, I first hit up and down on the arrow keys before typing it in, since I noticed that occasionally that seems to make a difference to however the CLI is determining the value. It worked.

So, final advice: Press up and down a few times, then type in your username and press Enter.

@vfarcic
Copy link

vfarcic commented Apr 2, 2019

The issue is in invocation of PickOrganisation. The second argument (username) should not be empty. The fix should be to add a question (and an argument) to specify the username similar to how it's done in https://github.com/jenkins-x/jx/blob/master/pkg/jx/cmd/delete_repo.go#L103.

@joostvdg Wanna make a PR?

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

Successfully merging a pull request may close this issue.

4 participants