From b86342c0971225309304a40e2dceac07f1ffddc1 Mon Sep 17 00:00:00 2001 From: jsnider-mtu <jsnider@mtu.edu> Date: Fri, 5 Mar 2021 14:05:12 -0500 Subject: [PATCH 1/2] Fix API path Signed-off-by: jsnider-mtu <jsnider@mtu.edu> --- pkg/engine/apiPath.go | 4 ++-- pkg/engine/apiPath_test.go | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/engine/apiPath.go b/pkg/engine/apiPath.go index 21bc6db274..3d64e66d9c 100644 --- a/pkg/engine/apiPath.go +++ b/pkg/engine/apiPath.go @@ -127,9 +127,9 @@ func (a *APIPath) String() string { var paths []string if a.Namespace != "" { if a.Name == "" { - paths = []string{a.Root, a.Group, a.Version, a.ResourceType, "namespaces", a.Namespace} + paths = []string{a.Root, a.Group, a.Version, "namespaces", a.Namespace, a.ResourceType} } else { - paths = []string{a.Root, a.Group, a.Version, a.ResourceType, "namespaces", a.Namespace, a.Name} + paths = []string{a.Root, a.Group, a.Version, "namespaces", a.Namespace, a.ResourceType, a.Name} } } else { if a.Name != "" { diff --git a/pkg/engine/apiPath_test.go b/pkg/engine/apiPath_test.go index 306e443c6f..bf992022b6 100644 --- a/pkg/engine/apiPath_test.go +++ b/pkg/engine/apiPath_test.go @@ -21,4 +21,8 @@ func Test_Paths(t *testing.T) { f("/api/v1/namespace/{{ request.namespace }}/", "/api/v1/namespace/{{ request.namespace }}") f("/api/v1/namespace/{{ request.namespace }}/ ", "/api/v1/namespace/{{ request.namespace }}") f(" /api/v1/namespace/{{ request.namespace }}", "/api/v1/namespace/{{ request.namespace }}") + f("/apis/gloo.solo.io/v1/namespaces/gloo-system/upstreams", "/apis/gloo.solo.io/v1/namespaces/gloo-system/upstreams") + f("/apis/gloo.solo.io/v1/namespaces/gloo-system/upstreams/", "/apis/gloo.solo.io/v1/namespaces/gloo-system/upstreams") + f("/apis/gloo.solo.io/v1/namespaces/gloo-system/upstreams/ ", "/apis/gloo.solo.io/v1/namespaces/gloo-system/upstreams") + f(" /apis/gloo.solo.io/v1/namespaces/gloo-system/upstreams", "/apis/gloo.solo.io/v1/namespaces/gloo-system/upstreams") } From 81b147e27916478825e1934ef134accf6dccea17 Mon Sep 17 00:00:00 2001 From: jsnider-mtu <jsnider@mtu.edu> Date: Fri, 5 Mar 2021 14:13:00 -0500 Subject: [PATCH 2/2] Replace spaces with tabs Signed-off-by: jsnider-mtu <jsnider@mtu.edu> --- pkg/engine/apiPath_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/engine/apiPath_test.go b/pkg/engine/apiPath_test.go index bf992022b6..8879b377f8 100644 --- a/pkg/engine/apiPath_test.go +++ b/pkg/engine/apiPath_test.go @@ -21,8 +21,8 @@ func Test_Paths(t *testing.T) { f("/api/v1/namespace/{{ request.namespace }}/", "/api/v1/namespace/{{ request.namespace }}") f("/api/v1/namespace/{{ request.namespace }}/ ", "/api/v1/namespace/{{ request.namespace }}") f(" /api/v1/namespace/{{ request.namespace }}", "/api/v1/namespace/{{ request.namespace }}") - f("/apis/gloo.solo.io/v1/namespaces/gloo-system/upstreams", "/apis/gloo.solo.io/v1/namespaces/gloo-system/upstreams") - f("/apis/gloo.solo.io/v1/namespaces/gloo-system/upstreams/", "/apis/gloo.solo.io/v1/namespaces/gloo-system/upstreams") - f("/apis/gloo.solo.io/v1/namespaces/gloo-system/upstreams/ ", "/apis/gloo.solo.io/v1/namespaces/gloo-system/upstreams") - f(" /apis/gloo.solo.io/v1/namespaces/gloo-system/upstreams", "/apis/gloo.solo.io/v1/namespaces/gloo-system/upstreams") + f("/apis/gloo.solo.io/v1/namespaces/gloo-system/upstreams", "/apis/gloo.solo.io/v1/namespaces/gloo-system/upstreams") + f("/apis/gloo.solo.io/v1/namespaces/gloo-system/upstreams/", "/apis/gloo.solo.io/v1/namespaces/gloo-system/upstreams") + f("/apis/gloo.solo.io/v1/namespaces/gloo-system/upstreams/ ", "/apis/gloo.solo.io/v1/namespaces/gloo-system/upstreams") + f(" /apis/gloo.solo.io/v1/namespaces/gloo-system/upstreams", "/apis/gloo.solo.io/v1/namespaces/gloo-system/upstreams") }