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
56a2cf40
Commit
56a2cf40
authored
Apr 14, 2016
by
George Tankersley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: add certificates to existing test infrastructure
parent
b084d202
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
11 deletions
+29
-11
test-go.sh
hack/test-go.sh
+1
-1
test-integration.sh
hack/test-integration.sh
+1
-1
testapi.go
pkg/api/testapi/testapi.go
+20
-9
master_test.go
pkg/master/master_test.go
+2
-0
master_utils.go
test/integration/framework/master_utils.go
+5
-0
No files found.
hack/test-go.sh
View file @
56a2cf40
...
...
@@ -60,7 +60,7 @@ KUBE_GOVERALLS_BIN=${KUBE_GOVERALLS_BIN:-}
# "v1,compute/v1alpha1,experimental/v1alpha2;v1,compute/v2,experimental/v1alpha3"
# FIXME: due to current implementation of a test client (see: pkg/api/testapi/testapi.go)
# ONLY the last version is tested in each group.
KUBE_TEST_API_VERSIONS
=
${
KUBE_TEST_API_VERSIONS
:-
"v1,autoscaling/v1,batch/v1,batch/v2alpha1,extensions/v1beta1,apps/v1alpha1,federation/v1alpha1,policy/v1alpha1,rbac.authorization.k8s.io/v1alpha1"
}
KUBE_TEST_API_VERSIONS
=
${
KUBE_TEST_API_VERSIONS
:-
"v1,autoscaling/v1,batch/v1,batch/v2alpha1,extensions/v1beta1,apps/v1alpha1,federation/v1alpha1,policy/v1alpha1,rbac.authorization.k8s.io/v1alpha1
,certificates/v1alpha1
"
}
# once we have multiple group supports
# Create a junit-style XML test report in this directory if set.
KUBE_JUNIT_REPORT_DIR
=
${
KUBE_JUNIT_REPORT_DIR
:-}
...
...
hack/test-integration.sh
View file @
56a2cf40
...
...
@@ -31,7 +31,7 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
# KUBE_TEST_API_VERSIONS=${KUBE_TEST_API_VERSIONS:-"v1,extensions/v1beta1"}
# FIXME: due to current implementation of a test client (see: pkg/api/testapi/testapi.go)
# ONLY the last version is tested in each group.
KUBE_TEST_API_VERSIONS
=
${
KUBE_TEST_API_VERSIONS
:-
"v1,autoscaling/v1,batch/v1,apps/v1alpha1,policy/v1alpha1,extensions/v1beta1,rbac.authorization.k8s.io/v1alpha1"
}
KUBE_TEST_API_VERSIONS
=
${
KUBE_TEST_API_VERSIONS
:-
"v1,autoscaling/v1,batch/v1,apps/v1alpha1,policy/v1alpha1,extensions/v1beta1,rbac.authorization.k8s.io/v1alpha1
,certificates/v1alpha1
"
}
# Give integration tests longer to run
# TODO: allow a larger value to be passed in
...
...
pkg/api/testapi/testapi.go
View file @
56a2cf40
...
...
@@ -32,6 +32,7 @@ import (
"k8s.io/kubernetes/pkg/apis/apps"
"k8s.io/kubernetes/pkg/apis/autoscaling"
"k8s.io/kubernetes/pkg/apis/batch"
"k8s.io/kubernetes/pkg/apis/certificates"
"k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/apis/policy"
"k8s.io/kubernetes/pkg/apis/rbac"
...
...
@@ -43,6 +44,7 @@ import (
_
"k8s.io/kubernetes/pkg/apis/apps/install"
_
"k8s.io/kubernetes/pkg/apis/autoscaling/install"
_
"k8s.io/kubernetes/pkg/apis/batch/install"
_
"k8s.io/kubernetes/pkg/apis/certificates/install"
_
"k8s.io/kubernetes/pkg/apis/componentconfig/install"
_
"k8s.io/kubernetes/pkg/apis/extensions/install"
_
"k8s.io/kubernetes/pkg/apis/policy/install"
...
...
@@ -50,15 +52,16 @@ import (
)
var
(
Groups
=
make
(
map
[
string
]
TestGroup
)
Default
TestGroup
Autoscaling
TestGroup
Batch
TestGroup
Extensions
TestGroup
Apps
TestGroup
Policy
TestGroup
Federation
TestGroup
Rbac
TestGroup
Groups
=
make
(
map
[
string
]
TestGroup
)
Default
TestGroup
Autoscaling
TestGroup
Batch
TestGroup
Extensions
TestGroup
Apps
TestGroup
Policy
TestGroup
Federation
TestGroup
Rbac
TestGroup
Certificates
TestGroup
serializer
runtime
.
SerializerInfo
storageSerializer
runtime
.
SerializerInfo
...
...
@@ -190,12 +193,20 @@ func init() {
internalTypes
:
api
.
Scheme
.
KnownTypes
(
rbac
.
SchemeGroupVersion
),
}
}
if
_
,
ok
:=
Groups
[
certificates
.
GroupName
];
!
ok
{
Groups
[
certificates
.
GroupName
]
=
TestGroup
{
externalGroupVersion
:
unversioned
.
GroupVersion
{
Group
:
certificates
.
GroupName
,
Version
:
registered
.
GroupOrDie
(
certificates
.
GroupName
)
.
GroupVersion
.
Version
},
internalGroupVersion
:
certificates
.
SchemeGroupVersion
,
internalTypes
:
api
.
Scheme
.
KnownTypes
(
certificates
.
SchemeGroupVersion
),
}
}
Default
=
Groups
[
api
.
GroupName
]
Autoscaling
=
Groups
[
autoscaling
.
GroupName
]
Batch
=
Groups
[
batch
.
GroupName
]
Apps
=
Groups
[
apps
.
GroupName
]
Policy
=
Groups
[
policy
.
GroupName
]
Certificates
=
Groups
[
certificates
.
GroupName
]
Extensions
=
Groups
[
extensions
.
GroupName
]
Federation
=
Groups
[
federation
.
GroupName
]
Rbac
=
Groups
[
rbac
.
GroupName
]
...
...
pkg/master/master_test.go
View file @
56a2cf40
...
...
@@ -42,6 +42,7 @@ import (
"k8s.io/kubernetes/pkg/apis/batch"
batchapiv1
"k8s.io/kubernetes/pkg/apis/batch/v1"
batchapiv2alpha1
"k8s.io/kubernetes/pkg/apis/batch/v2alpha1"
"k8s.io/kubernetes/pkg/apis/certificates"
"k8s.io/kubernetes/pkg/apis/extensions"
extensionsapiv1beta1
"k8s.io/kubernetes/pkg/apis/extensions/v1beta1"
"k8s.io/kubernetes/pkg/apis/rbac"
...
...
@@ -93,6 +94,7 @@ func setUp(t *testing.T) (*Master, *etcdtesting.EtcdTestServer, Config, *assert.
resourceEncoding
.
SetVersionEncoding
(
apps
.
GroupName
,
*
testapi
.
Apps
.
GroupVersion
(),
unversioned
.
GroupVersion
{
Group
:
apps
.
GroupName
,
Version
:
runtime
.
APIVersionInternal
})
resourceEncoding
.
SetVersionEncoding
(
extensions
.
GroupName
,
*
testapi
.
Extensions
.
GroupVersion
(),
unversioned
.
GroupVersion
{
Group
:
extensions
.
GroupName
,
Version
:
runtime
.
APIVersionInternal
})
resourceEncoding
.
SetVersionEncoding
(
rbac
.
GroupName
,
*
testapi
.
Rbac
.
GroupVersion
(),
unversioned
.
GroupVersion
{
Group
:
rbac
.
GroupName
,
Version
:
runtime
.
APIVersionInternal
})
resourceEncoding
.
SetVersionEncoding
(
certificates
.
GroupName
,
*
testapi
.
Certificates
.
GroupVersion
(),
unversioned
.
GroupVersion
{
Group
:
certificates
.
GroupName
,
Version
:
runtime
.
APIVersionInternal
})
storageFactory
:=
genericapiserver
.
NewDefaultStorageFactory
(
storageConfig
,
testapi
.
StorageMediaType
(),
api
.
Codecs
,
resourceEncoding
,
DefaultAPIResourceConfigSource
())
config
.
StorageFactory
=
storageFactory
...
...
test/integration/framework/master_utils.go
View file @
56a2cf40
...
...
@@ -33,6 +33,7 @@ import (
"k8s.io/kubernetes/pkg/apis/apps"
"k8s.io/kubernetes/pkg/apis/autoscaling"
"k8s.io/kubernetes/pkg/apis/batch"
"k8s.io/kubernetes/pkg/apis/certificates"
"k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/apis/policy"
"k8s.io/kubernetes/pkg/apis/rbac"
...
...
@@ -192,6 +193,10 @@ func NewMasterConfig() *master.Config {
unversioned
.
GroupResource
{
Group
:
rbac
.
GroupName
,
Resource
:
genericapiserver
.
AllResources
},
""
,
NewSingleContentTypeSerializer
(
api
.
Scheme
,
testapi
.
Rbac
.
Codec
(),
runtime
.
ContentTypeJSON
))
storageFactory
.
SetSerializer
(
unversioned
.
GroupResource
{
Group
:
certificates
.
GroupName
,
Resource
:
genericapiserver
.
AllResources
},
""
,
NewSingleContentTypeSerializer
(
api
.
Scheme
,
testapi
.
Certificates
.
Codec
(),
runtime
.
ContentTypeJSON
))
return
&
master
.
Config
{
Config
:
&
genericapiserver
.
Config
{
...
...
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