cnti-testcatalog / testsuite

📞📱☎️📡🌐 Cloud Native Telecom Initiative (CNTI) Test Catalog is a tool to check for and provide feedback on the use of K8s + cloud native best practices in networking applications and platforms
https://wiki.lfnetworking.org/display/LN/Test+Catalog
Apache License 2.0
169 stars 70 forks source link

[BUG] cluster_api_cleanup leaves some resources hanging #1983

Open svteb opened 2 months ago

svteb commented 2 months ago

Describe the bug The cluster resource is stuck in deleting state after running cluster_api_cleanup.

kubectl get cluster
NAME              CLUSTERCLASS   PHASE      AGE   VERSION
capi-quickstart   quick-start    Deleting   61m   v1.23.0

The reason for this seems to be the finalizer cluster.cluster.x-k8s.io:

kubectl describe cluster capi-quickstart
Name:         capi-quickstart
Namespace:    default
Labels:       cluster.x-k8s.io/cluster-name=capi-quickstart
              topology.cluster.x-k8s.io/owned=
Annotations:  <none>
API Version:  cluster.x-k8s.io/v1beta1
Kind:         Cluster
Metadata:
  Creation Timestamp:             2024-04-17T08:01:11Z
  Deletion Grace Period Seconds:  0
  Deletion Timestamp:             2024-04-17T08:58:31Z
  Finalizers:
    cluster.cluster.x-k8s.io  <---------------------- offender
  Generation:  3
  Managed Fields:

To Reproduce I've first come across this when running spec tests (which caused the spec test "'clusterapi_enabled' should fail if cluster api is not installed" to not pass for me because of the cluster still being present after failed cleanup).

  1. ./cnf-testsuite setup
  2. ./cnf-testsuite cluster_api_setup
  3. ./cnf-testsuite cluster_api_cleanup
  4. kubectl get cluster

Expected behavior Might be an issue of my environment, but even then the cleanup should check if it did delete everything/delete harder.

Device: Linux, Ubuntu server 22.04, x86 fails on both kind and minikube kind version: v0.22.0 minikube version: v1.32.0 kubectl version: v1.23.13

Once this issue is address how will the fix be verified? There will be no clusterapi resources left in the cluster.