Merge pull request #30963 from plutov/master

Automatic merge from submit-queue

Example of unversioned pkg uses correct Config struct

Currently this Doc has incorrect example - https://godoc.org/k8s.io/kubernetes/pkg/client/unversioned

So when developers use it they are confused why `client` pkg has no `Config` struct, actually this is a struct from `restclient` pkg.

Also pkg name and variable name should be equal:
`client, err := client.New(config)`

Thanks,
Alex
This commit is contained in:
Kubernetes Submit Queue 2016-09-10 04:27:05 -07:00 committed by GitHub
commit c7d1e38412

View File

@ -34,11 +34,11 @@ Most consumers should use the Config object to create a Client:
Username: "test", Username: "test",
Password: "password", Password: "password",
} }
client, err := client.New(config) c, err := client.New(config)
if err != nil { if err != nil {
// handle error // handle error
} }
pods, err := client.Pods(api.NamespaceDefault).List(api.ListOptions{}) pods, err := c.Pods(api.NamespaceDefault).List(api.ListOptions{})
if err != nil { if err != nil {
// handle error // handle error
} }
@ -49,7 +49,7 @@ More advanced consumers may wish to provide their own transport via a http.Round
Host: "https://localhost:8080", Host: "https://localhost:8080",
Transport: oauthclient.Transport(), Transport: oauthclient.Transport(),
} }
client, err := client.New(config) c, err := client.New(config)
The RESTClient type implements the Kubernetes API conventions (see `docs/devel/api-conventions.md`) The RESTClient type implements the Kubernetes API conventions (see `docs/devel/api-conventions.md`)
for a given API path and is intended for use by consumers implementing their own Kubernetes for a given API path and is intended for use by consumers implementing their own Kubernetes