From e9545b4297afa52e425d37afc0c59beccb9dcec5 Mon Sep 17 00:00:00 2001 From: Walter Behmann Date: Thu, 28 Nov 2024 14:30:31 +0100 Subject: [PATCH] Changed download URLs for dc_util --- crate/operator/create.py | 10 +++++----- tests/test_create.py | 5 ++++- utils/dc_util/README.md | 12 ++++++------ 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/crate/operator/create.py b/crate/operator/create.py index f815d96a..8f8d6921 100644 --- a/crate/operator/create.py +++ b/crate/operator/create.py @@ -388,12 +388,12 @@ def get_statefulset_containers( "/bin/sh", "-c", "curl -sLO " - "https://raw.githubusercontent.com/crate/crate-operator/master/dc_util && " # noqa + "https://github.com/crate/crate-operator/releases/download/dc_util_v1.0.0/dc_util-linux-amd64 && " # noqa "curl -sLO " - "https://raw.githubusercontent.com/crate/crate-operator/master/dc_util && " # noqa - "sha256sum -c dc_util.sha256 && " - "chmod u+x ./dc_util && \n" - "./dc_util -min-availability PRIMARIES " + "https://github.com/crate/crate-operator/releases/download/dc_util_v1.0.0/dc_util-linux-amd64.sha256 && " # noqa + "sha256sum -c dc_util-linux-amd64.sha256 && " + "chmod u+x ./dc_util-linux-amd64 && \n" + "./dc_util-linux-amd64 -min-availability PRIMARIES " f"-timeout {DECOMMISSION_TIMEOUT}", ] ) diff --git a/tests/test_create.py b/tests/test_create.py index a7fecb06..3e82ed3a 100644 --- a/tests/test_create.py +++ b/tests/test_create.py @@ -1641,7 +1641,10 @@ def test_get_cluster_resource_limits(node_spec, expected_limits_cpu): @pytest.mark.asyncio async def test_download_dc_util(): - url = "https://raw.githubusercontent.com/crate/crate-operator/master/dc_util" + url = ( + "https://github.com/crate/crate-operator/releases/download/dc_util_v1.0.0/" + "dc_util-linux-amd64" + ) async with aiohttp.ClientSession() as session: async with session.get(url) as response: assert response.status == 200, f"Expected status 200, got {response.status}" diff --git a/utils/dc_util/README.md b/utils/dc_util/README.md index 9049b55c..b8ae3e20 100644 --- a/utils/dc_util/README.md +++ b/utils/dc_util/README.md @@ -29,7 +29,7 @@ to the ServiceAccount: This needs to be created/setup manually, or by the crate-operator. When the decommission is sent to the cluster the command almost immediately returns. Nevertheless -cratedb started the decommissioning in the background andwe need to wait until cratedb +cratedb started the decommissioning in the background and we need to wait until cratedb exit's. After that control is _returned_ to`kubelet` which continues by sending SIGTERM. `Termination Grace Period` needs to be set longer than the decomission timeout, as @@ -50,11 +50,11 @@ to the cratedb containers configuration: - /bin/sh - -c - | - curl -sLO https://raw.githubusercontent.com/crate/crate-operator/master/dc_util && \ - curl -sLO https://raw.githubusercontent.com/crate/crate-operator/master/dc_util.sha256 && \ - sha256sum -c dc_util.sha256 && \ - chmod u+x ./dc_util && \ - ./dc_util -min-availability PRIMARIES + curl -sLO https://github.com/crate/crate-operator/releases/download/dc_util_v1.0.0/dc_util-linux-amd64 && \ + curl -sLO https://github.com/crate/crate-operator/releases/download/dc_util_v1.0.0/dc_util-linux-amd64.sha256 && \ + sha256sum -c dc_util-linux-amd64.sha256 && \ + chmod u+x ./dc_util-linux-amd64 && \ + ./dc_util-linux-amd64 -min-availability PRIMARIES terminationGracePeriodSeconds: 7230