remove unnecessary factory delegation for RESTClientGetter method

This commit is contained in:
David Eads
2018-05-24 09:33:36 -04:00
committed by Maciej Szulik
parent 4da73a5f3d
commit c85e69aeb9
89 changed files with 228 additions and 360 deletions

View File

@@ -322,10 +322,9 @@ func TestLabelErrors(t *testing.T) {
for k, testCase := range testCases {
t.Run(k, func(t *testing.T) {
tf := cmdtesting.NewTestFactory()
tf := cmdtesting.NewTestFactory().WithNamespace("test")
defer tf.Cleanup()
tf.Namespace = "test"
tf.ClientConfigVal = defaultClientConfig()
ioStreams, _, _, _ := genericclioptions.NewTestIOStreams()
@@ -357,7 +356,7 @@ func TestLabelErrors(t *testing.T) {
func TestLabelForResourceFromFile(t *testing.T) {
pods, _, _ := testData()
tf := cmdtesting.NewTestFactory()
tf := cmdtesting.NewTestFactory().WithNamespace("test")
defer tf.Cleanup()
codec := legacyscheme.Codecs.LegacyCodec(scheme.Scheme.PrioritizedVersionsAllGroups()...)
@@ -388,7 +387,6 @@ func TestLabelForResourceFromFile(t *testing.T) {
}
}),
}
tf.Namespace = "test"
tf.ClientConfigVal = defaultClientConfig()
ioStreams, _, buf, _ := genericclioptions.NewTestIOStreams()
@@ -411,7 +409,7 @@ func TestLabelForResourceFromFile(t *testing.T) {
}
func TestLabelLocal(t *testing.T) {
tf := cmdtesting.NewTestFactory()
tf := cmdtesting.NewTestFactory().WithNamespace("test")
defer tf.Cleanup()
tf.UnstructuredClient = &fake.RESTClient{
@@ -421,7 +419,6 @@ func TestLabelLocal(t *testing.T) {
return nil, nil
}),
}
tf.Namespace = "test"
tf.ClientConfigVal = defaultClientConfig()
ioStreams, _, buf, _ := genericclioptions.NewTestIOStreams()
@@ -446,7 +443,7 @@ func TestLabelLocal(t *testing.T) {
func TestLabelMultipleObjects(t *testing.T) {
pods, _, _ := testData()
tf := cmdtesting.NewTestFactory()
tf := cmdtesting.NewTestFactory().WithNamespace("test")
defer tf.Cleanup()
codec := legacyscheme.Codecs.LegacyCodec(scheme.Scheme.PrioritizedVersionsAllGroups()...)
@@ -479,7 +476,6 @@ func TestLabelMultipleObjects(t *testing.T) {
}
}),
}
tf.Namespace = "test"
tf.ClientConfigVal = defaultClientConfig()
ioStreams, _, buf, _ := genericclioptions.NewTestIOStreams()