Commit Graph

13 Commits (0076c181c7ffa757401db6df256492b5ce6ec415)

Author SHA1 Message Date
Eric Paris 6b3a6e6b98 Make copyright ownership statement generic
Instead of saying "Google Inc." (which is not always correct) say "The
Kubernetes Authors", which is generic.
2015-05-01 17:49:56 -04:00
Timothy St. Clair 2b60111fca Performance change to option enable client.QPS, client.Burst
and change default on max_requests_inflight.
2015-04-10 07:53:54 -05:00
Brendan Burns 3f98ac07c2 Add a QPS limiter to the kubernetes client. 2015-04-03 11:58:51 -07:00
Kris Rousey 6904c4d585 Fixing a lot of string formatting issues with regards to:
* Improper format specifier (e.g. %s for bools or %s for ints)
  * More or less parameters than format specifiers
  * Not calling a formatting function when it should have (e.g. Error() instead of Errorf())
2015-03-31 16:47:10 -07:00
Clayton Coleman 0307d7ba98 Set a default user agent on all client.Client calls
Form:
  kube-controller-manager/v0.10.0 (linux/amd64) kubernetes/550b98e

  <basename(os.Argv)>/<gitVersion> (<GOOS>/<GOARCH>) kubernetes/<shortGitCommit>

Can be set by other clients
2015-02-04 17:45:53 -05:00
Clayton Coleman d072232d4a Allow client.Config to be used for HTTP2 and WebSocket connections
client.Config describes how to make a client connection to a server
for HTTP traffic, but for connection upgrade scenarios cannot be
used because the underlying http.Transport object can't allow the
connection to be hijacked. Reorganize the TLS and connection wrapper
methods so that a sophisticated client can do:

    cfg := &client.Config{...} // from somewhere
    tlsConfig, _ := client.TLSConfigFor(cfg)
    _ := conn.Dial(...)
    rt := MyRoundTripper() // some func that implements grabbing requests
    wrapper, _ := client.HTTPWrappersFor(cfg)
    req := &http.Request{}
    req.Header.Set("Connection-Upgrade", ...)
    _, := wrapper.RoundTrip(req)
    // rt has been invoked with a fully formed Req with auth
    rt.Req.Write(conn)
    // read response for upgrade

It would be good to have utility function that does more of this,
but mostly enabling the HTTP2/SPDY client exec function right now.
2015-01-29 17:43:09 -05:00
Jordan Liggitt 1ebe885827 Allow client and kubelet configs to hold cert/key/ca data directly 2015-01-16 12:18:20 -05:00
deads2k 005f2e1bda don't require config.Version for IsConfigTransportTLS 2015-01-08 13:53:57 -05:00
Clayton Coleman b03fbf90f8 Make RESTClient more generic to API version, simplify version handling
RESTClient is an abstraction on top of arbitrary HTTP endpoints that
follow the Kubernetes API conventions. Refactored RESTClientFor so that
assumptions that are Kube specific happen outside of that method (so
others can reuse the RESTClient). Added more validation to client.New
to ensure clients give good input. Exposed APIVersion on RESTClient
as a method so that wrapper code (code that adds typed / structured
methods over rest endpoints like client.Client) can more easily make
decisions about what APIVersion it is running under.
2015-01-07 18:03:34 -05:00
Eric Tune 5c24855349 Rename Secure -> TLS; we may use TLS insecurely. 2014-11-13 21:42:36 -08:00
Eric Tune dd3c85be09 Use https when Insecure is selected. 2014-11-13 17:25:31 -08:00
Eric Tune 800284164a Fix format specifiers in Printf-type functions. 2014-10-09 17:06:32 -07:00
Clayton Coleman ff2eca97d9 Refactor the client (again) to better support auth
* Allows consumers to provide their own transports for common cases.
* Supports KUBE_API_VERSION on test cases for controlling which
  api version they test against
* Provides a common flag registration method for CLIs that need
  to connect to an API server (to avoid duplicating flags)
* Ensures errors are properly returned by the server
* Add a Context field to client.Config
2014-10-01 15:23:37 -04:00