Keep empty map in kustomize output

This commit is contained in:
Donny Xia
2020-08-06 13:19:26 -07:00
parent 2bcece5f1e
commit d59d0401f4
14 changed files with 53 additions and 76 deletions

View File

@@ -467,7 +467,6 @@ spec:
replicas: 1
template:
metadata:
creationTimestamp: null
labels:
workload.sas.com/class: stateless
spec:
@@ -498,45 +497,6 @@ spec:
name: tmp
`
// This is the current (incorrect) result we get with kustomize 3.8.1
const currentCleanedDeployment = `apiVersion: apps/v1
kind: Deployment
metadata:
labels:
workload.sas.com/class: stateless
name: sas-crunchy-data-postgres-operator
spec:
replicas: 1
template:
metadata:
labels:
workload.sas.com/class: stateless
spec:
containers:
- envFrom: []
image: sas-crunchy-data-operator-api-server
imagePullPolicy: IfNotPresent
name: apiserver
ports:
- containerPort: 8443
volumeMounts:
- mountPath: /security-ssh
name: security-ssh
- mountPath: /tmp
name: tmp
imagePullSecrets: []
initContainers: []
serviceAccountName: postgres-operator
tolerations:
- effect: NoSchedule
key: workload.sas.com/class
operator: Equal
value: stateful
volumes:
- name: security-ssh
- name: tmp
`
func TestPatchStrategicMergeTransformerCleanupItems(t *testing.T) {
th := kusttest_test.MakeEnhancedHarness(t).
PrepBuiltin("PatchStrategicMergeTransformer")
@@ -571,7 +531,7 @@ paths:
- patch.yaml
`,
anUncleanDeploymentResource,
currentCleanedDeployment) // prefer expectedCleanedDeployment
expectedCleanedDeployment) // prefer expectedCleanedDeployment
}
func TestStrategicMergeTransformerNoSchema(t *testing.T) {