mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-14 13:45:06 +00:00
Update basic example in client docs
This commit is contained in:
@@ -24,8 +24,6 @@ Most consumers should use the Config object to create a Client:
|
||||
import (
|
||||
client "k8s.io/kubernetes/pkg/client/unversioned"
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
)
|
||||
|
||||
[...]
|
||||
@@ -39,7 +37,7 @@ Most consumers should use the Config object to create a Client:
|
||||
if err != nil {
|
||||
// handle error
|
||||
}
|
||||
pods, err := client.Pods(api.NamespaceDefault).List(labels.Everything(), fields.Everything())
|
||||
pods, err := client.Pods(api.NamespaceDefault).List(api.ListOptions{})
|
||||
if err != nil {
|
||||
// handle error
|
||||
}
|
||||
|
Reference in New Issue
Block a user