mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-11 14:11:14 +00:00
Client should validate the incoming host value
Convert host:port and URLs passed to client.New() into the proper values, and return an error if the value is invalid. Change CLI to return an error if -master is invalid. Remove Client.rawRequest which was not in use, and fix the involved tests. Add NewOrDie Preserves the behavior of the client to not auth when a non-https URL is passed (although in the future this should be corrected).
This commit is contained in:
@@ -24,6 +24,7 @@ import (
|
||||
verflag "github.com/GoogleCloudPlatform/kubernetes/pkg/version/flag"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/plugin/pkg/scheduler"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/plugin/pkg/scheduler/factory"
|
||||
"github.com/golang/glog"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -38,7 +39,10 @@ func main() {
|
||||
verflag.PrintAndExitIfRequested()
|
||||
|
||||
// TODO: security story for plugins!
|
||||
kubeClient := client.New("http://"+*master, nil)
|
||||
kubeClient, err := client.New(*master, nil)
|
||||
if err != nil {
|
||||
glog.Fatalf("Invalid -master: %v", err)
|
||||
}
|
||||
|
||||
configFactory := &factory.ConfigFactory{Client: kubeClient}
|
||||
config := configFactory.Create()
|
||||
|
Reference in New Issue
Block a user