deploy icon indicating copy to clipboard operation
deploy copied to clipboard

[BUG][UNINSTALL] The uninstall script assumes the clustername = namespace

Open e-minguez opened this issue 5 years ago • 1 comments

Describe the bug

The uninstall script assumes the clustername = namespace https://github.com/open-cluster-management/deploy/blob/master/clean-clusters.sh#L41

oc delete namespace ${clusterName} --wait=false

But if it doesn't, the cluster is not deleted (the namespace is deleted)

Detaching imported clusters
 Detaching cluster kni1-virtualmasters-baremetalworkers
  Error from server (NotFound): clusters.clusterregistry.k8s.io "kni1-virtualmasters-baremetalworkers" not found
  namespace "kni1-virtualmasters-baremetalworkers" deleted
Second pass cleaning, by endpointConfig
 Detaching cluster kni1-virtualmasters-baremetalworkers
  Error from server (NotFound): clusters.clusterregistry.k8s.io "kni1-virtualmasters-baremetalworkers" not found
  namespace "kni1-virtualmasters-baremetalworkers" deleted

To Reproduce Steps to reproduce the behavior:

  1. Attach a cluster with some name (like 'mycluster') and use a different namespace (like 'mycluster-namespace')
  2. Run the uninstall script
  3. See error

Expected behavior The proper namespace should be deleted

Screenshots N/A

Desktop (please complete the following information):

  • OS: Fedora 31
  • Browser N/A
  • Snapshot N/A (fcd582d commit id)

Additional context Add any other context about the problem here.

e-minguez avatar Apr 29 '20 15:04 e-minguez

Currently the automated provisioning and the import existing cluster processes will create a namespace in the HUB with the exact name you gave the managed cluster... This is done so that RBAC controls can be used to "secure" the cluster namespace in the HUB. This script does make the assumption that the cluster namespace in the hub does match exactly the cluster name of the managed cluster by design.

tpouyer avatar Apr 29 '20 16:04 tpouyer