mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
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:
commit
c7d1e38412
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user