From a456b4c424a1ef70833f2ea4d82e1fd993dec3e2 Mon Sep 17 00:00:00 2001 From: feihujiang Date: Mon, 19 Oct 2015 18:28:00 +0800 Subject: [PATCH] Remove useless codes about Minion kind --- contrib/completions/bash/kubectl | 1 - pkg/api/install/install.go | 3 --- pkg/controller/node/nodecontroller_test.go | 2 +- pkg/kubectl/describe.go | 1 - pkg/registry/pod/etcd/etcd.go | 2 +- pkg/registry/pod/etcd/etcd_test.go | 7 ------- 6 files changed, 2 insertions(+), 14 deletions(-) diff --git a/contrib/completions/bash/kubectl b/contrib/completions/bash/kubectl index cdd77d3f467..5306ea40649 100644 --- a/contrib/completions/bash/kubectl +++ b/contrib/completions/bash/kubectl @@ -331,7 +331,6 @@ _kubectl_describe() must_have_one_flag=() must_have_one_noun=() must_have_one_noun+=("limitrange") - must_have_one_noun+=("minion") must_have_one_noun+=("namespace") must_have_one_noun+=("node") must_have_one_noun+=("persistentvolume") diff --git a/pkg/api/install/install.go b/pkg/api/install/install.go index 0bce74be126..49b68407685 100644 --- a/pkg/api/install/install.go +++ b/pkg/api/install/install.go @@ -68,13 +68,10 @@ func init() { groupMeta.SelfLinker = runtime.SelfLinker(accessor) - // the list of kinds that are scoped at the root of the api hierarchy - // if a kind is not enumerated here, it is assumed to have a namespace scope // the list of kinds that are scoped at the root of the api hierarchy // if a kind is not enumerated here, it is assumed to have a namespace scope rootScoped := sets.NewString( "Node", - "Minion", "Namespace", "PersistentVolume", "ComponentStatus", diff --git a/pkg/controller/node/nodecontroller_test.go b/pkg/controller/node/nodecontroller_test.go index abe3998ca9d..b427aed70f6 100644 --- a/pkg/controller/node/nodecontroller_test.go +++ b/pkg/controller/node/nodecontroller_test.go @@ -75,7 +75,7 @@ func (m *FakeNodeHandler) Create(node *api.Node) (*api.Node, error) { }() for _, n := range m.Existing { if n.Name == node.Name { - return nil, apierrors.NewAlreadyExists("Minion", node.Name) + return nil, apierrors.NewAlreadyExists("Node", node.Name) } } if m.CreateHook == nil || m.CreateHook(m, node) { diff --git a/pkg/kubectl/describe.go b/pkg/kubectl/describe.go index 2699cfd2438..d2c8904b483 100644 --- a/pkg/kubectl/describe.go +++ b/pkg/kubectl/describe.go @@ -73,7 +73,6 @@ func describerMap(c *client.Client) map[string]Describer { "Secret": &SecretDescriber{c}, "Service": &ServiceDescriber{c}, "ServiceAccount": &ServiceAccountDescriber{c}, - "Minion": &NodeDescriber{c}, "Node": &NodeDescriber{c}, "LimitRange": &LimitRangeDescriber{c}, "ResourceQuota": &ResourceQuotaDescriber{c}, diff --git a/pkg/registry/pod/etcd/etcd.go b/pkg/registry/pod/etcd/etcd.go index f54ad192891..d2e7cf124b1 100644 --- a/pkg/registry/pod/etcd/etcd.go +++ b/pkg/registry/pod/etcd/etcd.go @@ -142,7 +142,7 @@ var _ = rest.Creater(&BindingREST{}) func (r *BindingREST) Create(ctx api.Context, obj runtime.Object) (out runtime.Object, err error) { binding := obj.(*api.Binding) // TODO: move me to a binding strategy - if len(binding.Target.Kind) != 0 && (binding.Target.Kind != "Node" && binding.Target.Kind != "Minion") { + if len(binding.Target.Kind) != 0 && binding.Target.Kind != "Node" { return nil, errors.NewInvalid("binding", binding.Name, fielderrors.ValidationErrorList{fielderrors.NewFieldInvalid("to.kind", binding.Target.Kind, "must be empty, 'Node', or 'Minion'")}) } if len(binding.Target.Name) == 0 { diff --git a/pkg/registry/pod/etcd/etcd_test.go b/pkg/registry/pod/etcd/etcd_test.go index 19cc073954b..94aad016500 100644 --- a/pkg/registry/pod/etcd/etcd_test.go +++ b/pkg/registry/pod/etcd/etcd_test.go @@ -541,13 +541,6 @@ func TestEtcdCreateBinding(t *testing.T) { }, errOK: func(err error) bool { return err == nil }, }, - "kindMinion": { - binding: api.Binding{ - ObjectMeta: api.ObjectMeta{Namespace: api.NamespaceDefault, Name: "foo"}, - Target: api.ObjectReference{Name: "machine4", Kind: "Minion"}, - }, - errOK: func(err error) bool { return err == nil }, - }, } for k, test := range testCases { storage, bindingStorage, _, fakeClient := newStorage(t)