Skip to content

Commit

Permalink
istioctl: add revision shortcode for analyze (istio#53339)
Browse files Browse the repository at this point in the history
* istioctl: add revision shortcode for analyze

Signed-off-by: xin.li <xin.li@daocloud.io>

* add releasenote for add revision shortcode for analyze

Signed-off-by: xin.li <xin.li@daocloud.io>

---------

Signed-off-by: xin.li <xin.li@daocloud.io>
  • Loading branch information
my-git9 authored Nov 13, 2024
1 parent 14d2283 commit ddee695
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
10 changes: 9 additions & 1 deletion istioctl/pkg/analyze/analyze.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ var (
allNamespaces bool
suppress []string
analysisTimeout time.Duration
recursive bool
ignoreUnknown bool
revisionSpecified string
remoteContexts []string
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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'. `+
Expand Down
6 changes: 6 additions & 0 deletions releasenotes/notes/53339.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: release-notes/v2
kind: feature
area: istioctl
releaseNotes:
- |
**Added** shortcode `-r` for `--revision` flags in `istioctl analyze`.

0 comments on commit ddee695

Please sign in to comment.