-
Notifications
You must be signed in to change notification settings - Fork 7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enabling hide secrets on install and upgrade dry run
This change adds a new flag to the install and upgrade commands in the Helm client and properties to the install and upgrade action. The new flag is --hide-secret and can only be used with the --dry-run flag. The --dry-run flag is designed to send all chart rendered manifests to stdout so that they can be inspected. When the --hide-secret flag is used the Secret content is removed from the output. Signed-off-by: Matt Farina <[email protected]>
- Loading branch information
1 parent
fa47752
commit 25c4738
Showing
16 changed files
with
316 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
cmd/helm/testdata/output/install-dry-run-with-secret-hidden.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
NAME: secrets | ||
LAST DEPLOYED: Fri Sep 2 22:04:05 1977 | ||
NAMESPACE: default | ||
STATUS: pending-install | ||
REVISION: 1 | ||
TEST SUITE: None | ||
HOOKS: | ||
MANIFEST: | ||
--- | ||
# Source: chart-with-secret/templates/secret.yaml | ||
# HIDDEN: The Secret output has been suppressed | ||
--- | ||
# Source: chart-with-secret/templates/configmap.yaml | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: test-configmap | ||
data: | ||
foo: bar | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
NAME: secrets | ||
LAST DEPLOYED: Fri Sep 2 22:04:05 1977 | ||
NAMESPACE: default | ||
STATUS: pending-install | ||
REVISION: 1 | ||
TEST SUITE: None | ||
HOOKS: | ||
MANIFEST: | ||
--- | ||
# Source: chart-with-secret/templates/secret.yaml | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: test-secret | ||
stringData: | ||
foo: bar | ||
--- | ||
# Source: chart-with-secret/templates/configmap.yaml | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: test-configmap | ||
data: | ||
foo: bar | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Error: INSTALLATION FAILED: Hiding Kubernetes secrets requires a dry-run mode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
apiVersion: v2 | ||
description: Chart with Kubernetes Secret | ||
name: chart-with-secret | ||
version: 0.0.1 |
6 changes: 6 additions & 0 deletions
6
cmd/helm/testdata/testcharts/chart-with-secret/templates/configmap.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: test-configmap | ||
data: | ||
foo: bar |
6 changes: 6 additions & 0 deletions
6
cmd/helm/testdata/testcharts/chart-with-secret/templates/secret.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: test-secret | ||
stringData: | ||
foo: bar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.