Skip to content

Commit

Permalink
Add implicit managedFields exclude
Browse files Browse the repository at this point in the history
Add implicit exclude for metadata.managedFields.
  • Loading branch information
HeavyWombat committed May 19, 2022
1 parent 16e0fd6 commit 37b5613
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ func Execute() error {

// Enable Kubernetes specific entity detection implicitly
reportOptions.kubernetesEntityDetection = true

// Add implicit exclude for metadata.managedFields as this cannot
// be configured via a command-line flag using KUBECTL_EXTERNAL_DIFF
// due to an bug/feature in kubectl that ignore command-line flags
// in the diff environment variable with non alpha-numeric characters
reportOptions.excludeRegexps = append(reportOptions.excludeRegexps, "^/metadata/managedFields")
}

if err := rootCmd.Execute(); err != nil {
Expand Down

0 comments on commit 37b5613

Please sign in to comment.