Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-2804

[release-4.12] Add required parameter --credentials-requests-dir for ccoctl gcp delete

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • None
    • 4.12.0
    • None
    • None
    • Approved
    • False
    • Hide

      This has been verified on the PR by Jianping. The fix is already on main and will not block once this is administratively approved by Jianping.

      Show
      This has been verified on the PR by Jianping. The fix is already on main and will not block once this is administratively approved by Jianping.

      In order to delete the correct GCP cloud resources, the "--credentials-requests-dir" parameter must be passed to "ccoctl gcp delete". This was fixed for 4.12 as part of https://github.com/openshift/cloud-credential-operator/pull/489 but must be backported for previous releases. See https://github.com/openshift/cloud-credential-operator/pull/489#issuecomment-1248733205 for discussion regarding this bug.

      To reproduce, create GCP infrastructure with a name parameter that is a subset of another set of GCP infrastructure's name parameter. I will "ccoctl gcp create all" with "name=abutcher-gcp" and "name=abutcher-gcp1".

      $ ./ccoctl gcp create-all \2801 --name=abutcher-gcp \
      --region=us-central1 \
      --project=openshift-hive-dev \
      --credentials-requests-dir=./credrequests
      
      $ ./ccoctl gcp create-all \
      --name=abutcher-gcp1 \
      --region=us-central1 \
      --project=openshift-hive-dev \
      --credentials-requests-dir=./credrequests
      

      Running "ccoctl gcp delete --name=abutcher-gcp" will result in GCP infrastructure for both "abutcher-gcp" and "abutcher-gcp1" being deleted. 

      $ ./ccoctl gcp delete --name abutcher-gcp --project openshift-hive-dev
      2022/10/24 11:30:06 Credentials loaded from file "/home/abutcher/.gcp/osServiceAccount.json"
      2022/10/24 11:30:06 Deleted object .well-known/openid-configuration from bucket abutcher-gcp-oidc
      2022/10/24 11:30:07 Deleted object keys.json from bucket abutcher-gcp-oidc
      2022/10/24 11:30:07 OIDC bucket abutcher-gcp-oidc deleted
      2022/10/24 11:30:09 IAM Service account abutcher-gcp-openshift-image-registry-gcs deleted
      2022/10/24 11:30:10 IAM Service account abutcher-gcp-openshift-gcp-ccm deleted
      2022/10/24 11:30:11 IAM Service account abutcher-gcp1-openshift-cloud-network-config-controller-gcp deleted
      2022/10/24 11:30:12 IAM Service account abutcher-gcp-openshift-machine-api-gcp deleted
      2022/10/24 11:30:13 IAM Service account abutcher-gcp-openshift-ingress-gcp deleted
      2022/10/24 11:30:15 IAM Service account abutcher-gcp-openshift-gcp-pd-csi-driver-operator deleted
      2022/10/24 11:30:16 IAM Service account abutcher-gcp1-openshift-ingress-gcp deleted
      2022/10/24 11:30:17 IAM Service account abutcher-gcp1-openshift-image-registry-gcs deleted
      2022/10/24 11:30:19 IAM Service account abutcher-gcp-cloud-credential-operator-gcp-ro-creds deleted
      2022/10/24 11:30:20 IAM Service account abutcher-gcp1-openshift-gcp-pd-csi-driver-operator deleted
      2022/10/24 11:30:21 IAM Service account abutcher-gcp1-openshift-gcp-ccm deleted
      2022/10/24 11:30:22 IAM Service account abutcher-gcp1-cloud-credential-operator-gcp-ro-creds deleted
      2022/10/24 11:30:24 IAM Service account abutcher-gcp1-openshift-machine-api-gcp deleted
      2022/10/24 11:30:25 IAM Service account abutcher-gcp-openshift-cloud-network-config-controller-gcp deleted
      2022/10/24 11:30:25 Workload identity pool abutcher-gcp deleted

       

            abutcher@redhat.com Andrew Butcher
            abutcher@redhat.com Andrew Butcher
            Jianping Shu Jianping Shu
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: