Skip to content

Commit

Permalink
undo changes - delete seems to work now
Browse files Browse the repository at this point in the history
  • Loading branch information
FxKu committed Aug 6, 2024
1 parent ec243cb commit f2bcaee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
5 changes: 1 addition & 4 deletions e2e/tests/k8s_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,7 @@ def count_services_with_label(self, labels, namespace='default'):
return len(self.api.core_v1.list_namespaced_service(namespace, label_selector=labels).items)

def count_endpoints_with_label(self, labels, namespace='default'):
eps = self.api.core_v1.list_namespaced_endpoints(namespace, label_selector=labels).items
for ep in eps:
print("found endpoint: {}".format(ep.metadata.name))
return len(eps)
return len(self.api.core_v1.list_namespaced_endpoints(namespace, label_selector=labels).items)

def count_secrets_with_label(self, labels, namespace='default'):
return len(self.api.core_v1.list_namespaced_secret(namespace, label_selector=labels).items)
Expand Down
7 changes: 3 additions & 4 deletions e2e/tests/test_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -2187,7 +2187,7 @@ def test_taint_based_eviction(self):
self.assert_distributed_pods(master_nodes)

@timeout_decorator.timeout(TEST_TIMEOUT_SEC)
def test_aa_cluster_deletion(self):
def test_zz_cluster_deletion(self):
'''
Test deletion with configured protection
'''
Expand Down Expand Up @@ -2258,10 +2258,9 @@ def test_aa_cluster_deletion(self):
self.eventuallyEqual(lambda: k8s.count_statefulsets_with_label(cluster_label), 0, "Statefulset not deleted")
self.eventuallyEqual(lambda: k8s.count_deployments_with_label(cluster_label), 0, "Deployments not deleted")
self.eventuallyEqual(lambda: k8s.count_pdbs_with_label(cluster_label), 0, "Pod disruption budget not deleted")
# self.eventuallyEqual(lambda: k8s.count_secrets_with_label(cluster_label), 8, "Secrets were deleted although disabled in config")
# self.eventuallyEqual(lambda: k8s.count_pvcs_with_label(cluster_label), 3, "PVCs were deleted although disabled in config")
self.eventuallyEqual(lambda: k8s.count_secrets_with_label(cluster_label), 8, "Secrets were deleted although disabled in config")
self.eventuallyEqual(lambda: k8s.count_pvcs_with_label(cluster_label), 3, "PVCs were deleted although disabled in config")
self.eventuallyEqual(lambda: k8s.count_services_with_label(cluster_label), 0, "Service not deleted")
print('Operator log: {}'.format(k8s.get_operator_log()))
self.eventuallyEqual(lambda: k8s.count_endpoints_with_label(cluster_label), 0, "Endpoints not deleted")

except timeout_decorator.TimeoutError:
Expand Down

0 comments on commit f2bcaee

Please sign in to comment.