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 PodMetrics as excluded resource by default #51

Merged
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ namespaced resources.
More on https://github.com/corneliusweig/ketall/blob/v1.3.0/doc/USAGE.md#usage
`
ketallExamples = `
Get all resources, excluding events
Get all resources, excluding events and podmetrics
$ ketall

Get all resources, including events
Expand Down Expand Up @@ -95,7 +95,7 @@ func init() {
rootCmd.Flags().StringVar(&ketallOptions.Since, constants.FlagSince, "", "Only resources younger than given age.")
rootCmd.Flags().StringVarP(&ketallOptions.Selector, constants.FlagSelector, "l", "", "Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2).")
rootCmd.Flags().StringVar(&ketallOptions.FieldSelector, constants.FlagFieldSelector, "", "Selector (field query) to filter on, supports '=', '==', and '!='.(e.g. --field-selector key1=value1,key2=value2). The common field queries for all types are metadata.name and metadata.namespace.")
rootCmd.Flags().StringSliceVar(&ketallOptions.Exclusions, constants.FlagExclude, []string{"events"}, "Filter by resource name (plural form or short name).")
rootCmd.Flags().StringSliceVar(&ketallOptions.Exclusions, constants.FlagExclude, []string{"Event", "PodMetrics"}, "Filter by resource name (plural form or short name).")

ketallOptions.GenericCliFlags.AddFlags(rootCmd.Flags())
ketallOptions.PrintFlags.AddFlags(rootCmd)
Expand Down
1 change: 1 addition & 0 deletions internal/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ func extractRelevantResources(grs []groupResource, exclusions []string) []groupR
name := r.fullName()
resourceIds := r.APIResource.ShortNames
resourceIds = append(resourceIds, r.APIResource.Name)
resourceIds = append(resourceIds, r.APIResource.Kind)
resourceIds = append(resourceIds, name)
if forbidden.HasAny(resourceIds...) {
logrus.Debugf("Excluding %s", name)
Expand Down