mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-12 17:34:21 +00:00
More tests, better errors.
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
"github.com/go-openapi/spec"
|
||||
"github.com/pkg/errors"
|
||||
"k8s.io/kube-openapi/pkg/common"
|
||||
"sigs.k8s.io/kustomize/api/filesys"
|
||||
"sigs.k8s.io/kustomize/api/ifc"
|
||||
"sigs.k8s.io/kustomize/api/internal/plugins/builtinconfig"
|
||||
"sigs.k8s.io/kustomize/api/resid"
|
||||
@@ -78,7 +79,7 @@ func makeConfigFromApiMap(m nameToApiMap) (*builtinconfig.TransformerConfig, err
|
||||
// openAPI definition once
|
||||
// "x-kubernetes-group-version-kind" is available in CRD
|
||||
func makeGvkFromTypeName(n string) resid.Gvk {
|
||||
names := strings.Split(n, ".")
|
||||
names := strings.Split(n, filesys.SelfDir)
|
||||
kind := names[len(names)-1]
|
||||
return resid.Gvk{Kind: kind}
|
||||
}
|
||||
|
||||
@@ -203,7 +203,7 @@ func TestResourceNotFound(t *testing.T) {
|
||||
if err == nil {
|
||||
t.Fatalf("Didn't get the expected error for an unknown resource")
|
||||
}
|
||||
if !strings.Contains(err.Error(), `cannot read file`) {
|
||||
if !strings.Contains(err.Error(), "'/whatever/deployment.yaml' doesn't exist") {
|
||||
t.Fatalf("unexpected error: %q", err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ metadata:
|
||||
t.Fatalf("Err: %v", err)
|
||||
}
|
||||
|
||||
th := kusttest_test.NewKustTestHarness(t, ".")
|
||||
th := kusttest_test.NewKustTestHarness(t, filesys.SelfDir)
|
||||
th.AssertActualEqualsExpected(m, `
|
||||
apiVersion: v1
|
||||
kind: WorkDir
|
||||
|
||||
Reference in New Issue
Block a user