Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NO-ISSUE - Add the ability to override image-service image when deploying the assisted-image-service #3737

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deploy/assisted-image-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
11 changes: 9 additions & 2 deletions tools/deploy_image_service.py
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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)
Expand All @@ -32,5 +38,6 @@ def main():
file=DST_FILE
)


if __name__ == "__main__":
main()