Skip to content

Feature Request: Diff to compare rollback #24

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

Closed
wants to merge 8 commits into from
Closed
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
92 changes: 85 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,102 @@
# Helm Diff Plugin

This is a Helm plugin giving your a preview of what a `helm upgrade` would change.
It basically generates a diff between the latest deployed version of a release
and a `helm upgrade --debug --dry-run`
This is a Helm plugin giving your a preview of what a `helm upgrade` or `helm rollback`
would change. It basically generates a diff between the latest deployed version of a
releaseand a `helm upgrade --debug --dry-run` when used with `upgrade` command or with
the specified rollback revision of release. This can also be used to compare two
revisions/versions of your helm release.

<a href="https://asciinema.org/a/105326" target="_blank"><img src="https://asciinema.org/a/105326.png" /></a>

## Usage

```
$ helm diff [flags] RELEASE CHART
$ helm diff
The Helm Diff Plugin

* Shows a diff explaing what a helm upgrade would change:
This fetches the currently deployed version of a release
and compares it to a local chart plus values. This can be
used visualize what changes a helm upgrade will perform.

* Shows a diff explaing what a helm rollback would change:
This fetches the currently deployed version of a release
and compares it rollback revision. This can be
used visualize what changes a helm rollback will perform.

* Shows a diff explaing what had changed between two revisions:
This fetches previously deployed versions of a release
and compares them. This can be used visualize what changes
were made during revision change.

Usage:
diff [command]

Available Commands:
revision Shows diff between revision's manifests
rollback visualize changes, that a helm rollback could perform
upgrade visualize changes, that a helm upgrade could perform
version print the version information

Flags:
-h, --help help for diff

Use "diff [command] --help" for more information about a command.
```

## Commands:

### upgrade:

```
$ helm diff upgrade -h
This command compares the manifests details of a named release
with values generated form charts.

It forecasts/visualizes changes, that a helm upgrade could perform.

Usage:
diff upgrade [flags] [RELEASE] [CHART]

Flags:
--reuse-values reuse the last release's values and merge in any new values
--set stringArray set values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
--suppress stringArray allows suppression of the values listed in the diff output
-q, --suppress-secrets suppress secrets in the output
-f, --values valueFiles specify values in a YAML file (can specify multiple) (default [])
```

### rollback:

```
$ helm diff rollback -h
This command compares the laset manifests details of a named release
with specific revision values to rollback.

### Flags:
It forecasts/visualizes changes, that a helm rollback could perform.

Usage:
diff rollback [flags] [RELEASE] REVISION

```
--set string set values on the command line. See 'helm install -h'
-f, --values valueFiles specify one or more YAML files of values (default [])

### revision:

```
$ helm diff revision -h
This command compares the manifests details of a named release.

It can be used to compare the manifests of

- lastest REVISION with specified REVISION
$ helm diff revision [flags] [RELEASE] REVISION

- REVISION1 with REVISION2
$ helm diff revision [flags] [RELEASE] REVISION1 REVISION1

Usage:
diff revision [flags] [RELEASE] REVISION1 REVISION2
```

## Install

Expand Down
2 changes: 1 addition & 1 deletion helm.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func locateChartPath(name, version string, verify bool, keyring string) (string,
dl.Verify = downloader.VerifyAlways
}

filename, _, err := dl.DownloadTo(name, version, ".")
filename, _, err := dl.DownloadTo(name, version, helmpath.Home(homePath()).Archive())
if err == nil {
lname, err := filepath.Abs(filename)
if err != nil {
Expand Down
Loading