mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-13 01:50:55 +00:00
test case added
This commit is contained in:
@@ -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"
|
||||
)
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user