|
|
|
@ -112,6 +112,7 @@ func TestGetUnknownSchemaObject(t *testing.T) {
|
|
|
|
|
streams, _, buf, _ := genericclioptions.NewTestIOStreams()
|
|
|
|
|
cmd := NewCmdGet("kubectl", tf, streams)
|
|
|
|
|
cmd.SetOut(buf)
|
|
|
|
|
cmd.SetErr(buf)
|
|
|
|
|
cmd.Run(cmd, []string{"type", "foo"})
|
|
|
|
|
|
|
|
|
|
expected := []runtime.Object{cmdtesting.NewInternalType("", "", "foo")}
|
|
|
|
@ -179,6 +180,7 @@ func TestGetObjectsWithOpenAPIOutputFormatPresent(t *testing.T) {
|
|
|
|
|
streams, _, buf, _ := genericclioptions.NewTestIOStreams()
|
|
|
|
|
cmd := NewCmdGet("kubectl", tf, streams)
|
|
|
|
|
cmd.SetOut(buf)
|
|
|
|
|
cmd.SetErr(buf)
|
|
|
|
|
cmd.Flags().Set(useOpenAPIPrintColumnFlagLabel, "true")
|
|
|
|
|
cmd.Run(cmd, []string{"pods", "foo"})
|
|
|
|
|
|
|
|
|
@ -232,6 +234,7 @@ func TestGetObjects(t *testing.T) {
|
|
|
|
|
streams, _, buf, _ := genericclioptions.NewTestIOStreams()
|
|
|
|
|
cmd := NewCmdGet("kubectl", tf, streams)
|
|
|
|
|
cmd.SetOut(buf)
|
|
|
|
|
cmd.SetErr(buf)
|
|
|
|
|
cmd.Run(cmd, []string{"pods", "foo"})
|
|
|
|
|
|
|
|
|
|
expected := `NAME AGE
|
|
|
|
@ -257,6 +260,7 @@ func TestGetObjectSubresourceStatus(t *testing.T) {
|
|
|
|
|
streams, _, buf, _ := genericclioptions.NewTestIOStreams()
|
|
|
|
|
cmd := NewCmdGet("kubectl", tf, streams)
|
|
|
|
|
cmd.SetOut(buf)
|
|
|
|
|
cmd.SetErr(buf)
|
|
|
|
|
cmd.Flags().Set("subresource", "status")
|
|
|
|
|
cmd.Run(cmd, []string{"replicationcontrollers", "rc1"})
|
|
|
|
|
|
|
|
|
@ -284,6 +288,7 @@ func TestGetObjectSubresourceScale(t *testing.T) {
|
|
|
|
|
streams, _, buf, _ := genericclioptions.NewTestIOStreams()
|
|
|
|
|
cmd := NewCmdGet("kubectl", tf, streams)
|
|
|
|
|
cmd.SetOut(buf)
|
|
|
|
|
cmd.SetErr(buf)
|
|
|
|
|
cmd.Flags().Set("subresource", "scale")
|
|
|
|
|
cmd.Run(cmd, []string{"replicationcontrollers", "rc1"})
|
|
|
|
|
|
|
|
|
@ -311,6 +316,7 @@ func TestGetTableObjects(t *testing.T) {
|
|
|
|
|
streams, _, buf, _ := genericclioptions.NewTestIOStreams()
|
|
|
|
|
cmd := NewCmdGet("kubectl", tf, streams)
|
|
|
|
|
cmd.SetOut(buf)
|
|
|
|
|
cmd.SetErr(buf)
|
|
|
|
|
cmd.Run(cmd, []string{"pods", "foo"})
|
|
|
|
|
|
|
|
|
|
expected := `NAME READY STATUS RESTARTS AGE
|
|
|
|
@ -336,6 +342,7 @@ func TestGetV1TableObjects(t *testing.T) {
|
|
|
|
|
streams, _, buf, _ := genericclioptions.NewTestIOStreams()
|
|
|
|
|
cmd := NewCmdGet("kubectl", tf, streams)
|
|
|
|
|
cmd.SetOut(buf)
|
|
|
|
|
cmd.SetErr(buf)
|
|
|
|
|
cmd.Run(cmd, []string{"pods", "foo"})
|
|
|
|
|
|
|
|
|
|
expected := `NAME READY STATUS RESTARTS AGE
|
|
|
|
@ -361,6 +368,7 @@ func TestGetObjectsShowKind(t *testing.T) {
|
|
|
|
|
streams, _, buf, _ := genericclioptions.NewTestIOStreams()
|
|
|
|
|
cmd := NewCmdGet("kubectl", tf, streams)
|
|
|
|
|
cmd.SetOut(buf)
|
|
|
|
|
cmd.SetErr(buf)
|
|
|
|
|
cmd.Flags().Set("show-kind", "true")
|
|
|
|
|
cmd.Run(cmd, []string{"pods", "foo"})
|
|
|
|
|
|
|
|
|
@ -387,6 +395,7 @@ func TestGetTableObjectsShowKind(t *testing.T) {
|
|
|
|
|
streams, _, buf, _ := genericclioptions.NewTestIOStreams()
|
|
|
|
|
cmd := NewCmdGet("kubectl", tf, streams)
|
|
|
|
|
cmd.SetOut(buf)
|
|
|
|
|
cmd.SetErr(buf)
|
|
|
|
|
cmd.Flags().Set("show-kind", "true")
|
|
|
|
|
cmd.Run(cmd, []string{"pods", "foo"})
|
|
|
|
|
|
|
|
|
@ -440,6 +449,7 @@ func TestGetMultipleResourceTypesShowKinds(t *testing.T) {
|
|
|
|
|
streams, _, buf, bufErr := genericclioptions.NewTestIOStreams()
|
|
|
|
|
cmd := NewCmdGet("kubectl", tf, streams)
|
|
|
|
|
cmd.SetOut(buf)
|
|
|
|
|
cmd.SetErr(buf)
|
|
|
|
|
cmd.Run(cmd, []string{"all"})
|
|
|
|
|
|
|
|
|
|
expected := `NAME AGE
|
|
|
|
@ -501,6 +511,7 @@ func TestGetMultipleTableResourceTypesShowKinds(t *testing.T) {
|
|
|
|
|
streams, _, buf, bufErr := genericclioptions.NewTestIOStreams()
|
|
|
|
|
cmd := NewCmdGet("kubectl", tf, streams)
|
|
|
|
|
cmd.SetOut(buf)
|
|
|
|
|
cmd.SetErr(buf)
|
|
|
|
|
cmd.Run(cmd, []string{"all"})
|
|
|
|
|
|
|
|
|
|
expected := `NAME READY STATUS RESTARTS AGE
|
|
|
|
@ -562,6 +573,7 @@ func TestNoBlankLinesForGetMultipleTableResource(t *testing.T) {
|
|
|
|
|
streams, _, buf, bufErr := genericclioptions.NewTestIOStreams()
|
|
|
|
|
cmd := NewCmdGet("kubectl", tf, streams)
|
|
|
|
|
cmd.SetOut(buf)
|
|
|
|
|
cmd.SetErr(buf)
|
|
|
|
|
|
|
|
|
|
expected := `NAME READY STATUS RESTARTS AGE
|
|
|
|
|
pod/foo 0/0 0 <unknown>
|
|
|
|
@ -631,6 +643,7 @@ func TestNoBlankLinesForGetAll(t *testing.T) {
|
|
|
|
|
streams, _, buf, errbuf := genericclioptions.NewTestIOStreams()
|
|
|
|
|
cmd := NewCmdGet("kubectl", tf, streams)
|
|
|
|
|
cmd.SetOut(buf)
|
|
|
|
|
cmd.SetErr(buf)
|
|
|
|
|
cmd.Run(cmd, []string{"all"})
|
|
|
|
|
|
|
|
|
|
expected := ``
|
|
|
|
@ -657,6 +670,7 @@ func TestNotFoundMessageForGetNonNamespacedResources(t *testing.T) {
|
|
|
|
|
streams, _, buf, errbuf := genericclioptions.NewTestIOStreams()
|
|
|
|
|
cmd := NewCmdGet("kubectl", tf, streams)
|
|
|
|
|
cmd.SetOut(buf)
|
|
|
|
|
cmd.SetErr(buf)
|
|
|
|
|
cmd.Run(cmd, []string{"persistentvolumes"})
|
|
|
|
|
|
|
|
|
|
expected := ``
|
|
|
|
@ -685,6 +699,7 @@ func TestGetObjectsShowLabels(t *testing.T) {
|
|
|
|
|
streams, _, buf, _ := genericclioptions.NewTestIOStreams()
|
|
|
|
|
cmd := NewCmdGet("kubectl", tf, streams)
|
|
|
|
|
cmd.SetOut(buf)
|
|
|
|
|
cmd.SetErr(buf)
|
|
|
|
|
cmd.Flags().Set("show-labels", "true")
|
|
|
|
|
cmd.Run(cmd, []string{"pods", "foo"})
|
|
|
|
|
|
|
|
|
@ -711,6 +726,7 @@ func TestGetTableObjectsShowLabels(t *testing.T) {
|
|
|
|
|
streams, _, buf, _ := genericclioptions.NewTestIOStreams()
|
|
|
|
|
cmd := NewCmdGet("kubectl", tf, streams)
|
|
|
|
|
cmd.SetOut(buf)
|
|
|
|
|
cmd.SetErr(buf)
|
|
|
|
|
cmd.Flags().Set("show-labels", "true")
|
|
|
|
|
cmd.Run(cmd, []string{"pods", "foo"})
|
|
|
|
|
|
|
|
|
@ -746,6 +762,7 @@ func TestGetEmptyTable(t *testing.T) {
|
|
|
|
|
streams, _, buf, errbuf := genericclioptions.NewTestIOStreams()
|
|
|
|
|
cmd := NewCmdGet("kubectl", tf, streams)
|
|
|
|
|
cmd.SetOut(buf)
|
|
|
|
|
cmd.SetErr(buf)
|
|
|
|
|
cmd.Run(cmd, []string{"pods"})
|
|
|
|
|
|
|
|
|
|
expected := ``
|
|
|
|
@ -796,6 +813,7 @@ func TestGetObjectIgnoreNotFound(t *testing.T) {
|
|
|
|
|
streams, _, buf, _ := genericclioptions.NewTestIOStreams()
|
|
|
|
|
cmd := NewCmdGet("kubectl", tf, streams)
|
|
|
|
|
cmd.SetOut(buf)
|
|
|
|
|
cmd.SetErr(buf)
|
|
|
|
|
cmd.Flags().Set("ignore-not-found", "true")
|
|
|
|
|
cmd.Flags().Set("output", "yaml")
|
|
|
|
|
cmd.Run(cmd, []string{"pods", "nonexistentpod"})
|
|
|
|
@ -911,6 +929,7 @@ func TestGetSortedObjects(t *testing.T) {
|
|
|
|
|
streams, _, buf, _ := genericclioptions.NewTestIOStreams()
|
|
|
|
|
cmd := NewCmdGet("kubectl", tf, streams)
|
|
|
|
|
cmd.SetOut(buf)
|
|
|
|
|
cmd.SetErr(buf)
|
|
|
|
|
|
|
|
|
|
// sorting with metadata.name
|
|
|
|
|
cmd.Flags().Set("sort-by", ".metadata.name")
|
|
|
|
@ -950,6 +969,7 @@ func TestGetSortedObjectsUnstructuredTable(t *testing.T) {
|
|
|
|
|
streams, _, buf, _ := genericclioptions.NewTestIOStreams()
|
|
|
|
|
cmd := NewCmdGet("kubectl", tf, streams)
|
|
|
|
|
cmd.SetOut(buf)
|
|
|
|
|
cmd.SetErr(buf)
|
|
|
|
|
|
|
|
|
|
// sorting with metadata.name
|
|
|
|
|
cmd.Flags().Set("sort-by", ".metadata.name")
|
|
|
|
@ -1182,6 +1202,7 @@ func TestGetObjectsIdentifiedByFile(t *testing.T) {
|
|
|
|
|
streams, _, buf, _ := genericclioptions.NewTestIOStreams()
|
|
|
|
|
cmd := NewCmdGet("kubectl", tf, streams)
|
|
|
|
|
cmd.SetOut(buf)
|
|
|
|
|
cmd.SetErr(buf)
|
|
|
|
|
cmd.Flags().Set("filename", "../../../testdata/controller.yaml")
|
|
|
|
|
cmd.Run(cmd, []string{})
|
|
|
|
|
|
|
|
|
@ -1208,6 +1229,7 @@ func TestGetTableObjectsIdentifiedByFile(t *testing.T) {
|
|
|
|
|
streams, _, buf, _ := genericclioptions.NewTestIOStreams()
|
|
|
|
|
cmd := NewCmdGet("kubectl", tf, streams)
|
|
|
|
|
cmd.SetOut(buf)
|
|
|
|
|
cmd.SetErr(buf)
|
|
|
|
|
cmd.Flags().Set("filename", "../../../testdata/controller.yaml")
|
|
|
|
|
cmd.Run(cmd, []string{})
|
|
|
|
|
|
|
|
|
@ -1234,6 +1256,7 @@ func TestGetListObjects(t *testing.T) {
|
|
|
|
|
streams, _, buf, _ := genericclioptions.NewTestIOStreams()
|
|
|
|
|
cmd := NewCmdGet("kubectl", tf, streams)
|
|
|
|
|
cmd.SetOut(buf)
|
|
|
|
|
cmd.SetErr(buf)
|
|
|
|
|
cmd.Run(cmd, []string{"pods"})
|
|
|
|
|
|
|
|
|
|
expected := `NAME AGE
|
|
|
|
@ -1260,6 +1283,7 @@ func TestGetListTableObjects(t *testing.T) {
|
|
|
|
|
streams, _, buf, _ := genericclioptions.NewTestIOStreams()
|
|
|
|
|
cmd := NewCmdGet("kubectl", tf, streams)
|
|
|
|
|
cmd.SetOut(buf)
|
|
|
|
|
cmd.SetErr(buf)
|
|
|
|
|
cmd.Run(cmd, []string{"pods"})
|
|
|
|
|
|
|
|
|
|
expected := `NAME READY STATUS RESTARTS AGE
|
|
|
|
@ -1286,6 +1310,7 @@ func TestGetListComponentStatus(t *testing.T) {
|
|
|
|
|
streams, _, buf, _ := genericclioptions.NewTestIOStreams()
|
|
|
|
|
cmd := NewCmdGet("kubectl", tf, streams)
|
|
|
|
|
cmd.SetOut(buf)
|
|
|
|
|
cmd.SetErr(buf)
|
|
|
|
|
cmd.Run(cmd, []string{"componentstatuses"})
|
|
|
|
|
|
|
|
|
|
expected := `NAME STATUS MESSAGE ERROR
|
|
|
|
@ -1335,6 +1360,7 @@ func TestGetMixedGenericObjects(t *testing.T) {
|
|
|
|
|
streams, _, buf, _ := genericclioptions.NewTestIOStreams()
|
|
|
|
|
cmd := NewCmdGet("kubectl", tf, streams)
|
|
|
|
|
cmd.SetOut(buf)
|
|
|
|
|
cmd.SetErr(buf)
|
|
|
|
|
cmd.Flags().Set("output", "json")
|
|
|
|
|
cmd.Run(cmd, []string{"pods"})
|
|
|
|
|
|
|
|
|
@ -1384,6 +1410,7 @@ func TestGetMultipleTypeObjects(t *testing.T) {
|
|
|
|
|
streams, _, buf, _ := genericclioptions.NewTestIOStreams()
|
|
|
|
|
cmd := NewCmdGet("kubectl", tf, streams)
|
|
|
|
|
cmd.SetOut(buf)
|
|
|
|
|
cmd.SetErr(buf)
|
|
|
|
|
cmd.Run(cmd, []string{"pods,services"})
|
|
|
|
|
|
|
|
|
|
expected := `NAME AGE
|
|
|
|
@ -1423,6 +1450,7 @@ func TestGetMultipleTypeTableObjects(t *testing.T) {
|
|
|
|
|
streams, _, buf, _ := genericclioptions.NewTestIOStreams()
|
|
|
|
|
cmd := NewCmdGet("kubectl", tf, streams)
|
|
|
|
|
cmd.SetOut(buf)
|
|
|
|
|
cmd.SetErr(buf)
|
|
|
|
|
cmd.Run(cmd, []string{"pods,services"})
|
|
|
|
|
|
|
|
|
|
expected := `NAME READY STATUS RESTARTS AGE
|
|
|
|
@ -1463,6 +1491,7 @@ func TestGetMultipleTypeObjectsAsList(t *testing.T) {
|
|
|
|
|
streams, _, buf, _ := genericclioptions.NewTestIOStreams()
|
|
|
|
|
cmd := NewCmdGet("kubectl", tf, streams)
|
|
|
|
|
cmd.SetOut(buf)
|
|
|
|
|
cmd.SetErr(buf)
|
|
|
|
|
|
|
|
|
|
cmd.Flags().Set("output", "json")
|
|
|
|
|
cmd.Run(cmd, []string{"pods,services"})
|
|
|
|
@ -1565,6 +1594,7 @@ func TestGetMultipleTypeObjectsWithLabelSelector(t *testing.T) {
|
|
|
|
|
streams, _, buf, _ := genericclioptions.NewTestIOStreams()
|
|
|
|
|
cmd := NewCmdGet("kubectl", tf, streams)
|
|
|
|
|
cmd.SetOut(buf)
|
|
|
|
|
cmd.SetErr(buf)
|
|
|
|
|
|
|
|
|
|
cmd.Flags().Set("selector", "a=b")
|
|
|
|
|
cmd.Run(cmd, []string{"pods,services"})
|
|
|
|
@ -1609,6 +1639,7 @@ func TestGetMultipleTypeTableObjectsWithLabelSelector(t *testing.T) {
|
|
|
|
|
streams, _, buf, _ := genericclioptions.NewTestIOStreams()
|
|
|
|
|
cmd := NewCmdGet("kubectl", tf, streams)
|
|
|
|
|
cmd.SetOut(buf)
|
|
|
|
|
cmd.SetErr(buf)
|
|
|
|
|
|
|
|
|
|
cmd.Flags().Set("selector", "a=b")
|
|
|
|
|
cmd.Run(cmd, []string{"pods,services"})
|
|
|
|
@ -1653,6 +1684,7 @@ func TestGetMultipleTypeObjectsWithFieldSelector(t *testing.T) {
|
|
|
|
|
streams, _, buf, _ := genericclioptions.NewTestIOStreams()
|
|
|
|
|
cmd := NewCmdGet("kubectl", tf, streams)
|
|
|
|
|
cmd.SetOut(buf)
|
|
|
|
|
cmd.SetErr(buf)
|
|
|
|
|
|
|
|
|
|
cmd.Flags().Set("field-selector", "a=b")
|
|
|
|
|
cmd.Run(cmd, []string{"pods,services"})
|
|
|
|
@ -1697,6 +1729,7 @@ func TestGetMultipleTypeTableObjectsWithFieldSelector(t *testing.T) {
|
|
|
|
|
streams, _, buf, _ := genericclioptions.NewTestIOStreams()
|
|
|
|
|
cmd := NewCmdGet("kubectl", tf, streams)
|
|
|
|
|
cmd.SetOut(buf)
|
|
|
|
|
cmd.SetErr(buf)
|
|
|
|
|
|
|
|
|
|
cmd.Flags().Set("field-selector", "a=b")
|
|
|
|
|
cmd.Run(cmd, []string{"pods,services"})
|
|
|
|
@ -1743,6 +1776,7 @@ func TestGetMultipleTypeObjectsWithDirectReference(t *testing.T) {
|
|
|
|
|
streams, _, buf, _ := genericclioptions.NewTestIOStreams()
|
|
|
|
|
cmd := NewCmdGet("kubectl", tf, streams)
|
|
|
|
|
cmd.SetOut(buf)
|
|
|
|
|
cmd.SetErr(buf)
|
|
|
|
|
|
|
|
|
|
cmd.Run(cmd, []string{"services/bar", "node/foo"})
|
|
|
|
|
|
|
|
|
@ -1787,6 +1821,7 @@ func TestGetMultipleTypeTableObjectsWithDirectReference(t *testing.T) {
|
|
|
|
|
streams, _, buf, _ := genericclioptions.NewTestIOStreams()
|
|
|
|
|
cmd := NewCmdGet("kubectl", tf, streams)
|
|
|
|
|
cmd.SetOut(buf)
|
|
|
|
|
cmd.SetErr(buf)
|
|
|
|
|
|
|
|
|
|
cmd.Run(cmd, []string{"services/bar", "node/foo"})
|
|
|
|
|
|
|
|
|
@ -1942,6 +1977,7 @@ func TestWatchLabelSelector(t *testing.T) {
|
|
|
|
|
streams, _, buf, _ := genericclioptions.NewTestIOStreams()
|
|
|
|
|
cmd := NewCmdGet("kubectl", tf, streams)
|
|
|
|
|
cmd.SetOut(buf)
|
|
|
|
|
cmd.SetErr(buf)
|
|
|
|
|
|
|
|
|
|
cmd.Flags().Set("watch", "true")
|
|
|
|
|
cmd.Flags().Set("selector", "a=b")
|
|
|
|
@ -1993,6 +2029,7 @@ func TestWatchTableLabelSelector(t *testing.T) {
|
|
|
|
|
streams, _, buf, _ := genericclioptions.NewTestIOStreams()
|
|
|
|
|
cmd := NewCmdGet("kubectl", tf, streams)
|
|
|
|
|
cmd.SetOut(buf)
|
|
|
|
|
cmd.SetErr(buf)
|
|
|
|
|
|
|
|
|
|
cmd.Flags().Set("watch", "true")
|
|
|
|
|
cmd.Flags().Set("selector", "a=b")
|
|
|
|
@ -2044,6 +2081,7 @@ func TestWatchFieldSelector(t *testing.T) {
|
|
|
|
|
streams, _, buf, _ := genericclioptions.NewTestIOStreams()
|
|
|
|
|
cmd := NewCmdGet("kubectl", tf, streams)
|
|
|
|
|
cmd.SetOut(buf)
|
|
|
|
|
cmd.SetErr(buf)
|
|
|
|
|
|
|
|
|
|
cmd.Flags().Set("watch", "true")
|
|
|
|
|
cmd.Flags().Set("field-selector", "a=b")
|
|
|
|
@ -2095,6 +2133,7 @@ func TestWatchTableFieldSelector(t *testing.T) {
|
|
|
|
|
streams, _, buf, _ := genericclioptions.NewTestIOStreams()
|
|
|
|
|
cmd := NewCmdGet("kubectl", tf, streams)
|
|
|
|
|
cmd.SetOut(buf)
|
|
|
|
|
cmd.SetErr(buf)
|
|
|
|
|
|
|
|
|
|
cmd.Flags().Set("watch", "true")
|
|
|
|
|
cmd.Flags().Set("field-selector", "a=b")
|
|
|
|
@ -2140,6 +2179,7 @@ func TestWatchResource(t *testing.T) {
|
|
|
|
|
streams, _, buf, _ := genericclioptions.NewTestIOStreams()
|
|
|
|
|
cmd := NewCmdGet("kubectl", tf, streams)
|
|
|
|
|
cmd.SetOut(buf)
|
|
|
|
|
cmd.SetErr(buf)
|
|
|
|
|
|
|
|
|
|
cmd.Flags().Set("watch", "true")
|
|
|
|
|
cmd.Run(cmd, []string{"pods", "foo"})
|
|
|
|
@ -2184,6 +2224,7 @@ func TestWatchStatus(t *testing.T) {
|
|
|
|
|
streams, _, buf, _ := genericclioptions.NewTestIOStreams()
|
|
|
|
|
cmd := NewCmdGet("kubectl", tf, streams)
|
|
|
|
|
cmd.SetOut(buf)
|
|
|
|
|
cmd.SetErr(buf)
|
|
|
|
|
|
|
|
|
|
cmd.Flags().Set("watch", "true")
|
|
|
|
|
cmd.Run(cmd, []string{"pods", "foo"})
|
|
|
|
@ -2230,6 +2271,7 @@ func TestWatchTableResource(t *testing.T) {
|
|
|
|
|
streams, _, buf, _ := genericclioptions.NewTestIOStreams()
|
|
|
|
|
cmd := NewCmdGet("kubectl", tf, streams)
|
|
|
|
|
cmd.SetOut(buf)
|
|
|
|
|
cmd.SetErr(buf)
|
|
|
|
|
|
|
|
|
|
cmd.Flags().Set("watch", "true")
|
|
|
|
|
cmd.Run(cmd, []string{"pods", "foo"})
|
|
|
|
@ -2336,6 +2378,7 @@ func TestWatchResourceTable(t *testing.T) {
|
|
|
|
|
streams, _, buf, _ := genericclioptions.NewTestIOStreams()
|
|
|
|
|
cmd := NewCmdGet("kubectl", tf, streams)
|
|
|
|
|
cmd.SetOut(buf)
|
|
|
|
|
cmd.SetErr(buf)
|
|
|
|
|
|
|
|
|
|
cmd.Flags().Set("watch", "true")
|
|
|
|
|
cmd.Run(cmd, []string{"pods"})
|
|
|
|
@ -2548,6 +2591,7 @@ pod/foo
|
|
|
|
|
streams, _, buf, _ := genericclioptions.NewTestIOStreams()
|
|
|
|
|
cmd := NewCmdGet("kubectl", tf, streams)
|
|
|
|
|
cmd.SetOut(buf)
|
|
|
|
|
cmd.SetErr(buf)
|
|
|
|
|
|
|
|
|
|
cmd.Flags().Set("watch", "true")
|
|
|
|
|
cmd.Flags().Set("all-namespaces", "true")
|
|
|
|
@ -2594,6 +2638,7 @@ func TestWatchResourceIdentifiedByFile(t *testing.T) {
|
|
|
|
|
streams, _, buf, _ := genericclioptions.NewTestIOStreams()
|
|
|
|
|
cmd := NewCmdGet("kubectl", tf, streams)
|
|
|
|
|
cmd.SetOut(buf)
|
|
|
|
|
cmd.SetErr(buf)
|
|
|
|
|
|
|
|
|
|
cmd.Flags().Set("watch", "true")
|
|
|
|
|
cmd.Flags().Set("filename", "../../../testdata/controller.yaml")
|
|
|
|
@ -2638,6 +2683,7 @@ func TestWatchOnlyResource(t *testing.T) {
|
|
|
|
|
streams, _, buf, _ := genericclioptions.NewTestIOStreams()
|
|
|
|
|
cmd := NewCmdGet("kubectl", tf, streams)
|
|
|
|
|
cmd.SetOut(buf)
|
|
|
|
|
cmd.SetErr(buf)
|
|
|
|
|
|
|
|
|
|
cmd.Flags().Set("watch-only", "true")
|
|
|
|
|
cmd.Run(cmd, []string{"pods", "foo"})
|
|
|
|
@ -2680,6 +2726,7 @@ func TestWatchOnlyTableResource(t *testing.T) {
|
|
|
|
|
streams, _, buf, _ := genericclioptions.NewTestIOStreams()
|
|
|
|
|
cmd := NewCmdGet("kubectl", tf, streams)
|
|
|
|
|
cmd.SetOut(buf)
|
|
|
|
|
cmd.SetErr(buf)
|
|
|
|
|
|
|
|
|
|
cmd.Flags().Set("watch-only", "true")
|
|
|
|
|
cmd.Run(cmd, []string{"pods", "foo"})
|
|
|
|
@ -2725,6 +2772,7 @@ func TestWatchOnlyList(t *testing.T) {
|
|
|
|
|
streams, _, buf, _ := genericclioptions.NewTestIOStreams()
|
|
|
|
|
cmd := NewCmdGet("kubectl", tf, streams)
|
|
|
|
|
cmd.SetOut(buf)
|
|
|
|
|
cmd.SetErr(buf)
|
|
|
|
|
|
|
|
|
|
cmd.Flags().Set("watch-only", "true")
|
|
|
|
|
cmd.Run(cmd, []string{"pods"})
|
|
|
|
@ -2770,6 +2818,7 @@ func TestWatchOnlyTableList(t *testing.T) {
|
|
|
|
|
streams, _, buf, _ := genericclioptions.NewTestIOStreams()
|
|
|
|
|
cmd := NewCmdGet("kubectl", tf, streams)
|
|
|
|
|
cmd.SetOut(buf)
|
|
|
|
|
cmd.SetErr(buf)
|
|
|
|
|
|
|
|
|
|
cmd.Flags().Set("watch-only", "true")
|
|
|
|
|
cmd.Run(cmd, []string{"pods"})
|
|
|
|
|