mirror of
https://github.com/niusmallnan/steve.git
synced 2025-04-27 19:06:05 +00:00
cleanup: Remove unused function
HandlerFromConfig was not used in steve or rancher.
This commit is contained in:
parent
95da447d90
commit
18afa8868f
@ -5,7 +5,6 @@ import (
|
||||
"net/url"
|
||||
"strings"
|
||||
|
||||
"github.com/rancher/wrangler/pkg/kubeconfig"
|
||||
"github.com/sirupsen/logrus"
|
||||
"k8s.io/apimachinery/pkg/util/proxy"
|
||||
"k8s.io/apiserver/pkg/authentication/user"
|
||||
@ -14,17 +13,6 @@ import (
|
||||
"k8s.io/client-go/transport"
|
||||
)
|
||||
|
||||
// Mostly copied from "kubectl proxy" code
|
||||
func HandlerFromConfig(prefix, kubeConfig string) (http.Handler, error) {
|
||||
loader := kubeconfig.GetInteractiveClientConfig(kubeConfig)
|
||||
cfg, err := loader.ClientConfig()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return Handler(prefix, cfg)
|
||||
}
|
||||
|
||||
func ImpersonatingHandler(prefix string, cfg *rest.Config) http.Handler {
|
||||
return http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) {
|
||||
impersonate(rw, req, prefix, cfg)
|
||||
|
Loading…
Reference in New Issue
Block a user