Skip to content

Commit

Permalink
Remove no longer used function
Browse files Browse the repository at this point in the history
  • Loading branch information
sgibson91 committed Dec 16, 2024
1 parent 6f6bfaf commit 8621b4f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 48 deletions.
47 changes: 0 additions & 47 deletions deployer/commands/generate/helm_upgrade/decision.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,53 +285,6 @@ def generate_support_matrix_jobs(
return matrix_jobs


def ensure_support_staging_jobs_have_correct_keys(
support_and_staging_matrix_jobs, prod_hub_matrix_jobs
):
"""This function ensures that all entries in support_and_staging_matrix_jobs have
the expected upgrade_staging and reason_for_staging_redeploy keys, even if they are
set to false/empty.
Args:
support_and_staging_matrix_jobs (list[dict]): A list of dictionaries
representing jobs to upgrade the support chart and staging hub on clusters
that require it.
prod_hub_matrix_jobs (list[dict]): A list of dictionaries representing jobs to
upgrade production hubs that require it.
Returns:
support_and_staging_matrix_jobs (list[dict]): Updated to ensure each entry has
the upgrade_staging and reason_for_staging_redeploy keys, even if they are
false/empty.
"""
# For each job listed in support_and_staging_matrix_jobs, ensure it has the
# upgrade_staging key present, even if we just set it to False
for job in support_and_staging_matrix_jobs:
if "upgrade_staging" not in job.keys():
# Get a list of prod hubs running on the same cluster this staging job will
# run on
hubs_on_this_cluster = [
hub["hub_name"]
for hub in prod_hub_matrix_jobs
if hub["cluster_name"] == job["cluster_name"]
]
if hubs_on_this_cluster:
# There are prod hubs on this cluster that require an upgrade, and so we
# also upgrade staging
job["upgrade_staging"] = True
job["reason_for_staging_redeploy"] = (
"Following prod hubs require redeploy: "
+ ", ".join(hubs_on_this_cluster)
)
else:
# There are no prod hubs on this cluster that require an upgrade, so we
# do not upgrade staging
job["upgrade_staging"] = False
job["reason_for_staging_redeploy"] = ""

return support_and_staging_matrix_jobs


def assign_staging_jobs_for_missing_clusters(
staging_hub_matrix_jobs, prod_hub_matrix_jobs
):
Expand Down
1 change: 0 additions & 1 deletion deployer/commands/generate/helm_upgrade/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from .decision import (
assign_staging_jobs_for_missing_clusters,
discover_modified_common_files,
ensure_support_staging_jobs_have_correct_keys,
generate_hub_matrix_jobs,
generate_support_matrix_jobs,
pretty_print_matrix_jobs,
Expand Down

0 comments on commit 8621b4f

Please sign in to comment.