Skip to content

Commit ccbba8e

Browse files
committed
Added enpoint part in updating build_image_tag
1 parent 4e93e1c commit ccbba8e

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

health_ping.py

+15-14
Original file line numberDiff line numberDiff line change
@@ -96,20 +96,21 @@ def update_app_version(app_version, c_name, e_name, github_repo):
9696
# Always update the latest version key
9797
redis.json().set('latest:versions', f'$.{version_key}', version_data)
9898
log.info(f'Updating redis key with latest version. {version_key} = {version_data}')
99-
env_data = []
100-
update_sc = False
101-
for e in component["attributes"]["environments"]:
102-
if e_name == e["name"]:
103-
if e["build_image_tag"] is None:
104-
e["build_image_tag"] = []
105-
if app_version != e["build_image_tag"]:
106-
env_data.append({"id": e["id"], "build_image_tag": app_version })
107-
update_sc = True
108-
else:
109-
env_data.append({"id": e["id"]})
110-
if update_sc:
111-
data = {"environments": env_data}
112-
update_sc_component(c_id, data)
99+
if (endpoint_type == 'info'):
100+
env_data = []
101+
update_sc = False
102+
for e in component["attributes"]["environments"]:
103+
if e_name == e["name"]:
104+
if e["build_image_tag"] is None:
105+
e["build_image_tag"] = []
106+
if app_version != e["build_image_tag"]:
107+
env_data.append({"id": e["id"], "build_image_tag": app_version })
108+
update_sc = True
109+
else:
110+
env_data.append({"id": e["id"]})
111+
if update_sc:
112+
data = {"environments": env_data}
113+
update_sc_component(c_id, data)
113114

114115
except Exception as e:
115116
log.error(e)

0 commit comments

Comments
 (0)