Skip to content

Commit

Permalink
allow go previous is none (#1182)
Browse files Browse the repository at this point in the history
* remove update previous golang
  • Loading branch information
Ximinhan authored Dec 6, 2024
1 parent 32e38b6 commit 64acbe7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pyartcd/pyartcd/pipelines/update_golang.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ async def update_golang_streams(self, go_version, builder_nvrs):
streams_content = yaml.load(upstream_repo.get_contents("streams.yml", ref=branch).decoded_content)
group_content = yaml.load(upstream_repo.get_contents("group.yml", ref=branch).decoded_content)
go_latest = group_content['vars']['GO_LATEST']
go_previous = group_content['vars']['GO_PREVIOUS']
go_previous = group_content['vars'].get('GO_PREVIOUS', None)
update_streams = update_group = False
# This is to bump minor golang for GO_LATEST
if go_version == go_latest:
Expand All @@ -327,7 +327,7 @@ async def update_golang_streams(self, go_version, builder_nvrs):
for el_v, builder_nvr in builder_nvrs:
parsed_nvr = parse_nvr(builder_nvr)
latest_go = streams_content[f'rhel-{el_v}-golang']['image']
previous_go = streams_content[f'rhel-{el_v}-golang-{go_previous}']['image']
previous_go = streams_content[f'rhel-{el_v}-golang-{go_previous}']['image'] if go_previous else None
new_latest_go = f'{latest_go.split(":")[0]}:{parsed_nvr["version"]}-{parsed_nvr["release"]}'
for stream, info in streams_content.items():
if info['image'] == latest_go:
Expand All @@ -336,7 +336,8 @@ async def update_golang_streams(self, go_version, builder_nvrs):
info['image'] = latest_go
group_content['vars']['GO_LATEST'] = go_version
group_content['vars']['GO_EXTRA'] = go_version
group_content['vars']['GO_PREVIOUS'] = go_latest
if go_previous:
group_content['vars']['GO_PREVIOUS'] = go_latest
update_streams = update_group = True
# save changes and create pr
if update_streams:
Expand Down

0 comments on commit 64acbe7

Please sign in to comment.