diff --git a/scripts/configure_gocd_elastic_agents.py b/scripts/configure_gocd_elastic_agents.py index da6e9588..5221d771 100755 --- a/scripts/configure_gocd_elastic_agents.py +++ b/scripts/configure_gocd_elastic_agents.py @@ -75,11 +75,12 @@ def update_image_in_elastic_profile(host, token, profile_id, new_pod_config, app @click.option('--token', help='gocd auth token', required=True) @click.option('--agent-tag', help='new tag of the image to replace', required=True) @click.option('--profile-id', help='new tag of the image to replace', required=True, multiple=True) -@click.option('--prefix', help='Optional prefix for test-gocd', default='') +@click.option('--image-name', help='Container image name', default='go-agent') +@click.option('--namespace', help='Kubernetes namespace of the gocd server', default='gocd') @click.option('--templates-dir', help='Directory holding Jinja2 template files for pod configuration', required=True) @click.option('--apply', is_flag=True, default=False, help='Must be present to actually apply chagnes, otherwise we will only print a diff and exit', required=True) -def configure_gocd_agents(token, host, agent_tag, profile_id, prefix, templates_dir, apply): +def configure_gocd_agents(token, host, agent_tag, profile_id, namespace, image_name, templates_dir, apply): """ For the specified profile update the pod yaml with a rendered jina2 templat """ @@ -90,7 +91,7 @@ def configure_gocd_agents(token, host, agent_tag, profile_id, prefix, templates_ ) j2_template = j2_environment.get_template(f"{profile_id}.yaml.j2") #print(j2_template.render(image=image, tag=tag)) - new_pod_config = j2_template.render(agent_tag=agent_tag, prefix=prefix) + new_pod_config = j2_template.render(agent_tag=agent_tag, namespace=namespace, image_name=image_name) try: logging.info(f"Updating agent profile {profile_id} with agent image tag {agent_tag}") update_image_in_elastic_profile(host, token, profile_id, new_pod_config, apply)