mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 15:58:37 +00:00
Remove useless codes about minion
This commit is contained in:
parent
a92c8b6886
commit
ba38a8764b
@ -71,9 +71,6 @@ func init() {
|
||||
&ThirdPartyResourceList{},
|
||||
&ThirdPartyResourceData{},
|
||||
)
|
||||
// Legacy names are supported
|
||||
Scheme.AddKnownTypeWithName("", "Minion", &Node{})
|
||||
Scheme.AddKnownTypeWithName("", "MinionList", &NodeList{})
|
||||
}
|
||||
|
||||
func (*Pod) IsAnAPIObject() {}
|
||||
|
@ -23,29 +23,6 @@ import (
|
||||
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
|
||||
// ServiceAccountName.
|
||||
func TestPodSpecConversion(t *testing.T) {
|
||||
|
@ -86,9 +86,6 @@ func addKnownTypes() {
|
||||
&ThirdPartyResourceList{},
|
||||
&ThirdPartyResourceData{},
|
||||
)
|
||||
// Legacy names are supported
|
||||
api.Scheme.AddKnownTypeWithName("v1", "Minion", &Node{})
|
||||
api.Scheme.AddKnownTypeWithName("v1", "MinionList", &NodeList{})
|
||||
}
|
||||
|
||||
func (*Pod) IsAnAPIObject() {}
|
||||
|
@ -18,7 +18,6 @@ limitations under the License.
|
||||
package kubectl
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
@ -80,10 +79,6 @@ type ShortcutExpander struct {
|
||||
func (e ShortcutExpander) VersionAndKindForResource(resource string) (defaultVersion, kind string, err error) {
|
||||
resource = expandResourceShortcut(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
|
||||
}
|
||||
|
||||
|
@ -580,7 +580,7 @@ func TestResourceTuple(t *testing.T) {
|
||||
errFn: expectNoErr,
|
||||
},
|
||||
"valid multiple with namespaced and non-namespaced types": {
|
||||
args: []string{"minions/foo", "pod/bar"},
|
||||
args: []string{"nodes/foo", "pod/bar"},
|
||||
errFn: expectNoErr,
|
||||
},
|
||||
"mixed arg types": {
|
||||
@ -621,7 +621,6 @@ func TestResourceTuple(t *testing.T) {
|
||||
"/namespaces/test/pods/foo": 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"}}),
|
||||
"/minions/foo": runtime.EncodeOrDie(testapi.Default.Codec(), &api.Node{ObjectMeta: api.ObjectMeta{Name: "foo"}}),
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user