Skip to content

Commit 972b4c1

Browse files
authored
Merge branch 'master' into devel_upgrade
2 parents 3f35aea + 887ad5c commit 972b4c1

File tree

6 files changed

+39
-15
lines changed

6 files changed

+39
-15
lines changed

cmd/helm.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,13 @@ func (d *diffCmd) vals() ([]byte, error) {
163163
}
164164
}
165165

166+
// User specified a value via --set-string
167+
for _, value := range d.stringValues {
168+
if err := strvals.ParseIntoString(value, base); err != nil {
169+
return []byte{}, fmt.Errorf("failed parsing --set-string data: %s", err)
170+
}
171+
}
172+
166173
return yaml.Marshal(base)
167174
}
168175

cmd/root.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ import (
88
const rootCmdLongUsage = `
99
The Helm Diff Plugin
1010
11-
* Shows a diff explaing what a helm upgrade would change:
11+
* Shows a diff explaining what a helm upgrade would change:
1212
This fetches the currently deployed version of a release
1313
and compares it to a local chart plus values. This can be
1414
used visualize what changes a helm upgrade will perform.
1515
16-
* Shows a diff explaing what had changed between two revisions:
16+
* Shows a diff explaining what had changed between two revisions:
1717
This fetches previously deployed versions of a release
1818
and compares them. This can be used visualize what changes
1919
were made during revision change.
2020
21-
* Shows a diff explaing what a helm rollback would change:
21+
* Shows a diff explaining what a helm rollback would change:
2222
This fetches the currently deployed version of a release
2323
and compares it to adeployed versions of a release, that you
2424
want to rollback. This can be used visualize what changes a

cmd/upgrade.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ type diffCmd struct {
2020
client helm.Interface
2121
detailedExitCode bool
2222
devel bool
23+
namespace string // namespace to assume the release to be installed into. Defaults to the current kube config namespace.
2324
valueFiles valueFiles
2425
values []string
26+
stringValues []string
2527
reuseValues bool
2628
resetValues bool
2729
allowUnreleased bool
@@ -74,12 +76,14 @@ func newChartCommand() *cobra.Command {
7476
f.BoolP("suppress-secrets", "q", false, "suppress secrets in the output")
7577
f.VarP(&diff.valueFiles, "values", "f", "specify values in a YAML file (can specify multiple)")
7678
f.StringArrayVar(&diff.values, "set", []string{}, "set values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)")
79+
f.StringArrayVar(&diff.stringValues, "set-string", []string{}, "set STRING values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)")
7780
f.BoolVar(&diff.reuseValues, "reuse-values", false, "reuse the last release's values and merge in any new values")
7881
f.BoolVar(&diff.resetValues, "reset-values", false, "reset the values to the ones built into the chart and merge in any new values")
7982
f.BoolVar(&diff.allowUnreleased, "allow-unreleased", false, "enables diffing of releases that are not yet deployed via Helm")
8083
f.BoolVar(&diff.devel, "devel", false, "use development versions, too. Equivalent to version '>0.0.0-0'. If --version is set, this is ignored.")
8184
f.StringArrayVar(&diff.suppressedKinds, "suppress", []string{}, "allows suppression of the values listed in the diff output")
8285
f.IntVarP(&diff.outputContext, "context", "C", -1, "output NUM lines of context around changes")
86+
f.StringVar(&diff.namespace, "namespace", "default", "namespace to assume the release to be installed into")
8387

8488
addCommonCmdOptions(f)
8589

@@ -128,7 +132,7 @@ func (d *diffCmd) run() error {
128132
if newInstall {
129133
installResponse, err := d.client.InstallRelease(
130134
chartPath,
131-
"default",
135+
d.namespace,
132136
helm.ReleaseName(d.release),
133137
helm.ValueOverrides(rawVals),
134138
helm.InstallDryRun(true),

glide.lock

Lines changed: 12 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

glide.yaml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,20 @@ import:
55
- package: github.com/spf13/pflag
66
version: 583c0c0531f06d5278b7d917446061adc344b5cd
77
- package: k8s.io/helm
8-
version: v2.9.0
9-
#taken from k8s.io/helm hlide.yaml
8+
#revert back to upstream once https://github.com/helm/helm/pull/4499 is released
9+
repo: https://github.com/databus23/helm.git
10+
version: v2.10.0-nok8s
11+
#taken from k8s.io/helm glide.yaml
1012
- package: k8s.io/api
1113
version: release-1.10
14+
# The two packages below were expected to have `version: release-1.10`,
15+
# but it ended up vendoring versions of pkgs newer than those in helm's glide.lock
16+
# https://github.com/helm/helm/blob/cc7cc1087f586f64d0b0d08aa516a003ced2d85b/glide.lock#L400-L458
17+
# See #82 for more information
1218
- package: k8s.io/apimachinery
13-
version: release-1.10
19+
version: f6313580a4d36c7c74a3d845dda6e116642c4f90
20+
- package: k8s.io/apiserver
21+
version: f7914ed3085badf66a1b6f3a5218ada28f7bd084
1422
- package: google.golang.org/grpc
1523
version: 1.7.2
1624
- package: golang.org/x/net

plugin.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: "diff"
22
# Version is the version of Helm plus the number of official builds for this
33
# plugin
4-
version: "2.9.0+2"
4+
version: "2.10.0+1"
55
usage: "Preview helm upgrade changes as a diff"
66
description: "Preview helm upgrade changes as a diff"
77
useTunnel: true

0 commit comments

Comments
 (0)