Skip to content

Commit

Permalink
helm secret in kind
Browse files Browse the repository at this point in the history
  • Loading branch information
elsesiy committed Jan 3, 2025
1 parent 3707de9 commit 1c507de
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
22 changes: 22 additions & 0 deletions hack/kind-bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,25 @@ kind: Namespace
metadata:
name: empty
EOF

## 'helm' namespace
kubectl apply -f - <<EOF
apiVersion: v1
kind: Namespace
metadata:
name: helm
EOF

## helm secret 'test3' in namespace 'helm' (single key)
sec=$(echo "helm-test" | gzip -c | base64 | base64)
kubectl apply -f - <<EOF
apiVersion: v1
data:
release: $sec
kind: Secret
metadata:
name: test3
namespace: helm
type: helm.sh/release.v1
EOF

1 change: 1 addition & 0 deletions pkg/cmd/view-secret_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ func TestNewCmdViewSecret(t *testing.T) {
"custom ns (does not exist)": {args: []string{"test", "--namespace", "bob"}, want: `Error from server (NotFound): namespaces "bob" not found`},
"custom ns (no secret)": {args: []string{"test", "--namespace", "another"}, want: `Error from server (NotFound): secrets "test" not found`},
"custom ns (valid secret)": {args: []string{"gopher", "--namespace", "another"}, want: `Viewing only available key: foo\nbar`},
"helm": {args: []string{"test3", "--namespace", "helm"}, want: `Viewing only available key: release\nhelm-test`},
"impersonate group": {args: []string{"test", "--as", "gopher"}},
"impersonate user & group": {args: []string{"test", "--as", "gopher", "--as-group", "golovers"}},
// make bootstrap sources 2 test secrets in the default namespace, select the first one and print all values
Expand Down

0 comments on commit 1c507de

Please sign in to comment.