mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-09 13:12:20 +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:
@@ -92,7 +92,10 @@ func main() {
|
||||
Port: *minionPort,
|
||||
}
|
||||
|
||||
client := client.New("http://"+net.JoinHostPort(*address, strconv.Itoa(int(*port))), nil)
|
||||
client, err := client.New(net.JoinHostPort(*address, strconv.Itoa(int(*port))), nil)
|
||||
if err != nil {
|
||||
glog.Fatalf("Invalid server address: %v", err)
|
||||
}
|
||||
|
||||
m := master.New(&master.Config{
|
||||
Client: client,
|
||||
|
Reference in New Issue
Block a user