NAMESPACE in own column: kubectl --all-namespaces

This commit is contained in:
Eric Tune
2015-07-01 13:56:31 -07:00
parent 21bbde46d4
commit 88fa471d06
3 changed files with 89 additions and 64 deletions

View File

@@ -241,9 +241,9 @@ func stringBody(body string) io.ReadCloser {
// }
//}
func ExamplePrintReplicationController() {
func ExamplePrintReplicationControllerWithNamespace() {
f, tf, codec := NewAPIFactory()
tf.Printer = kubectl.NewHumanReadablePrinter(false, false, false, []string{})
tf.Printer = kubectl.NewHumanReadablePrinter(false, true, false, []string{})
tf.Client = &client.FakeRESTClient{
Codec: codec,
Client: nil,
@@ -251,8 +251,9 @@ func ExamplePrintReplicationController() {
cmd := NewCmdRun(f, os.Stdout)
ctrl := &api.ReplicationController{
ObjectMeta: api.ObjectMeta{
Name: "foo",
Labels: map[string]string{"foo": "bar"},
Name: "foo",
Namespace: "beep",
Labels: map[string]string{"foo": "bar"},
},
Spec: api.ReplicationControllerSpec{
Replicas: 1,
@@ -277,8 +278,8 @@ func ExamplePrintReplicationController() {
fmt.Printf("Unexpected error: %v", err)
}
// Output:
// CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS
// foo foo someimage foo=bar 1
// NAMESPACE CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS
// beep foo foo someimage foo=bar 1
}
func ExamplePrintPodWithWideFormat() {