Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
fbed3492
Commit
fbed3492
authored
Jul 23, 2015
by
Wojciech Tyczynski
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #11553 from pkern/patch-1
pkg/client/doc.go: update example to make it compile
parents
43f6651c
fbbc49df
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
+13
-6
doc.go
pkg/client/doc.go
+13
-6
No files found.
pkg/client/doc.go
View file @
fbed3492
...
...
@@ -22,20 +22,27 @@ and deleting pods, replication controllers, services, and minions.
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"
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/fields"
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
)
[...]
config := &client.Config{
Host: "http://localhost:8080",
Username: "test",
Password: "password",
}
client, err := client.New(&config)
client, err := client.New(config)
if err != nil {
// handle error
}
pods, err := client.Pods(api.NamespaceDefault).List(labels.Everything(), fields.Everything())
if err != nil {
// handle error
}
client.Pods(api.NamespaceDefault).List(labels.Everything(), fields.Everything())
More advanced consumers may wish to provide their own transport via a http.RoundTripper:
...
...
@@ -43,7 +50,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)
client, err := client.New(config)
The RESTClient type implements the Kubernetes API conventions (see `docs/api-conventions.md`)
for a given API path and is intended for use by consumers implementing their own Kubernetes
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment