From ddee69566f012df851ab11a581f4adb78c843e05 Mon Sep 17 00:00:00 2001 From: my-git9 Date: Wed, 13 Nov 2024 23:30:33 +0800 Subject: [PATCH] istioctl: add revision shortcode for analyze (#53339) * istioctl: add revision shortcode for analyze Signed-off-by: xin.li * add releasenote for add revision shortcode for analyze Signed-off-by: xin.li --------- Signed-off-by: xin.li --- istioctl/pkg/analyze/analyze.go | 10 +++++++++- releasenotes/notes/53339.yaml | 6 ++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/53339.yaml diff --git a/istioctl/pkg/analyze/analyze.go b/istioctl/pkg/analyze/analyze.go index d4e67dea819b..82d8d9369eab 100644 --- a/istioctl/pkg/analyze/analyze.go +++ b/istioctl/pkg/analyze/analyze.go @@ -77,6 +77,7 @@ var ( allNamespaces bool suppress []string analysisTimeout time.Duration + recursive bool ignoreUnknown bool revisionSpecified string remoteContexts []string @@ -127,6 +128,11 @@ func Analyze(ctx cli.Context) *cobra.Command { return nil } + if recursive { + fmt.Println("The recursive flag has been removed and is hardcoded to true without explicitly specifying it.") + return nil + } + readers, err := gatherFiles(cmd, args) if err != nil { return err @@ -330,9 +336,11 @@ func Analyze(ctx cli.Context) *cobra.Command { `You can include the wildcard character '*' to support a partial match (e.g. '--suppress "IST0102=DestinationRule *.default" ).`) analysisCmd.PersistentFlags().DurationVar(&analysisTimeout, "timeout", 30*time.Second, "The duration to wait before failing") + analysisCmd.PersistentFlags().BoolVarP(&recursive, "recursive", "R", false, + "[Removed: The recursive flag has been removed and is hardcoded to true] Process directory arguments recursively.") analysisCmd.PersistentFlags().BoolVar(&ignoreUnknown, "ignore-unknown", false, "Don't complain about un-parseable input documents, for cases where analyze should run only on k8s compliant inputs.") - analysisCmd.PersistentFlags().StringVarP(&revisionSpecified, "revision", "", "default", + analysisCmd.PersistentFlags().StringVarP(&revisionSpecified, "revision", "r", "default", "analyze a specific revision deployed.") analysisCmd.PersistentFlags().StringArrayVar(&remoteContexts, "remote-contexts", []string{}, `Kubernetes configuration contexts for remote clusters to be used in multi-cluster analysis. Not to be confused with '--context'. `+ diff --git a/releasenotes/notes/53339.yaml b/releasenotes/notes/53339.yaml new file mode 100644 index 000000000000..0033336505e7 --- /dev/null +++ b/releasenotes/notes/53339.yaml @@ -0,0 +1,6 @@ +apiVersion: release-notes/v2 +kind: feature +area: istioctl +releaseNotes: +- | + **Added** shortcode `-r` for `--revision` flags in `istioctl analyze`.