Skip to content

Commit

Permalink
Merge pull request kubernetes#71974 from apelisse/fix-diff-overriding…
Browse files Browse the repository at this point in the history
…-names

diff: Make filename cross-platform compatible
  • Loading branch information
k8s-ci-robot authored Dec 12, 2018
2 parents 425b1ff + 95eec90 commit c49896f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/kubectl/cmd/diff/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions test/cmd/diff.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c49896f

Please sign in to comment.