Skip to content

Commit

Permalink
Deal with errant ClusterRole left behind
Browse files Browse the repository at this point in the history
  • Loading branch information
macobo committed Jan 27, 2022
1 parent 72279c4 commit 90a4ef6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ci/kubetest/test_clickhouse_connectivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from utils import (
NAMESPACE,
VALUES_DISABLE_EVERYTHING,
cleanup_helm,
cleanup_k8s,
exec_subprocess,
install_chart,
Expand Down Expand Up @@ -113,4 +114,5 @@ def verify_can_connect_to_clickhouse(kube):

@pytest.fixture(autouse=True)
def before_each_cleanup():
cleanup_k8s(["default", NAMESPACE, "clickhouse"])
cleanup_k8s([NAMESPACE, "clickhouse"])
cleanup_helm([NAMESPACE, "clickhouse"])
6 changes: 6 additions & 0 deletions ci/kubetest/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ def cleanup_k8s(namespaces=["default", NAMESPACE]):
pytest.fail("❌ Error while running '{}'. Return code: {}".format(cmd, cmd_return_code))
log.debug("✅ Done!")

def cleanup_helm(namespaces=[NAMESPACE]):
log.debug("🔄 Making sure helm releases get removed...")
for namespace in namespaces:
exec_subprocess(f"helm uninstall posthog --namespace {namespace}")
log.debug("✅ Done!")


def helm_install(HELM_INSTALL_CMD):
log.debug("🔄 Deploying PostHog...")
Expand Down

0 comments on commit 90a4ef6

Please sign in to comment.