You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+32-5Lines changed: 32 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -115,7 +115,7 @@ Flags:
115
115
--no-color remove colors from the output. If both --no-color and --color are unspecified, coloring enabled only when the stdout is a term and TERM is not "dumb"
116
116
--no-hooks disable diffing of hooks
117
117
--normalize-manifests normalize manifests before running diff to exclude style differences from the output
118
-
--output string Possible values: diff, simple, template, dyff. When set to "template", use the env var HELM_DIFF_TPL to specify the template. (default "diff")
118
+
--output string Possible values: diff, simple, template, json, structured, dyff. When set to "template", use the env var HELM_DIFF_TPL to specify the template. (default "diff")
119
119
--post-renderer string the path to an executable to be used for post rendering. If it exists in $PATH, the binary will be used, otherwise it will try to look for the executable at the given path
120
120
--post-renderer-args stringArray an argument to the post-renderer (can specify multiple)
121
121
--repo string specify the chart repository url to locate the requested chart
@@ -145,6 +145,33 @@ Additional help topcis:
145
145
Use "diff [command] --help" for more information about a command.
146
146
```
147
147
148
+
### Structured JSON output
149
+
150
+
Set `--output structured` (or `HELM_DIFF_OUTPUT=structured`) to emit machine-readable JSON. Each entry reports the Kubernetes object metadata, resource existence, and per-field changes using JSON Pointer paths:
151
+
152
+
```shell
153
+
helm diff upgrade prod api ./charts/api --output structured
When a kind is suppressed via `--suppress`, `changesSuppressed` is set to `true` and field details are omitted. Nested metadata such as labels show the container path (`metadata.labels`) and expose the label key through the `field` property (for example `app.kubernetes.io/version`).
174
+
148
175
## Commands:
149
176
150
177
### upgrade:
@@ -211,7 +238,7 @@ Flags:
211
238
--kubeconfig string This flag is ignored, to allow passing of this top level flag to helm
212
239
--no-hooks disable diffing of hooks
213
240
--normalize-manifests normalize manifests before running diff to exclude style differences from the output
214
-
--output string Possible values: diff, simple, template, dyff. When set to "template", use the env var HELM_DIFF_TPL to specify the template. (default "diff")
241
+
--output string Possible values: diff, simple, template, json, structured, dyff. When set to "template", use the env var HELM_DIFF_TPL to specify the template. (default "diff")
215
242
--post-renderer string the path to an executable to be used for post rendering. If it exists in $PATH, the binary will be used, otherwise it will try to look for the executable at the given path
216
243
--post-renderer-args stringArray an argument to the post-renderer (can specify multiple)
217
244
--repo string specify the chart repository url to locate the requested chart
@@ -266,7 +293,7 @@ Flags:
266
293
-h, --help help for release
267
294
--include-tests enable the diffing of the helm test hooks
268
295
--normalize-manifests normalize manifests before running diff to exclude style differences from the output
269
-
--output string Possible values: diff, simple, template, dyff. When set to "template", use the env var HELM_DIFF_TPL to specify the template. (default "diff")
296
+
--output string Possible values: diff, simple, template, json, structured, dyff. When set to "template", use the env var HELM_DIFF_TPL to specify the template. (default "diff")
270
297
--show-secrets do not redact secret values in the output
271
298
--strip-trailing-cr strip trailing carriage return on input
272
299
--suppress stringArray allows suppression of the kinds listed in the diff output (can specify multiple, like '--suppress Deployment --suppress Service')
@@ -308,7 +335,7 @@ Flags:
308
335
-h, --help help for revision
309
336
--include-tests enable the diffing of the helm test hooks
310
337
--normalize-manifests normalize manifests before running diff to exclude style differences from the output
311
-
--output string Possible values: diff, simple, template, dyff. When set to "template", use the env var HELM_DIFF_TPL to specify the template. (default "diff")
338
+
--output string Possible values: diff, simple, template, json, structured, dyff. When set to "template", use the env var HELM_DIFF_TPL to specify the template. (default "diff")
312
339
--show-secrets do not redact secret values in the output
313
340
--show-secrets-decoded decode secret values in the output
314
341
--strip-trailing-cr strip trailing carriage return on input
@@ -344,7 +371,7 @@ Flags:
344
371
-h, --help help for rollback
345
372
--include-tests enable the diffing of the helm test hooks
346
373
--normalize-manifests normalize manifests before running diff to exclude style differences from the output
347
-
--output string Possible values: diff, simple, template, dyff. When set to "template", use the env var HELM_DIFF_TPL to specify the template. (default "diff")
374
+
--output string Possible values: diff, simple, template, json, structured, dyff. When set to "template", use the env var HELM_DIFF_TPL to specify the template. (default "diff")
348
375
--show-secrets do not redact secret values in the output
349
376
--show-secrets-decoded decode secret values in the output
350
377
--strip-trailing-cr strip trailing carriage return on input
Copy file name to clipboardExpand all lines: cmd/options.go
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ func AddDiffOptions(f *pflag.FlagSet, o *diff.Options) {
13
13
f.BoolVar(&o.ShowSecretsDecoded, "show-secrets-decoded", false, "decode secret values in the output")
14
14
f.StringArrayVar(&o.SuppressedKinds, "suppress", []string{}, "allows suppression of the kinds listed in the diff output (can specify multiple, like '--suppress Deployment --suppress Service')")
15
15
f.IntVarP(&o.OutputContext, "context", "C", -1, "output NUM lines of context around changes")
16
-
f.StringVar(&o.OutputFormat, "output", "diff", "Possible values: diff, simple, template, dyff. When set to \"template\", use the env var HELM_DIFF_TPL to specify the template.")
16
+
f.StringVar(&o.OutputFormat, "output", "diff", "Possible values: diff, simple, template, json, structured, dyff. When set to \"template\", use the env var HELM_DIFF_TPL to specify the template.")
17
17
f.BoolVar(&o.StripTrailingCR, "strip-trailing-cr", false, "strip trailing carriage return on input")
18
18
f.Float32VarP(&o.FindRenames, "find-renames", "D", 0, "Enable rename detection if set to any value greater than 0. If specified, the value denotes the maximum fraction of changed content as lines added + removed compared to total lines in a diff for considering it a rename. Only objects of the same Kind are attempted to be matched")
19
19
f.StringArrayVar(&o.SuppressedOutputLineRegex, "suppress-output-line-regex", []string{}, "a regex to suppress diff output lines that match")
0 commit comments