diff --git a/localstack_utils/container.py b/localstack_utils/container.py index 8d96bb7..bb88fde 100644 --- a/localstack_utils/container.py +++ b/localstack_utils/container.py @@ -7,7 +7,7 @@ from time import sleep LOCALSTACK_IMAGE_NAME = "localstack/localstack-pro" -LATEST_TAG = "latest" +DEV_TAG = "dev" MAX_PORT_CONNECTION_ATTEMPTS = 10 MAX_LOG_COLLECTION_ATTEMPTS = 120 @@ -29,7 +29,7 @@ def create_localstack_container( *args, pull_new_image: bool = False, image_name: str = LOCALSTACK_IMAGE_NAME, - image_tag: str = LATEST_TAG, + image_tag: str = DEV_TAG, container_name: str = DEFAULT_CONTAINER_ID, gateway_listen: str = "0.0.0.0:4566", auto_remove: bool = False, @@ -39,8 +39,12 @@ def create_localstack_container( ): environment_variables = environment_variables or {} environment_variables["GATEWAY_LISTEN"] = gateway_listen - if "LOCALSTACK_AUTH_TOKEN" not in environment_variables and os.environ.get("LOCALSTACK_AUTH_TOKEN"): - environment_variables["LOCALSTACK_AUTH_TOKEN"] = os.environ["LOCALSTACK_AUTH_TOKEN"] + if "LOCALSTACK_AUTH_TOKEN" not in environment_variables and os.environ.get( + "LOCALSTACK_AUTH_TOKEN" + ): + environment_variables["LOCALSTACK_AUTH_TOKEN"] = os.environ[ + "LOCALSTACK_AUTH_TOKEN" + ] image_exists = ( True if len(DOCKER_CLIENT.images.list(name=image_name)) else False @@ -51,7 +55,7 @@ def create_localstack_container( bind_ports.update({gateway_port: gateway_port}) if pull_new_image or not image_exists: - logging.info("Pulling latest image") + logging.info("Pulling latest development image") DOCKER_CLIENT.images.pull(image_name, image_tag) return DOCKER_CLIENT.containers.run( diff --git a/localstack_utils/localstack.py b/localstack_utils/localstack.py index 353aae4..7164fc0 100644 --- a/localstack_utils/localstack.py +++ b/localstack_utils/localstack.py @@ -1,7 +1,7 @@ import re import docker import logging -from localstack_utils.container import Container +from localstack_utils.container import DEV_TAG, Container from localstack_utils.localstack_docker_configuration import ( LocalstackDockerConfiguration, ) @@ -71,7 +71,7 @@ def setup_logger(self): def startup_localstack( image_name="", - tag="", + tag=DEV_TAG, container_name="", pro=False, ports=None,