Skip to content

Commit

Permalink
Only tag :latest image when default python version is used (#34182)
Browse files Browse the repository at this point in the history
We should only tag :latest image when default image is used because
this step always tags `apache/airflow:X.Y.Z` (defaulti Python) to become
the `apache/airflow:latest`. This step was previously run for all Python
versions which could have two effects:

* if non-default image completed before the default such tagging
  would fail as the `apache/airflow:X.Y.Z` was not ready yet to
  be used as target of `apache/airflow:latesti` tag

* if non-default image completed later, it would be no-op because
  the `apache/airflow:latest` already pointed to `apache/airflow:X.Y.Z`
  • Loading branch information
potiuk authored Sep 7, 2023
1 parent ff23a30 commit 51d8b10
Showing 1 changed file with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1087,16 +1087,19 @@ def release_prod_images(
f"{dockerhub_repo}:{airflow_version}-python{python}",
f"{dockerhub_repo}:latest-python{python}",
)
if slim_images:
alias_image(
f"{dockerhub_repo}:slim-{airflow_version}",
f"{dockerhub_repo}:slim-latest",
)
else:
alias_image(
f"{dockerhub_repo}:{airflow_version}",
f"{dockerhub_repo}:latest",
)
if python == DEFAULT_PYTHON_MAJOR_MINOR_VERSION:
# only tag latest "default" image when we build default python version
# otherwise if the non-default images complete before the default one, their jobs will fail
if slim_images:
alias_image(
f"{dockerhub_repo}:slim-{airflow_version}",
f"{dockerhub_repo}:slim-latest",
)
else:
alias_image(
f"{dockerhub_repo}:{airflow_version}",
f"{dockerhub_repo}:latest",
)


def is_package_in_dist(dist_files: list[str], package: str) -> bool:
Expand Down

0 comments on commit 51d8b10

Please sign in to comment.