From 9b1b5e8a51de06331d129f77ce8787d265d07043 Mon Sep 17 00:00:00 2001 From: Stefan Prodan Date: Fri, 13 Dec 2024 18:40:02 +0200 Subject: [PATCH] Add name completion to debug commands Signed-off-by: Stefan Prodan --- cmd/flux/debug_helmrelease.go | 6 +++--- cmd/flux/debug_kustomization.go | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/flux/debug_helmrelease.go b/cmd/flux/debug_helmrelease.go index 7a5c934d..4f6a9d8a 100644 --- a/cmd/flux/debug_helmrelease.go +++ b/cmd/flux/debug_helmrelease.go @@ -42,12 +42,12 @@ WARNING: This command will print sensitive information if Kubernetes Secrets are # Export the final values of a Helm release composed from referred ConfigMaps and Secrets flux debug hr podinfo --show-values > values.yaml`, - RunE: debugHelmReleaseCmdRun, - Args: cobra.ExactArgs(1), + RunE: debugHelmReleaseCmdRun, + Args: cobra.ExactArgs(1), + ValidArgsFunction: resourceNamesCompletionFunc(helmv2.GroupVersion.WithKind(helmv2.HelmReleaseKind)), } type debugHelmReleaseFlags struct { - name string showStatus bool showValues bool } diff --git a/cmd/flux/debug_kustomization.go b/cmd/flux/debug_kustomization.go index 10366005..86050564 100644 --- a/cmd/flux/debug_kustomization.go +++ b/cmd/flux/debug_kustomization.go @@ -44,12 +44,12 @@ WARNING: This command will print sensitive information if Kubernetes Secrets are # Export the final variables used for post-build substitutions composed from referred ConfigMaps and Secrets flux debug ks podinfo --show-vars > vars.env`, - RunE: debugKustomizationCmdRun, - Args: cobra.ExactArgs(1), + RunE: debugKustomizationCmdRun, + Args: cobra.ExactArgs(1), + ValidArgsFunction: resourceNamesCompletionFunc(kustomizev1.GroupVersion.WithKind(kustomizev1.KustomizationKind)), } type debugKustomizationFlags struct { - name string showStatus bool showVars bool }