Skip to content

Commit

Permalink
remove deprecated /proxy paths
Browse files Browse the repository at this point in the history
These were depercated in v1.2.
  • Loading branch information
mikedanese committed Feb 20, 2018
1 parent c741432 commit 7b47229
Show file tree
Hide file tree
Showing 14 changed files with 37 additions and 1,004 deletions.
Expand Up @@ -72,7 +72,7 @@ spec:
- name: GF_AUTH_ANONYMOUS_ORG_ROLE
value: Admin
- name: GF_SERVER_ROOT_URL
value: /api/v1/proxy/namespaces/kube-system/services/monitoring-grafana/
value: /api/v1/namespaces/kube-system/services/monitoring-grafana/proxy/
ports:
- name: ui
containerPort: 3000
Expand Down
Expand Up @@ -30,7 +30,7 @@ spec:
- name: ELASTICSEARCH_URL
value: http://elasticsearch-logging:9200
- name: SERVER_BASEPATH
value: /api/v1/proxy/namespaces/kube-system/services/kibana-logging
value: /api/v1/namespaces/kube-system/services/kibana-logging/proxy
- name: XPACK_MONITORING_ENABLED
value: "false"
- name: XPACK_SECURITY_ENABLED
Expand Down
12 changes: 6 additions & 6 deletions hack/grab-profiles.sh
Expand Up @@ -72,10 +72,10 @@ fi

HEAPSTER_VERSION="v0.18.2"
MASTER_PPROF_PATH=""
HEAPSTER_PPROF_PATH="/api/v1/proxy/namespaces/kube-system/services/monitoring-heapster"
HEAPSTER_PPROF_PATH="/api/v1/namespaces/kube-system/services/monitoring-heapster/proxy"
KUBELET_PPROF_PATH_PREFIX="/api/v1/proxy/nodes"
SCHEDULER_PPROF_PATH_PREFIX="/api/v1/proxy/namespaces/kube-system/pods/kube-scheduler"
CONTROLLER_MANAGER_PPROF_PATH_PREFIX="/api/v1/proxy/namespaces/kube-system/pods/kube-controller-manager"
SCHEDULER_PPROF_PATH_PREFIX="/api/v1/namespaces/kube-system/pods/kube-scheduler/proxy"
CONTROLLER_MANAGER_PPROF_PATH_PREFIX="/api/v1/namespaces/kube-system/pods/kube-controller-manager/proxy"

eval set -- "${args}"

Expand Down Expand Up @@ -292,9 +292,9 @@ for component in ${profile_components}; do

if [[ "${component}" == "kubelet" ]]; then
for node in ${kubelet_addresses//[,;]/' '}; do
grab_profiles_from_component "${requested_profiles}" "${mem_pprof_flags}" "${binary}" "${tunnel_port}" "${path}/${node}" "${output_dir}/${component}" "${timestamp}"
done
else
grab_profiles_from_component "${requested_profiles}" "${mem_pprof_flags}" "${binary}" "${tunnel_port}" "${path}/${node}/proxy" "${output_dir}/${component}" "${timestamp}"
done
else
grab_profiles_from_component "${requested_profiles}" "${mem_pprof_flags}" "${binary}" "${tunnel_port}" "${path}" "${output_dir}/${component}" "${timestamp}"
fi
done
2 changes: 0 additions & 2 deletions staging/src/k8s.io/apiserver/pkg/endpoints/BUILD
Expand Up @@ -12,7 +12,6 @@ go_test(
"apiserver_test.go",
"audit_test.go",
"installer_test.go",
"proxy_test.go",
"watch_test.go",
],
embed = [":go_default_library"],
Expand All @@ -35,7 +34,6 @@ go_test(
"//vendor/k8s.io/apimachinery/pkg/runtime/serializer/streaming:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/types:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/diff:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/net:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/watch:go_default_library",
Expand Down
46 changes: 19 additions & 27 deletions staging/src/k8s.io/apiserver/pkg/endpoints/apiserver_test.go
Expand Up @@ -594,26 +594,6 @@ func (storage *SimpleRESTStorage) Watcher() *watch.FakeWatcher {
return storage.fakeWatch
}

// Implement Redirector.
var _ = rest.Redirector(&SimpleRESTStorage{})

// Implement Redirector.
func (storage *SimpleRESTStorage) ResourceLocation(ctx request.Context, id string) (*url.URL, http.RoundTripper, error) {
storage.checkContext(ctx)
// validate that the namespace context on the request matches the expected input
storage.requestedResourceNamespace = request.NamespaceValue(ctx)
if storage.expectedResourceNamespace != storage.requestedResourceNamespace {
return nil, nil, fmt.Errorf("Expected request namespace %s, but got namespace %s", storage.expectedResourceNamespace, storage.requestedResourceNamespace)
}
storage.requestedResourceLocationID = id
if err := storage.errors["resourceLocation"]; err != nil {
return nil, nil, err
}
// Make a copy so the internal URL never gets mutated
locationCopy := *storage.resourceLocation
return &locationCopy, storage.resourceLocationTransport, nil
}

// Implement Connecter
type ConnecterRESTStorage struct {
connectHandler http.Handler
Expand Down Expand Up @@ -1526,18 +1506,30 @@ func TestMetadata(t *testing.T) {
matches := map[string]int{}
for _, w := range ws {
for _, r := range w.Routes() {
t.Logf("%v %v %#v", r.Method, r.Path, r.Produces)
s := strings.Join(r.Produces, ",")
i := matches[s]
matches[s] = i + 1
}
}

if matches["text/plain,application/json,application/yaml,application/vnd.kubernetes.protobuf"] == 0 ||
matches["application/json,application/yaml,application/vnd.kubernetes.protobuf,application/json;stream=watch,application/vnd.kubernetes.protobuf;stream=watch"] == 0 ||
matches["application/json,application/yaml,application/vnd.kubernetes.protobuf"] == 0 ||
matches["*/*"] == 0 ||
len(matches) != 5 {
t.Errorf("unexpected mime types: %v", matches)
cs := []func() bool{
func() bool {
return matches["text/plain,application/json,application/yaml,application/vnd.kubernetes.protobuf"] == 0
},
func() bool {
return matches["application/json,application/yaml,application/vnd.kubernetes.protobuf,application/json;stream=watch,application/vnd.kubernetes.protobuf;stream=watch"] == 0
},
func() bool {
return matches["application/json,application/yaml,application/vnd.kubernetes.protobuf"] == 0
},
func() bool {
return len(matches) != 4
},
}
for i, c := range cs {
if c() {
t.Errorf("[%d]unexpected mime types: %#v", i, matches)
}
}
}

Expand Down
4 changes: 0 additions & 4 deletions staging/src/k8s.io/apiserver/pkg/endpoints/handlers/BUILD
Expand Up @@ -44,7 +44,6 @@ go_library(
"get.go",
"namer.go",
"patch.go",
"proxy.go",
"response.go",
"rest.go",
"update.go",
Expand All @@ -65,11 +64,8 @@ go_library(
"//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/runtime/serializer/streaming:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/types:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/httpstream:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/json:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/mergepatch:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/net:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/proxy:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/runtime:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/strategicpatch:go_default_library",
Expand Down

0 comments on commit 7b47229

Please sign in to comment.