Commit c7d1e384 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

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
parents cfe53d14 41ffa9a2
......@@ -34,11 +34,11 @@ Most consumers should use the Config object to create a Client:
Username: "test",
Password: "password",
}
client, err := client.New(config)
c, err := client.New(config)
if err != nil {
// handle error
}
pods, err := client.Pods(api.NamespaceDefault).List(api.ListOptions{})
pods, err := c.Pods(api.NamespaceDefault).List(api.ListOptions{})
if err != nil {
// handle error
}
......@@ -49,7 +49,7 @@ More advanced consumers may wish to provide their own transport via a http.Round
Host: "https://localhost:8080",
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`)
for a given API path and is intended for use by consumers implementing their own Kubernetes
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment