Skip to content
This repository has been archived by the owner on Mar 12, 2024. It is now read-only.

Commit

Permalink
feat: Prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
jdmulloy committed Sep 14, 2023
1 parent 104fd89 commit 2fe407d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scripts/configure_gocd_elastic_agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,11 @@ 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('--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, templates_dir, apply):
def configure_gocd_agents(token, host, agent_tag, profile_id, prefix, templates_dir, apply):
"""
For the specified profile update the pod yaml with a rendered jina2 templat
"""
Expand All @@ -89,7 +90,7 @@ def configure_gocd_agents(token, host, agent_tag, profile_id, templates_dir, app
)
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)
new_pod_config = j2_template.render(agent_tag=agent_tag, prefix=prefix)
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)
Expand Down

0 comments on commit 2fe407d

Please sign in to comment.