remove unneeded factory codec methods

This commit is contained in:
David Eads
2018-02-21 12:10:38 -05:00
parent be04e7c1b1
commit d8a5420b7c
76 changed files with 543 additions and 362 deletions

View File

@@ -23,7 +23,9 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/client-go/rest/fake"
"k8s.io/kubernetes/pkg/api/legacyscheme"
cmdtesting "k8s.io/kubernetes/pkg/kubectl/cmd/testing"
"k8s.io/kubernetes/pkg/kubectl/scheme"
)
func TestExtraArgsFail(t *testing.T) {
@@ -31,7 +33,7 @@ func TestExtraArgsFail(t *testing.T) {
buf := bytes.NewBuffer([]byte{})
errBuf := bytes.NewBuffer([]byte{})
f, _, _, _ := cmdtesting.NewAPIFactory()
f, _ := cmdtesting.NewAPIFactory()
c := NewCmdCreate(f, buf, errBuf)
options := CreateOptions{}
if options.ValidateArgs(c, []string{"rc"}) == nil {
@@ -44,7 +46,9 @@ func TestCreateObject(t *testing.T) {
_, _, rc := testData()
rc.Items[0].Name = "redis-master-controller"
f, tf, codec, _ := cmdtesting.NewAPIFactory()
f, tf := cmdtesting.NewAPIFactory()
codec := legacyscheme.Codecs.LegacyCodec(scheme.Versions...)
tf.UnstructuredClient = &fake.RESTClient{
GroupVersion: schema.GroupVersion{Version: "v1"},
NegotiatedSerializer: unstructuredSerializer,
@@ -77,7 +81,9 @@ func TestCreateMultipleObject(t *testing.T) {
initTestErrorHandler(t)
_, svc, rc := testData()
f, tf, codec, _ := cmdtesting.NewAPIFactory()
f, tf := cmdtesting.NewAPIFactory()
codec := legacyscheme.Codecs.LegacyCodec(scheme.Versions...)
tf.UnstructuredClient = &fake.RESTClient{
GroupVersion: schema.GroupVersion{Version: "v1"},
NegotiatedSerializer: unstructuredSerializer,
@@ -114,7 +120,9 @@ func TestCreateDirectory(t *testing.T) {
_, _, rc := testData()
rc.Items[0].Name = "name"
f, tf, codec, _ := cmdtesting.NewAPIFactory()
f, tf := cmdtesting.NewAPIFactory()
codec := legacyscheme.Codecs.LegacyCodec(scheme.Versions...)
tf.UnstructuredClient = &fake.RESTClient{
GroupVersion: schema.GroupVersion{Version: "v1"},
NegotiatedSerializer: unstructuredSerializer,