mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-05 02:09:56 +00:00
align example with code implementation
This commit is contained in:
parent
8a4a098323
commit
ab40fca77c
@ -21,6 +21,11 @@ and deleting pods, replication controllers, services, and minions.
|
|||||||
|
|
||||||
Most consumers should use the Config object to create a Client:
|
Most consumers should use the Config object to create a Client:
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
|
||||||
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
|
||||||
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
|
||||||
|
)
|
||||||
config := &client.Config{
|
config := &client.Config{
|
||||||
Host: "http://localhost:8080",
|
Host: "http://localhost:8080",
|
||||||
Username: "test",
|
Username: "test",
|
||||||
@ -30,7 +35,7 @@ Most consumers should use the Config object to create a Client:
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
// handle error
|
// handle error
|
||||||
}
|
}
|
||||||
client.Pods(ns).List()
|
client.Pods(api.NamespaceDefault).List(labels.Everything(), fields.Everything())
|
||||||
|
|
||||||
More advanced consumers may wish to provide their own transport via a http.RoundTripper:
|
More advanced consumers may wish to provide their own transport via a http.RoundTripper:
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user