From 0862655a10bab1dc555e687a1d377c12c91a90e2 Mon Sep 17 00:00:00 2001 From: Simon Walker Date: Wed, 25 Oct 2023 14:07:00 +0100 Subject: [PATCH 1/2] Rename all occurrances --- Makefile | 2 +- .../kafka_self_managed_cluster/docker-compose.yml | 4 ++-- docker-compose-pro.yml | 2 +- docker-compose.yml | 2 +- localstack/cli/localstack.py | 8 ++++---- localstack/config.py | 2 +- tests/unit/cli/test_cli.py | 2 +- tests/unit/test_dockerclient.py | 12 ++++++------ 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Makefile b/Makefile index 95f94892dd658..6ef508d4a5b88 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ PIP_CMD ?= pip3 TEST_PATH ?= . PYTEST_LOGLEVEL ?= DISABLE_BOTO_RETRIES ?= 1 -MAIN_CONTAINER_NAME ?= localstack_main +MAIN_CONTAINER_NAME ?= localstack-main MAJOR_VERSION = $(shell echo ${IMAGE_TAG} | cut -d '.' -f1) MINOR_VERSION = $(shell echo ${IMAGE_TAG} | cut -d '.' -f2) diff --git a/doc/external_services_integration/kafka_self_managed_cluster/docker-compose.yml b/doc/external_services_integration/kafka_self_managed_cluster/docker-compose.yml index 94870a4db1209..5bb0a94151715 100644 --- a/doc/external_services_integration/kafka_self_managed_cluster/docker-compose.yml +++ b/doc/external_services_integration/kafka_self_managed_cluster/docker-compose.yml @@ -51,7 +51,7 @@ services: - KAFKA_BROKERS=kafka:29092 localstack: - container_name: "${LOCALSTACK_DOCKER_NAME-localstack_main}" + container_name: "${LOCALSTACK_DOCKER_NAME-localstack-main}" image: localstack/localstack network_mode: bridge ports: @@ -69,4 +69,4 @@ services: - HOST_TMP_FOLDER=${TMPDIR} volumes: - "${TMPDIR:-/tmp/localstack}:/tmp/localstack" - - "/var/run/docker.sock:/var/run/docker.sock" \ No newline at end of file + - "/var/run/docker.sock:/var/run/docker.sock" diff --git a/docker-compose-pro.yml b/docker-compose-pro.yml index 3228f05247af8..37b8f79a658a5 100644 --- a/docker-compose-pro.yml +++ b/docker-compose-pro.yml @@ -2,7 +2,7 @@ version: "3.8" services: localstack: - container_name: "${LOCALSTACK_DOCKER_NAME-localstack_main}" + container_name: "${LOCALSTACK_DOCKER_NAME-localstack-main}" image: localstack/localstack-pro # required for Pro ports: - "127.0.0.1:4566:4566" # LocalStack Gateway diff --git a/docker-compose.yml b/docker-compose.yml index b19fcaf4da458..f0530732ac05b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.8" services: localstack: - container_name: "${LOCALSTACK_DOCKER_NAME-localstack_main}" + container_name: "${LOCALSTACK_DOCKER_NAME-localstack-main}" image: localstack/localstack ports: - "127.0.0.1:4566:4566" # LocalStack Gateway diff --git a/localstack/cli/localstack.py b/localstack/cli/localstack.py index 976f6bba63a5f..fe8785d8fc493 100644 --- a/localstack/cli/localstack.py +++ b/localstack/cli/localstack.py @@ -552,7 +552,7 @@ def cmd_stop() -> None: Stops the current LocalStack runtime. This command stops the currently running LocalStack docker container. - By default, this command looks for a container named `localstack_main` (which is the default + By default, this command looks for a container named `localstack-main` (which is the default container name used by the `localstack start` command). If your LocalStack container has a different name, set the config variable `MAIN_CONTAINER_NAME`. @@ -597,7 +597,7 @@ def cmd_logs(follow: bool, tail: int) -> None: Show the logs of the current LocalStack runtime. This command shows the logs of the currently running LocalStack docker container. - By default, this command looks for a container named `localstack_main` (which is the default + By default, this command looks for a container named `localstack-main` (which is the default container name used by the `localstack start` command). If your LocalStack container has a different name, set the config variable `MAIN_CONTAINER_NAME`. @@ -647,7 +647,7 @@ def cmd_wait(timeout: Optional[float] = None) -> None: This commands waits for a started LocalStack runtime to be up and running, ready to serve requests. - By default, this command looks for a container named `localstack_main` (which is the default + By default, this command looks for a container named `localstack-main` (which is the default container name used by the `localstack start` command). If your LocalStack container has a different name, set the config variable `MAIN_CONTAINER_NAME`. @@ -665,7 +665,7 @@ def cmd_ssh() -> None: Obtain a shell in the current LocalStack runtime. This command starts a new interactive shell in the currently running LocalStack container. - By default, this command looks for a container named `localstack_main` (which is the default + By default, this command looks for a container named `localstack-main` (which is the default container name used by the `localstack start` command). If your LocalStack container has a different name, set the config variable `MAIN_CONTAINER_NAME`. diff --git a/localstack/config.py b/localstack/config.py index 4f4eafeb1439a..d5313cb97c3ca 100644 --- a/localstack/config.py +++ b/localstack/config.py @@ -730,7 +730,7 @@ def legacy_fallback(envar_name: str, default: T) -> T: os.environ["MOTO_ALLOW_NONEXISTENT_REGION"] = "true" # name of the main Docker container -MAIN_CONTAINER_NAME = os.environ.get("MAIN_CONTAINER_NAME", "").strip() or "localstack_main" +MAIN_CONTAINER_NAME = os.environ.get("MAIN_CONTAINER_NAME", "").strip() or "localstack-main" # the latest commit id of the repository when the docker image was created LOCALSTACK_BUILD_GIT_HASH = os.environ.get("LOCALSTACK_BUILD_GIT_HASH", "").strip() or None diff --git a/tests/unit/cli/test_cli.py b/tests/unit/cli/test_cli.py index 7c1f92ad1eb59..08ac474bfadf0 100644 --- a/tests/unit/cli/test_cli.py +++ b/tests/unit/cli/test_cli.py @@ -146,7 +146,7 @@ def test_validate_config(runner, monkeypatch, tmp_path): """version: "3.3" services: localstack: - container_name: "${LOCALSTACK_DOCKER_NAME-localstack_main}" + container_name: "${LOCALSTACK_DOCKER_NAME-localstack-main}" image: localstack/localstack network_mode: bridge ports: diff --git a/tests/unit/test_dockerclient.py b/tests/unit/test_dockerclient.py index e3ad7548e694b..00df5a069d601 100644 --- a/tests/unit/test_dockerclient.py +++ b/tests/unit/test_dockerclient.py @@ -29,7 +29,7 @@ def test_list_containers(self, run_mock): mock_container = { "ID": "00000000a1", "Image": "localstack/localstack", - "Names": "localstack_main", + "Names": "localstack-main", "Labels": "authors=LocalStack Contributors", "State": "running", } @@ -52,16 +52,16 @@ def test_list_containers(self, run_mock): @patch("localstack.utils.container_utils.docker_cmd_client.run") def test_container_status(self, run_mock): - test_output = "Up 2 minutes - localstack_main" + test_output = "Up 2 minutes - localstack-main" run_mock.return_value = test_output docker_client = CmdDockerClient() - status = docker_client.get_container_status("localstack_main") + status = docker_client.get_container_status("localstack-main") assert status == DockerContainerStatus.UP - run_mock.return_value = "Exited (0) 1 minute ago - localstack_main" - status = docker_client.get_container_status("localstack_main") + run_mock.return_value = "Exited (0) 1 minute ago - localstack-main" + status = docker_client.get_container_status("localstack-main") assert status == DockerContainerStatus.DOWN run_mock.return_value = "STATUS NAME" - status = docker_client.get_container_status("localstack_main") + status = docker_client.get_container_status("localstack-main") assert status == DockerContainerStatus.NON_EXISTENT From 8bc385afe25dba1baacce74a958e2ea931aea607 Mon Sep 17 00:00:00 2001 From: Simon Walker Date: Tue, 31 Oct 2023 20:56:18 +0000 Subject: [PATCH 2/2] Commit to re-trigger CI