mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-11 17:12:51 +00:00
Add integration test for glob support
This commit is contained in:
@@ -6,5 +6,4 @@ commonLabels:
|
|||||||
commonAnnotations:
|
commonAnnotations:
|
||||||
note: This is a test annotation
|
note: This is a test annotation
|
||||||
resources:
|
resources:
|
||||||
- deployment.yaml
|
- resources/*.yaml
|
||||||
- service.yaml
|
|
||||||
|
|||||||
@@ -2,8 +2,7 @@ namePrefix: staging-
|
|||||||
commonLabels:
|
commonLabels:
|
||||||
env: staging
|
env: staging
|
||||||
patches:
|
patches:
|
||||||
- deployment-patch1.yaml
|
- patches/deployment-patch*.yaml
|
||||||
- deployment-patch2.yaml
|
|
||||||
bases:
|
bases:
|
||||||
- ../package/
|
- ../package/
|
||||||
configMapGenerator:
|
configMapGenerator:
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ package crds
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"reflect"
|
"reflect"
|
||||||
|
"sort"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/kubernetes-sigs/kustomize/pkg/internal/loadertest"
|
"github.com/kubernetes-sigs/kustomize/pkg/internal/loadertest"
|
||||||
@@ -150,9 +151,7 @@ func makeLoader(t *testing.T) loader.Loader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestRegisterCRD(t *testing.T) {
|
func TestRegisterCRD(t *testing.T) {
|
||||||
expected := []pathConfigs{
|
refpathconfigs := []transformers.ReferencePathConfig{
|
||||||
{
|
|
||||||
namereferencePathConfigs: []transformers.ReferencePathConfig{
|
|
||||||
transformers.NewReferencePathConfig(
|
transformers.NewReferencePathConfig(
|
||||||
schema.GroupVersionKind{Kind: "Bee", Version: "v1beta1"},
|
schema.GroupVersionKind{Kind: "Bee", Version: "v1beta1"},
|
||||||
[]transformers.PathConfig{
|
[]transformers.PathConfig{
|
||||||
@@ -173,7 +172,15 @@ func TestRegisterCRD(t *testing.T) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
},
|
}
|
||||||
|
|
||||||
|
sort.Slice(refpathconfigs, func(i, j int) bool {
|
||||||
|
return refpathconfigs[i].GVK() < refpathconfigs[j].GVK()
|
||||||
|
})
|
||||||
|
|
||||||
|
expected := []pathConfigs{
|
||||||
|
{
|
||||||
|
namereferencePathConfigs: refpathconfigs,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -181,6 +188,10 @@ func TestRegisterCRD(t *testing.T) {
|
|||||||
|
|
||||||
pathconfig, _ := registerCRD(loader, "/testpath/crd.json")
|
pathconfig, _ := registerCRD(loader, "/testpath/crd.json")
|
||||||
|
|
||||||
|
sort.Slice(pathconfig[0].namereferencePathConfigs, func(i, j int) bool {
|
||||||
|
return pathconfig[0].namereferencePathConfigs[i].GVK() < pathconfig[0].namereferencePathConfigs[j].GVK()
|
||||||
|
})
|
||||||
|
|
||||||
if !reflect.DeepEqual(pathconfig, expected) {
|
if !reflect.DeepEqual(pathconfig, expected) {
|
||||||
t.Fatalf("expected\n %v\n but got\n %v\n", expected, pathconfig)
|
t.Fatalf("expected\n %v\n but got\n %v\n", expected, pathconfig)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,3 +61,8 @@ func NewReferencePathConfig(gvk schema.GroupVersionKind, pathconfigs []PathConfi
|
|||||||
pathConfigs: pathconfigs,
|
pathConfigs: pathconfigs,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GVK returns the Group version kind of a Reference PathConfig
|
||||||
|
func (r ReferencePathConfig) GVK() string {
|
||||||
|
return r.referencedGVK.String()
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user