Force the namespace value for the "default" service object.

The clusterrolebinding and rolebinding is pointing at a resource
which is not listed in the kustomize
This commit is contained in:
Jerome Brette
2019-07-25 22:19:25 +00:00
parent e646bba1ff
commit 2faf4a491b
5 changed files with 164 additions and 54 deletions

View File

@@ -28,6 +28,12 @@ metadata:
fieldSpecs:
- path: metadata/namespace
create: true
- path: subjects
kind: RoleBinding
group: rbac.authorization.k8s.io
- path: subjects
kind: ClusterRoleBinding
group: rbac.authorization.k8s.io
`, `
apiVersion: v1
kind: ConfigMap
@@ -54,7 +60,7 @@ apiVersion: v1
kind: ServiceAccount
metadata:
name: default
namespace: system
namespace: test
---
apiVersion: v1
kind: ServiceAccount
@@ -151,7 +157,7 @@ metadata:
subjects:
- kind: ServiceAccount
name: default
namespace: system
namespace: test
- kind: ServiceAccount
name: service-account
namespace: system
@@ -222,6 +228,12 @@ metadata:
fieldSpecs:
- path: metadata/namespace
create: true
- path: subjects
kind: RoleBinding
group: rbac.authorization.k8s.io
- path: subjects
kind: ClusterRoleBinding
group: rbac.authorization.k8s.io
`, noChangeExpected)
th.AssertActualEqualsExpected(rm, noChangeExpected)