jenkins-x / jx

Jenkins X provides automated CI+CD for Kubernetes with Preview Environments on Pull Requests using Cloud Native pipelines from Tekton
https://jenkins-x.io/
Apache License 2.0
4.58k stars 788 forks source link

jx delete application fails to delete an app unless --org=<org> is passed #2849

Closed mikecirioli closed 5 years ago

mikecirioli commented 5 years ago

Summary

jx delete application fails to delete an app unless you explicitly specify the GH organization via the --org=<org> command line parameter. This command should be using the sourcerepositories CRD to automatically supply this information so that you don't have to supply it on the command line.

Steps to reproduce the behavior

  1. Create a new quickstart app (ex. golang-http app called foobar)
  2. verify that you can see it via jx get apps
  3. try to delete it using jx delete application foobar

Expected behavior

The app will be deleted

Actual behavior

App is not deleted

>$ jx delete application foobar3
Removing application foobar3 from environment Staging
? user name to submit the Pull Request mikecirioli
Created Pull Request: https://github.com/jx-dev-org-mikec/environment-jx-dev-mikec-jx-dev-mikec-staging/pull/13

Waiting for pull request https://github.com/jx-dev-org-mikec/environment-jx-dev-mikec-jx-dev-mikec-staging/pull/13 to merge
Failed to query the Pull Request last commit status for https://github.com/jx-dev-org-mikec/environment-jx-dev-mikec-jx-dev-mikec-staging/pull/13 ref 69abe75975757b610c6029e56f71eebd29abfa77 Could not find a status for repository jx-dev-org-mikec/environment-jx-dev-mikec-jx-dev-mikec-staging with ref 69abe75975757b610c6029e56f71eebd29abfa77
Request https://github.com/jx-dev-org-mikec/environment-jx-dev-mikec-jx-dev-mikec-staging/pull/13 is merged!
Removing application foobar3 from environment Production
No changes made to the GitOps Environment source code. Code must be up to date!
error: deleting application: deleting prow config for foobar3: removing repo /foobar3 from branch protection: Invalid path /foobar3 could not determine organisation and repository name

Jx version

The output of jx version is:

NAME               VERSION
jx                 1.3.798
jenkins x platform 0.0.3306
Kubernetes cluster v1.10.11-gke.1
kubectl            v1.12.2
helm client        v2.11.0+g2e55dbe
helm server        v2.12.2+g7d2b0c7
git                git version 2.16.0
Operating System   Mac OS X 10.14.2 build 18C54

Jenkins type

Kubernetes cluster

Operating system / Environment

mikecirioli commented 5 years ago

closed, this has been addressed by #3045