From 56df30ad48b80d6d42a64a210aa40c5d5f550fd8 Mon Sep 17 00:00:00 2001 From: Elior Erez Date: Mon, 2 May 2022 16:37:26 +0300 Subject: [PATCH] NO-ISSUE - Add the ability to override image-service image when deploying the assisted-image-service --- deploy/assisted-image-service.yaml | 2 +- tools/deploy_image_service.py | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/deploy/assisted-image-service.yaml b/deploy/assisted-image-service.yaml index 5888ee10830..22410c28fcf 100644 --- a/deploy/assisted-image-service.yaml +++ b/deploy/assisted-image-service.yaml @@ -27,7 +27,7 @@ items: requests: cpu: 100m memory: 400Mi - image: quay.io/edge-infrastructure/assisted-image-service:latest + image: REPLACE_IMAGE_SERVICE_IMAGE ports: - containerPort: 8080 readinessProbe: diff --git a/tools/deploy_image_service.py b/tools/deploy_image_service.py index ee1c8a6279b..4aba63297ef 100644 --- a/tools/deploy_image_service.py +++ b/tools/deploy_image_service.py @@ -1,8 +1,10 @@ -import os -import utils import argparse +import os + import yaml + import deployment_options +import utils parser = argparse.ArgumentParser() deploy_options = deployment_options.load_deployment_options(parser) @@ -11,13 +13,17 @@ SRC_FILE = os.path.join(os.getcwd(), 'deploy/assisted-image-service.yaml') DST_FILE = os.path.join(os.getcwd(), 'build', deploy_options.namespace, 'assisted-image-service.yaml') + def main(): utils.verify_build_directory(deploy_options.namespace) with open(SRC_FILE, "r") as src: + log.info(f"Loading source template file for assisted-image-service: {SRC_FILE}") raw_data = src.read() raw_data = raw_data.replace('REPLACE_NAMESPACE', f'"{deploy_options.namespace}"') + raw_data = raw_data.replace('REPLACE_IMAGE_SERVICE_IMAGE', os.environ.get("IMAGE_SERVICE")) data = yaml.safe_load(raw_data) + log.info(data) with open(DST_FILE, "w+") as dst: yaml.dump(data, dst, default_flow_style=False) @@ -32,5 +38,6 @@ def main(): file=DST_FILE ) + if __name__ == "__main__": main()