From 95eec905c7ea2152f409d593ac4f07151f6f1330 Mon Sep 17 00:00:00 2001 From: Antoine Pelisse Date: Tue, 11 Dec 2018 15:32:46 -0800 Subject: [PATCH] diff: Make filename cross-platform compatible --- pkg/kubectl/cmd/diff/diff.go | 2 +- test/cmd/diff.sh | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/kubectl/cmd/diff/diff.go b/pkg/kubectl/cmd/diff/diff.go index 8e1deba326fc3..1956cf1bb0f18 100644 --- a/pkg/kubectl/cmd/diff/diff.go +++ b/pkg/kubectl/cmd/diff/diff.go @@ -294,7 +294,7 @@ func (obj InfoObject) Name() string { group = fmt.Sprintf("%v.", obj.Info.Mapping.GroupVersionKind.Group) } return group + fmt.Sprintf( - "%v.%v:%v.%v", + "%v.%v.%v.%v", obj.Info.Mapping.GroupVersionKind.Version, obj.Info.Mapping.GroupVersionKind.Kind, obj.Info.Namespace, diff --git a/test/cmd/diff.sh b/test/cmd/diff.sh index e24381e4a9871..1441f7c4f6e77 100755 --- a/test/cmd/diff.sh +++ b/test/cmd/diff.sh @@ -49,10 +49,10 @@ run_kubectl_diff_same_names() { kube::log::status "Test kubectl diff with multiple resources with the same name" output_message=$(KUBECTL_EXTERNAL_DIFF=find kubectl diff -Rf hack/testdata/diff/) - kube::test::if_has_string "${output_message}" 'v1.Pod:.*.test' - kube::test::if_has_string "${output_message}" 'apps.v1.Deployment:.*.test' - kube::test::if_has_string "${output_message}" 'v1.ConfigMap:.*.test' - kube::test::if_has_string "${output_message}" 'v1.Secret:.*.test' + kube::test::if_has_string "${output_message}" 'v1\.Pod\..*\.test' + kube::test::if_has_string "${output_message}" 'apps\.v1\.Deployment\..*\.test' + kube::test::if_has_string "${output_message}" 'v1\.ConfigMap\..*\.test' + kube::test::if_has_string "${output_message}" 'v1\.Secret\..*\.test' set +o nounset set +o errexit