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

Commit

Permalink
remove prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
jdmulloy committed Sep 20, 2023
1 parent 2fe407d commit a85b6c0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts/configure_gocd_elastic_agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""
Expand All @@ -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)
Expand Down

0 comments on commit a85b6c0

Please sign in to comment.