Skip to content

Commit

Permalink
test case added
Browse files Browse the repository at this point in the history
  • Loading branch information
m-Bilal committed Feb 27, 2022
1 parent 3ec7b10 commit 3eae520
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions api/krusty/basic_io_test.go
Expand Up @@ -6,6 +6,7 @@ package krusty_test
import (
"testing"

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

Expand Down Expand Up @@ -80,3 +81,35 @@ spec:
clusterIP: None
`)
}

//test for https://github.com/kubernetes-sigs/kustomize/issues/3812#issuecomment-862339267
func TestBasicIO3812(t *testing.T) {
th := kusttest_test.MakeHarness(t)
th.WriteK(".", `
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- service.yaml
`)

th.WriteF("service.yaml", `
apiVersion: v1
kind: Service
metadata:
name: kapacitor
labels:
app.kubernetes.io/name: tick-kapacitor
spec:
selector:
app.kubernetes.io/name: tick-kapacitor
- name: http
port: 9092
protocol: TCP
type: ClusterIP
`)

err := th.RunWithErr(".", th.MakeDefaultOptions())
if !kusterr.IsMalformedYAMLError(err) {
t.Fatalf("unexpected error: %q", err)
}
}

0 comments on commit 3eae520

Please sign in to comment.