generator: test secure build relative base dir
Signed-off-by: Hidde Beydals <hello@hidde.co>
This commit is contained in:
parent
87797221ac
commit
db95625609
|
|
@ -50,3 +50,10 @@ func Test_secureBuildKustomization_panic(t *testing.T) {
|
||||||
g.Expect(err).To(HaveOccurred())
|
g.Expect(err).To(HaveOccurred())
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Test_secureBuildKustomization_rel_basedir(t *testing.T) {
|
||||||
|
g := NewWithT(t)
|
||||||
|
|
||||||
|
_, err := secureBuildKustomization("testdata/relbase", "testdata/relbase/clusters/staging/flux-system", false)
|
||||||
|
g.Expect(err).ToNot(HaveOccurred())
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: cm
|
||||||
|
namespace: foo
|
||||||
|
data:
|
||||||
|
key: value
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
resources:
|
||||||
|
- configmap.yaml
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: secret
|
||||||
|
namespace: foo
|
||||||
|
stringData:
|
||||||
|
bar: foo
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
---
|
||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
resources:
|
||||||
|
- secret.yaml
|
||||||
|
- ../../base
|
||||||
|
patchesStrategicMerge:
|
||||||
|
- ../../patches.yaml
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: secret
|
||||||
|
namespace: foo
|
||||||
|
stringData:
|
||||||
|
foo: bar
|
||||||
Loading…
Reference in New Issue