Skip to content

Commit

Permalink
Fix for some null environment names being created. (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattops authored Nov 6, 2023
1 parent 0b5627d commit 733ff0b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions github_discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def process_repo(**component):
pass
# Ingress alternative location
try:
host = values['generic-service']['ingress']['hosts'][0]
host = values['generic-service']['ingress']['hosts'][-1]
helm_envs.update({env: {'host': host}})
log.debug(f"{env} ingress host: {host}")
except KeyError:
Expand All @@ -245,7 +245,7 @@ def process_repo(**component):
pass
# Ingress alternative location
try:
host = values['ingress']['hosts'][0]['host']
host = values['ingress']['hosts'][-1]['host']
helm_envs.update({env: {'host': host}})
log.debug(f"{env} ingress host: {host}")
except KeyError:
Expand Down Expand Up @@ -313,7 +313,7 @@ def process_repo(**component):
env_type='preprod'
elif env_name.startswith('prod'):
env_type='prod'
e.update({'type': env_type})
e.update({'type': env_type, 'name': env_type})

if env_name in helm_envs:
env_url=f"https://{helm_envs[env_name]['host']}"
Expand All @@ -330,6 +330,9 @@ def process_repo(**component):
elif 'staging' in helm_envs:
env_url=f"https://{helm_envs['staging']['host']}"
e.update({'type': 'stage', 'name': 'staging', 'url': env_url})
elif 'qa' in helm_envs:
env_url=f"https://{helm_envs['qa']['host']}"
e.update({'type': 'preprod', 'name': 'qa', 'url': env_url})
elif 'production' in helm_envs:
env_url=f"https://{helm_envs['production']['host']}"
e.update({'type': 'prod', 'name': 'production', 'url': env_url})
Expand Down

0 comments on commit 733ff0b

Please sign in to comment.