Skip to content

Commit

Permalink
Merge pull request #4836 from sgibson91/debug-flag
Browse files Browse the repository at this point in the history
Add an optional debug flag to validate commands running helm template
  • Loading branch information
sgibson91 authored Sep 18, 2024
2 parents a99bc28 + 15eb219 commit 1008bfd
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions deployer/commands/validate/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ def cluster_config(
def hub_config(
cluster_name: str = typer.Argument(..., help="Name of cluster to operate on"),
hub_name: str = typer.Argument(None, help="Name of hub to operate on"),
skip_refresh: bool = typer.Argument(False, help="Skip the helm dep update"),
skip_refresh: bool = typer.Option(
False, "--skip-refresh", help="Skip the helm dep update"
),
debug: bool = typer.Option(False, "--debug", help="Enable verbose output"),
):
"""
Validates the provided non-encrypted helm chart values files for each hub of
Expand All @@ -125,6 +128,9 @@ def hub_config(
"template",
str(HELM_CHARTS_DIR.joinpath(hub.spec["helm_chart"])),
]
if debug:
cmd.append("--debug")

for values_file in hub.spec["helm_chart_values_files"]:
if "secret" not in os.path.basename(values_file):
values_file = config_file_path.parent.joinpath(values_file)
Expand All @@ -149,6 +155,7 @@ def hub_config(
@validate_app.command()
def support_config(
cluster_name: str = typer.Argument(..., help="Name of cluster to operate on"),
debug: bool = typer.Option(False, "--debug", help="Enable verbose output"),
):
"""
Validates the provided non-encrypted helm chart values files for the support chart
Expand All @@ -170,6 +177,8 @@ def support_config(
"template",
str(HELM_CHARTS_DIR.joinpath("support")),
]
if debug:
cmd.append("--debug")

for values_file in cluster.support["helm_chart_values_files"]:
if "secret" not in os.path.basename(values_file):
Expand Down Expand Up @@ -317,11 +326,15 @@ def configurator_config(
def all(
cluster_name: str = typer.Argument(..., help="Name of cluster to operate on"),
hub_name: str = typer.Argument(None, help="Name of hub to operate on"),
skip_refresh: bool = typer.Option(
False, "--skip-refresh", help="Skip the helm dep update"
),
debug: bool = typer.Option(False, "--debug", help="Enable verbose output"),
):
"""
Validate cluster.yaml and non-encrypted helm config for given hub
"""
cluster_config(cluster_name)
support_config(cluster_name)
hub_config(cluster_name, hub_name)
support_config(cluster_name, debug=debug)
hub_config(cluster_name, hub_name, skip_refresh=skip_refresh, debug=debug)
authenticator_config(cluster_name, hub_name)

0 comments on commit 1008bfd

Please sign in to comment.