forked from kubernetes-sigs/kustomize
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBashedConfigMap_test.go
More file actions
40 lines (33 loc) · 844 Bytes
/
BashedConfigMap_test.go
File metadata and controls
40 lines (33 loc) · 844 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright 2019 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package main_test
import (
"testing"
"sigs.k8s.io/kustomize/api/testutils/kusttest"
)
func TestBashedConfigMapPlugin(t *testing.T) {
tc := kusttest_test.NewPluginTestEnv(t).Set()
defer tc.Reset()
tc.BuildExecPlugin(
"someteam.example.com", "v1", "BashedConfigMap")
th := kusttest_test.NewKustTestHarnessAllowPlugins(t, "/app")
m := th.LoadAndRunGenerator(`
apiVersion: someteam.example.com/v1
kind: BashedConfigMap
metadata:
name: whatever
argsOneLiner: alice myMomsMaidenName
`)
th.AssertActualEqualsExpected(m, `
apiVersion: v1
data:
password: myMomsMaidenName
username: alice
kind: ConfigMap
metadata:
name: example-configmap-test
`)
if m.Resources()[0].NeedHashSuffix() != true {
t.Errorf("expected resource to need hashing")
}
}