Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
ba38a876
Commit
ba38a876
authored
Sep 15, 2015
by
feihujiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove useless codes about minion
parent
a92c8b68
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
1 addition
and
36 deletions
+1
-36
register.go
pkg/api/register.go
+0
-3
conversion_test.go
pkg/api/v1/conversion_test.go
+0
-23
register.go
pkg/api/v1/register.go
+0
-3
kubectl.go
pkg/kubectl/kubectl.go
+0
-5
builder_test.go
pkg/kubectl/resource/builder_test.go
+1
-2
No files found.
pkg/api/register.go
View file @
ba38a876
...
@@ -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
()
{}
...
...
pkg/api/v1/conversion_test.go
View file @
ba38a876
...
@@ -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
)
{
...
...
pkg/api/v1/register.go
View file @
ba38a876
...
@@ -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
()
{}
...
...
pkg/kubectl/kubectl.go
View file @
ba38a876
...
@@ -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
}
}
...
...
pkg/kubectl/resource/builder_test.go
View file @
ba38a876
...
@@ -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
{
"
minion
s/foo"
,
"pod/bar"
},
args
:
[]
string
{
"
node
s/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"
}}),
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment