Skip to content

Commit

Permalink
regression test for panic on duplicate keys
Browse files Browse the repository at this point in the history
  • Loading branch information
natasha41575 committed Mar 3, 2021
1 parent 7fb6fa0 commit 93dd571
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions api/krusty/duplicatekeys_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package krusty_test

import (
"testing"

kusttest_test "sigs.k8s.io/kustomize/api/testutils/kusttest"
)

func TestDuplicateKeys(t *testing.T) {
th := kusttest_test.MakeHarness(t)
th.WriteK(".", `
resources:
- resources.yaml
`)
th.WriteF("resources.yaml", `
apiVersion: apps/v1
kind: Deployment
metadata:
name: podinfo
spec:
selector:
matchLabels:
app: podinfo
template:
spec:
containers:
- name: podinfod
image: ghcr.io/stefanprodan/podinfo:5.0.3
command:
- ./podinfo
env:
- name: PODINFO_UI_COLOR
value: "#34577c"
env:
- name: PODINFO_UI_COLOR
value: "#34577c"
`)
th.RunWithErr(".", th.MakeDefaultOptions())
}

0 comments on commit 93dd571

Please sign in to comment.