Skip to content
This repository was archived by the owner on Jun 14, 2018. It is now read-only.

Commit c1b35b6

Browse files
authored
istioctl: Fix path for Mixer Config server (#692)
Manager and mixer API server paths are not consistent. Manager path is prefixed with Istio resource version (i.e. v1alpha1) and mixer path is not. Short term workaround is to special case this behavior. Long term solution is to unify API scheme and server implementations. See istio/api#94 for long term tracking.
1 parent ab8c1a1 commit c1b35b6

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

platform/kube/client.go

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,8 +411,22 @@ func (cl *Client) GetTLSSecret(uri string) (*model.TLSSecret, error) {
411411
// the a Kubernetes service.
412412
// (see https://kubernetes.io/docs/concepts/cluster-administration/access-cluster/#discovering-builtin-services)
413413
func (cl *Client) Request(namespace, service, method, path string, inBody []byte) (int, []byte, error) {
414-
absPath := fmt.Sprintf("api/v1/namespaces/%s/services/%s/proxy/%s/%s",
415-
namespace, service, IstioResourceVersion, path)
414+
// Kubernetes apiserver proxy prefix for the specified namespace and service.
415+
absPath := fmt.Sprintf("api/v1/namespaces/%s/services/%s/proxy", namespace, service)
416+
417+
// TODO(https://github.com/istio/api/issues/94) - Manager and
418+
// mixer API server paths are not consistent. Manager path is
419+
// prefixed with Istio resource version (i.e. v1alpha1) and mixer
420+
// path is not. Short term workaround is to special case this
421+
// behavior. Long term solution is to unify API scheme and server
422+
// implementations.
423+
if strings.HasPrefix(path, "config") {
424+
absPath += "/" + IstioResourceVersion // manager api server patha
425+
}
426+
427+
// API server resource path.
428+
absPath += "/" + path
429+
416430
var status int
417431
outBody, err := cl.dyn.Verb(method).
418432
AbsPath(absPath).

0 commit comments

Comments
 (0)