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
e979b169
Commit
e979b169
authored
Feb 06, 2018
by
mbohlool
Committed by
Mehdy Bohlool
May 20, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix cyclic dependency of apiserver test for OpenAPI test
parent
b87105ae
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
genericapiserver_test.go
.../src/k8s.io/apiserver/pkg/server/genericapiserver_test.go
+9
-9
No files found.
staging/src/k8s.io/apiserver/pkg/server/genericapiserver_test.go
View file @
e979b169
...
@@ -31,7 +31,6 @@ import (
...
@@ -31,7 +31,6 @@ import (
"testing"
"testing"
"time"
"time"
// "github.com/go-openapi/spec"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/assert"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
...
@@ -50,6 +49,7 @@ import (
...
@@ -50,6 +49,7 @@ import (
"k8s.io/client-go/informers"
"k8s.io/client-go/informers"
"k8s.io/client-go/kubernetes/fake"
"k8s.io/client-go/kubernetes/fake"
restclient
"k8s.io/client-go/rest"
restclient
"k8s.io/client-go/rest"
kubeopenapi
"k8s.io/kube-openapi/pkg/common"
)
)
const
(
const
(
...
@@ -77,6 +77,12 @@ func init() {
...
@@ -77,6 +77,12 @@ func init() {
examplev1
.
AddToScheme
(
scheme
)
examplev1
.
AddToScheme
(
scheme
)
}
}
func
testGetOpenAPIDefinitions
(
_
kubeopenapi
.
ReferenceCallback
)
map
[
string
]
kubeopenapi
.
OpenAPIDefinition
{
return
map
[
string
]
kubeopenapi
.
OpenAPIDefinition
{
"k8s.io/apimachinery/pkg/apis/meta/v1.APIGroupList"
:
{},
}
}
// setUp is a convience function for setting up for (most) tests.
// setUp is a convience function for setting up for (most) tests.
func
setUp
(
t
*
testing
.
T
)
(
Config
,
*
assert
.
Assertions
)
{
func
setUp
(
t
*
testing
.
T
)
(
Config
,
*
assert
.
Assertions
)
{
config
:=
NewConfig
(
codecs
)
config
:=
NewConfig
(
codecs
)
...
@@ -89,14 +95,8 @@ func setUp(t *testing.T) (Config, *assert.Assertions) {
...
@@ -89,14 +95,8 @@ func setUp(t *testing.T) (Config, *assert.Assertions) {
t
.
Fatal
(
"unable to create fake client set"
)
t
.
Fatal
(
"unable to create fake client set"
)
}
}
// TODO restore this test, but right now, eliminate our cycle
config
.
OpenAPIConfig
=
DefaultOpenAPIConfig
(
testGetOpenAPIDefinitions
,
runtime
.
NewScheme
())
// config.OpenAPIConfig = DefaultOpenAPIConfig(testGetOpenAPIDefinitions, runtime.NewScheme())
config
.
OpenAPIConfig
.
Info
.
Version
=
"unversioned"
// config.OpenAPIConfig.Info = &spec.Info{
// InfoProps: spec.InfoProps{
// Title: "Kubernetes",
// Version: "unversioned",
// },
// }
config
.
SwaggerConfig
=
DefaultSwaggerConfig
()
config
.
SwaggerConfig
=
DefaultSwaggerConfig
()
sharedInformers
:=
informers
.
NewSharedInformerFactory
(
clientset
,
config
.
LoopbackClientConfig
.
Timeout
)
sharedInformers
:=
informers
.
NewSharedInformerFactory
(
clientset
,
config
.
LoopbackClientConfig
.
Timeout
)
config
.
Complete
(
sharedInformers
)
config
.
Complete
(
sharedInformers
)
...
...
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