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
ca803fc5
Commit
ca803fc5
authored
Sep 12, 2015
by
Chao Xu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
address lavalamp's comment on using testapi instead of latest, and adding…
address lavalamp's comment on using testapi instead of latest, and adding comments for public method.
parent
f5023929
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
2 deletions
+7
-2
install_test.go
pkg/api/install/install_test.go
+2
-0
registered.go
pkg/api/registered/registered.go
+2
-0
install_test.go
pkg/apis/experimental/install/install_test.go
+2
-0
factory_test.go
plugin/pkg/scheduler/factory/factory_test.go
+1
-2
No files found.
pkg/api/install/install_test.go
View file @
ca803fc5
...
@@ -46,6 +46,8 @@ func TestResourceVersioner(t *testing.T) {
...
@@ -46,6 +46,8 @@ func TestResourceVersioner(t *testing.T) {
func
TestCodec
(
t
*
testing
.
T
)
{
func
TestCodec
(
t
*
testing
.
T
)
{
pod
:=
internal
.
Pod
{}
pod
:=
internal
.
Pod
{}
// We do want to use package latest rather than testapi here, because we
// want to test if the package install and package latest work as expected.
data
,
err
:=
latest
.
GroupOrDie
(
""
)
.
Codec
.
Encode
(
&
pod
)
data
,
err
:=
latest
.
GroupOrDie
(
""
)
.
Codec
.
Encode
(
&
pod
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatalf
(
"unexpected error: %v"
,
err
)
t
.
Fatalf
(
"unexpected error: %v"
,
err
)
...
...
pkg/api/registered/registered.go
View file @
ca803fc5
...
@@ -67,6 +67,8 @@ func IsRegisteredAPIVersion(version string) bool {
...
@@ -67,6 +67,8 @@ func IsRegisteredAPIVersion(version string) bool {
return
false
return
false
}
}
// GroupVersionsForGroup returns the registered versions of a group in the form
// of "group/version".
func
GroupVersionsForGroup
(
group
string
)
[]
string
{
func
GroupVersionsForGroup
(
group
string
)
[]
string
{
ret
:=
[]
string
{}
ret
:=
[]
string
{}
for
_
,
v
:=
range
RegisteredVersions
{
for
_
,
v
:=
range
RegisteredVersions
{
...
...
pkg/apis/experimental/install/install_test.go
View file @
ca803fc5
...
@@ -47,6 +47,8 @@ func TestResourceVersioner(t *testing.T) {
...
@@ -47,6 +47,8 @@ func TestResourceVersioner(t *testing.T) {
func
TestCodec
(
t
*
testing
.
T
)
{
func
TestCodec
(
t
*
testing
.
T
)
{
daemonSet
:=
experimental
.
DaemonSet
{}
daemonSet
:=
experimental
.
DaemonSet
{}
// We do want to use package latest rather than testapi here, because we
// want to test if the package install and package latest work as expected.
data
,
err
:=
latest
.
GroupOrDie
(
"experimental"
)
.
Codec
.
Encode
(
&
daemonSet
)
data
,
err
:=
latest
.
GroupOrDie
(
"experimental"
)
.
Codec
.
Encode
(
&
daemonSet
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatalf
(
"unexpected error: %v"
,
err
)
t
.
Fatalf
(
"unexpected error: %v"
,
err
)
...
...
plugin/pkg/scheduler/factory/factory_test.go
View file @
ca803fc5
...
@@ -24,7 +24,6 @@ import (
...
@@ -24,7 +24,6 @@ import (
"time"
"time"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/latest"
"k8s.io/kubernetes/pkg/api/testapi"
"k8s.io/kubernetes/pkg/api/testapi"
"k8s.io/kubernetes/pkg/client/cache"
"k8s.io/kubernetes/pkg/client/cache"
client
"k8s.io/kubernetes/pkg/client/unversioned"
client
"k8s.io/kubernetes/pkg/client/unversioned"
...
@@ -143,7 +142,7 @@ func TestDefaultErrorFunc(t *testing.T) {
...
@@ -143,7 +142,7 @@ func TestDefaultErrorFunc(t *testing.T) {
}
}
handler
:=
util
.
FakeHandler
{
handler
:=
util
.
FakeHandler
{
StatusCode
:
200
,
StatusCode
:
200
,
ResponseBody
:
runtime
.
EncodeOrDie
(
latest
.
GroupOrDie
(
""
)
.
Codec
,
testPod
),
ResponseBody
:
runtime
.
EncodeOrDie
(
testapi
.
Default
.
Codec
()
,
testPod
),
T
:
t
,
T
:
t
,
}
}
mux
:=
http
.
NewServeMux
()
mux
:=
http
.
NewServeMux
()
...
...
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