Commit ba38a876 authored by feihujiang's avatar feihujiang

Remove useless codes about minion

parent a92c8b68
...@@ -71,9 +71,6 @@ func init() { ...@@ -71,9 +71,6 @@ func init() {
&ThirdPartyResourceList{}, &ThirdPartyResourceList{},
&ThirdPartyResourceData{}, &ThirdPartyResourceData{},
) )
// Legacy names are supported
Scheme.AddKnownTypeWithName("", "Minion", &Node{})
Scheme.AddKnownTypeWithName("", "MinionList", &NodeList{})
} }
func (*Pod) IsAnAPIObject() {} func (*Pod) IsAnAPIObject() {}
......
...@@ -23,29 +23,6 @@ import ( ...@@ -23,29 +23,6 @@ import (
versioned "k8s.io/kubernetes/pkg/api/v1" versioned "k8s.io/kubernetes/pkg/api/v1"
) )
func TestNodeConversion(t *testing.T) {
obj, err := versioned.Codec.Decode([]byte(`{"kind":"Minion","apiVersion":"v1"}`))
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
if _, ok := obj.(*api.Node); !ok {
t.Errorf("unexpected type: %#v", obj)
}
obj, err = versioned.Codec.Decode([]byte(`{"kind":"MinionList","apiVersion":"v1"}`))
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
if _, ok := obj.(*api.NodeList); !ok {
t.Errorf("unexpected type: %#v", obj)
}
obj = &api.Node{}
if err := versioned.Codec.DecodeInto([]byte(`{"kind":"Minion","apiVersion":"v1"}`), obj); err != nil {
t.Fatalf("unexpected error: %v", err)
}
}
// TestPodSpecConversion tests that ServiceAccount is an alias for // TestPodSpecConversion tests that ServiceAccount is an alias for
// ServiceAccountName. // ServiceAccountName.
func TestPodSpecConversion(t *testing.T) { func TestPodSpecConversion(t *testing.T) {
......
...@@ -86,9 +86,6 @@ func addKnownTypes() { ...@@ -86,9 +86,6 @@ func addKnownTypes() {
&ThirdPartyResourceList{}, &ThirdPartyResourceList{},
&ThirdPartyResourceData{}, &ThirdPartyResourceData{},
) )
// Legacy names are supported
api.Scheme.AddKnownTypeWithName("v1", "Minion", &Node{})
api.Scheme.AddKnownTypeWithName("v1", "MinionList", &NodeList{})
} }
func (*Pod) IsAnAPIObject() {} func (*Pod) IsAnAPIObject() {}
......
...@@ -18,7 +18,6 @@ limitations under the License. ...@@ -18,7 +18,6 @@ limitations under the License.
package kubectl package kubectl
import ( import (
"fmt"
"strings" "strings"
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
...@@ -80,10 +79,6 @@ type ShortcutExpander struct { ...@@ -80,10 +79,6 @@ type ShortcutExpander struct {
func (e ShortcutExpander) VersionAndKindForResource(resource string) (defaultVersion, kind string, err error) { func (e ShortcutExpander) VersionAndKindForResource(resource string) (defaultVersion, kind string, err error) {
resource = expandResourceShortcut(resource) resource = expandResourceShortcut(resource)
defaultVersion, kind, err = e.RESTMapper.VersionAndKindForResource(resource) defaultVersion, kind, err = e.RESTMapper.VersionAndKindForResource(resource)
// TODO: remove this once v1beta1 and v1beta2 are deprecated
if err == nil && kind == "Minion" {
err = fmt.Errorf("Alias minion(s) is deprecated. Use node(s) instead")
}
return defaultVersion, kind, err return defaultVersion, kind, err
} }
......
...@@ -580,7 +580,7 @@ func TestResourceTuple(t *testing.T) { ...@@ -580,7 +580,7 @@ func TestResourceTuple(t *testing.T) {
errFn: expectNoErr, errFn: expectNoErr,
}, },
"valid multiple with namespaced and non-namespaced types": { "valid multiple with namespaced and non-namespaced types": {
args: []string{"minions/foo", "pod/bar"}, args: []string{"nodes/foo", "pod/bar"},
errFn: expectNoErr, errFn: expectNoErr,
}, },
"mixed arg types": { "mixed arg types": {
...@@ -621,7 +621,6 @@ func TestResourceTuple(t *testing.T) { ...@@ -621,7 +621,6 @@ func TestResourceTuple(t *testing.T) {
"/namespaces/test/pods/foo": runtime.EncodeOrDie(testapi.Default.Codec(), &pods.Items[0]), "/namespaces/test/pods/foo": runtime.EncodeOrDie(testapi.Default.Codec(), &pods.Items[0]),
"/namespaces/test/pods/bar": runtime.EncodeOrDie(testapi.Default.Codec(), &pods.Items[0]), "/namespaces/test/pods/bar": runtime.EncodeOrDie(testapi.Default.Codec(), &pods.Items[0]),
"/nodes/foo": runtime.EncodeOrDie(testapi.Default.Codec(), &api.Node{ObjectMeta: api.ObjectMeta{Name: "foo"}}), "/nodes/foo": runtime.EncodeOrDie(testapi.Default.Codec(), &api.Node{ObjectMeta: api.ObjectMeta{Name: "foo"}}),
"/minions/foo": runtime.EncodeOrDie(testapi.Default.Codec(), &api.Node{ObjectMeta: api.ObjectMeta{Name: "foo"}}),
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment