diff --git a/api/everest_test.go b/api/everest_test.go index b67cdefc..1c9a0219 100644 --- a/api/everest_test.go +++ b/api/everest_test.go @@ -60,7 +60,7 @@ func TestBuildProxiedUrl(t *testing.T) { tc := testCase t.Run(tc.url, func(t *testing.T) { t.Parallel() - require.Equal(t, tc.expected, buildProxiedURL(tc.url, "percona-everest", tc.kind, tc.name)) + require.Equal(t, tc.expected, buildProxiedURL("percona-everest", tc.kind, tc.name)) }) } } diff --git a/api/proxy.go b/api/proxy.go index 10948f53..05340043 100644 --- a/api/proxy.go +++ b/api/proxy.go @@ -77,12 +77,12 @@ func (e *EverestServer) proxyKubernetes(ctx echo.Context, namespace, kind, name if namespace == "" { namespace = e.kubeClient.Namespace() } - req.URL.Path = buildProxiedURL(ctx.Request().URL.Path, namespace, kind, name) + req.URL.Path = buildProxiedURL(namespace, kind, name) reverseProxy.ServeHTTP(ctx.Response(), req) return nil } -func buildProxiedURL(uri, namespace, kind, name string) string { +func buildProxiedURL(namespace, kind, name string) string { proxiedURL := fmt.Sprintf( "/apis/everest.percona.com/v1alpha1/namespaces/%s/%s", url.PathEscape(strings.ReplaceAll(namespace, "/", "")), diff --git a/pkg/kubernetes/kubernetes.go b/pkg/kubernetes/kubernetes.go index 49204f11..35cb6c1e 100644 --- a/pkg/kubernetes/kubernetes.go +++ b/pkg/kubernetes/kubernetes.go @@ -48,8 +48,6 @@ const ( // EverestWatchNamespacesEnvVar is the name of the environment variable. EverestWatchNamespacesEnvVar = "WATCH_NAMESPACES" - - everestOperatorContainerName = "manager" ) // Kubernetes is a client for Kubernetes.