Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an optional debug flag to validate commands running helm template #4836

Merged
merged 2 commits into from
Sep 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)