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
8bcbbd4d
Commit
8bcbbd4d
authored
Jul 10, 2017
by
Jacob Simpson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate api.Registry to testapi.Groups in tests.
parent
a765b8cf
Hide whitespace changes
Inline
Side-by-side
Showing
49 changed files
with
113 additions
and
98 deletions
+113
-98
BUILD
test/e2e/BUILD
+1
-0
BUILD
test/e2e/common/BUILD
+1
-0
empty_dir.go
test/e2e/common/empty_dir.go
+3
-4
host_path.go
test/e2e/common/host_path.go
+2
-2
dns.go
test/e2e/dns.go
+2
-2
BUILD
test/e2e/framework/BUILD
+1
-0
networking_utils.go
test/e2e/framework/networking_utils.go
+3
-3
pv_util.go
test/e2e/framework/pv_util.go
+2
-2
rc_util.go
test/e2e/framework/rc_util.go
+2
-1
util.go
test/e2e/framework/util.go
+2
-1
gke_local_ssd.go
test/e2e/gke_local_ssd.go
+2
-2
proxy.go
test/e2e/kubectl/proxy.go
+2
-2
kubelet.go
test/e2e/kubelet.go
+2
-2
BUILD
test/e2e/storage/BUILD
+1
-1
pd.go
test/e2e/storage/pd.go
+2
-2
apiserver_test.go
test/integration/apiserver/apiserver_test.go
+1
-1
accessreview_test.go
test/integration/auth/accessreview_test.go
+4
-3
auth_test.go
test/integration/auth/auth_test.go
+8
-8
rbac_test.go
test/integration/auth/rbac_test.go
+4
-4
client_test.go
test/integration/client/client_test.go
+9
-8
dynamic_client_test.go
test/integration/client/dynamic_client_test.go
+1
-2
BUILD
test/integration/configmap/BUILD
+1
-1
configmap_test.go
test/integration/configmap/configmap_test.go
+2
-2
BUILD
test/integration/defaulttolerationseconds/BUILD
+1
-1
defaulttolerationseconds_test.go
...defaulttolerationseconds/defaulttolerationseconds_test.go
+2
-2
master_utils.go
test/integration/framework/master_utils.go
+1
-1
master_test.go
test/integration/master/master_test.go
+2
-2
BUILD
test/integration/metrics/BUILD
+1
-1
metrics_test.go
test/integration/metrics/metrics_test.go
+2
-2
BUILD
test/integration/objectmeta/BUILD
+1
-1
objectmeta_test.go
test/integration/objectmeta/objectmeta_test.go
+2
-2
BUILD
test/integration/pods/BUILD
+1
-1
pods_test.go
test/integration/pods/pods_test.go
+3
-3
BUILD
test/integration/quota/BUILD
+1
-0
quota_test.go
test/integration/quota/quota_test.go
+5
-4
BUILD
test/integration/scheduler/BUILD
+1
-0
extender_test.go
test/integration/scheduler/extender_test.go
+3
-2
scheduler_test.go
test/integration/scheduler/scheduler_test.go
+9
-8
BUILD
test/integration/scheduler_perf/BUILD
+1
-0
util.go
test/integration/scheduler_perf/util.go
+2
-1
BUILD
test/integration/secrets/BUILD
+1
-1
secrets_test.go
test/integration/secrets/secrets_test.go
+2
-2
BUILD
test/integration/serviceaccount/BUILD
+1
-1
service_account_test.go
test/integration/serviceaccount/service_account_test.go
+4
-4
BUILD
test/integration/storageclasses/BUILD
+1
-1
storage_classes_test.go
test/integration/storageclasses/storage_classes_test.go
+2
-2
BUILD
test/integration/volume/BUILD
+1
-0
attach_detach_test.go
test/integration/volume/attach_detach_test.go
+2
-1
persistent_volumes_test.go
test/integration/volume/persistent_volumes_test.go
+3
-2
No files found.
test/e2e/BUILD
View file @
8bcbbd4d
...
...
@@ -96,6 +96,7 @@ go_library(
tags = ["automanaged"],
deps = [
"//pkg/api:go_default_library",
"//pkg/api/testapi:go_default_library",
"//pkg/api/v1/pod:go_default_library",
"//pkg/api/v1/service:go_default_library",
"//pkg/apis/networking:go_default_library",
...
...
test/e2e/common/BUILD
View file @
8bcbbd4d
...
...
@@ -35,6 +35,7 @@ go_library(
tags = ["automanaged"],
deps = [
"//pkg/api:go_default_library",
"//pkg/api/testapi:go_default_library",
"//pkg/api/v1/helper:go_default_library",
"//pkg/api/v1/pod:go_default_library",
"//pkg/apis/extensions:go_default_library",
...
...
test/e2e/common/empty_dir.go
View file @
8bcbbd4d
...
...
@@ -20,13 +20,12 @@ import (
"fmt"
"path"
.
"github.com/onsi/ginkgo"
"k8s.io/api/core/v1"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/uuid"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api
/testapi
"
"k8s.io/kubernetes/test/e2e/framework"
.
"github.com/onsi/ginkgo"
)
const
(
...
...
@@ -343,7 +342,7 @@ func testPodWithVolume(image, path string, source *v1.EmptyDirVolumeSource) *v1.
return
&
v1
.
Pod
{
TypeMeta
:
metav1
.
TypeMeta
{
Kind
:
"Pod"
,
APIVersion
:
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
.
String
(),
APIVersion
:
testapi
.
Groups
[
v1
.
GroupName
]
.
GroupVersion
()
.
String
(),
},
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
podName
,
...
...
test/e2e/common/host_path.go
View file @
8bcbbd4d
...
...
@@ -23,7 +23,7 @@ import (
"k8s.io/api/core/v1"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api
/testapi
"
"k8s.io/kubernetes/test/e2e/framework"
.
"github.com/onsi/ginkgo"
...
...
@@ -222,7 +222,7 @@ func testPodWithHostVol(path string, source *v1.HostPathVolumeSource) *v1.Pod {
return
&
v1
.
Pod
{
TypeMeta
:
metav1
.
TypeMeta
{
Kind
:
"Pod"
,
APIVersion
:
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
.
String
(),
APIVersion
:
testapi
.
Groups
[
v1
.
GroupName
]
.
GroupVersion
()
.
String
(),
},
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
podName
,
...
...
test/e2e/dns.go
View file @
8bcbbd4d
...
...
@@ -30,7 +30,7 @@ import (
"k8s.io/apimachinery/pkg/util/uuid"
"k8s.io/apimachinery/pkg/util/wait"
clientset
"k8s.io/client-go/kubernetes"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api
/testapi
"
"k8s.io/kubernetes/test/e2e/framework"
)
...
...
@@ -46,7 +46,7 @@ func createDNSPod(namespace, wheezyProbeCmd, jessieProbeCmd string, useAnnotatio
dnsPod
:=
&
v1
.
Pod
{
TypeMeta
:
metav1
.
TypeMeta
{
Kind
:
"Pod"
,
APIVersion
:
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
.
String
(),
APIVersion
:
testapi
.
Groups
[
v1
.
GroupName
]
.
GroupVersion
()
.
String
(),
},
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
"dns-test-"
+
string
(
uuid
.
NewUUID
()),
...
...
test/e2e/framework/BUILD
View file @
8bcbbd4d
...
...
@@ -44,6 +44,7 @@ go_library(
deps = [
"//federation/apis/federation/v1beta1:go_default_library",
"//pkg/api:go_default_library",
"//pkg/api/testapi:go_default_library",
"//pkg/api/v1/helper:go_default_library",
"//pkg/api/v1/node:go_default_library",
"//pkg/api/v1/pod:go_default_library",
...
...
test/e2e/framework/networking_utils.go
View file @
8bcbbd4d
...
...
@@ -40,7 +40,7 @@ import (
"k8s.io/apimachinery/pkg/util/wait"
clientset
"k8s.io/client-go/kubernetes"
coreclientset
"k8s.io/client-go/kubernetes/typed/core/v1"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api
/testapi
"
)
const
(
...
...
@@ -325,7 +325,7 @@ func (config *NetworkingTestConfig) createNetShellPodSpec(podName, hostname stri
pod
:=
&
v1
.
Pod
{
TypeMeta
:
metav1
.
TypeMeta
{
Kind
:
"Pod"
,
APIVersion
:
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
.
String
(),
APIVersion
:
testapi
.
Groups
[
v1
.
GroupName
]
.
GroupVersion
()
.
String
(),
},
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
podName
,
...
...
@@ -369,7 +369,7 @@ func (config *NetworkingTestConfig) createTestPodSpec() *v1.Pod {
pod
:=
&
v1
.
Pod
{
TypeMeta
:
metav1
.
TypeMeta
{
Kind
:
"Pod"
,
APIVersion
:
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
.
String
(),
APIVersion
:
testapi
.
Groups
[
v1
.
GroupName
]
.
GroupVersion
()
.
String
(),
},
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
testPodName
,
...
...
test/e2e/framework/pv_util.go
View file @
8bcbbd4d
...
...
@@ -35,7 +35,7 @@ import (
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/uuid"
clientset
"k8s.io/client-go/kubernetes"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api
/testapi
"
"k8s.io/kubernetes/pkg/api/v1/helper"
awscloud
"k8s.io/kubernetes/pkg/cloudprovider/providers/aws"
gcecloud
"k8s.io/kubernetes/pkg/cloudprovider/providers/gce"
...
...
@@ -805,7 +805,7 @@ func MakePod(ns string, pvclaims []*v1.PersistentVolumeClaim, isPrivileged bool,
podSpec
:=
&
v1
.
Pod
{
TypeMeta
:
metav1
.
TypeMeta
{
Kind
:
"Pod"
,
APIVersion
:
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
.
String
(),
APIVersion
:
testapi
.
Groups
[
v1
.
GroupName
]
.
GroupVersion
()
.
String
(),
},
ObjectMeta
:
metav1
.
ObjectMeta
{
GenerateName
:
"pvc-tester-"
,
...
...
test/e2e/framework/rc_util.go
View file @
8bcbbd4d
...
...
@@ -29,6 +29,7 @@ import (
"k8s.io/apimachinery/pkg/util/wait"
clientset
"k8s.io/client-go/kubernetes"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/testapi"
"k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset"
testutils
"k8s.io/kubernetes/test/utils"
)
...
...
@@ -58,7 +59,7 @@ func RcByNameContainer(name string, replicas int32, image string, labels map[str
return
&
v1
.
ReplicationController
{
TypeMeta
:
metav1
.
TypeMeta
{
Kind
:
"ReplicationController"
,
APIVersion
:
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
.
String
(),
APIVersion
:
testapi
.
Groups
[
v1
.
GroupName
]
.
GroupVersion
()
.
String
(),
},
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
name
,
...
...
test/e2e/framework/util.go
View file @
8bcbbd4d
...
...
@@ -74,6 +74,7 @@ import (
clientset
"k8s.io/client-go/kubernetes"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/testapi"
v1helper
"k8s.io/kubernetes/pkg/api/v1/helper"
nodeutil
"k8s.io/kubernetes/pkg/api/v1/node"
podutil
"k8s.io/kubernetes/pkg/api/v1/pod"
...
...
@@ -2331,7 +2332,7 @@ func isNodeUntainted(node *v1.Node) bool {
fakePod
:=
&
v1
.
Pod
{
TypeMeta
:
metav1
.
TypeMeta
{
Kind
:
"Pod"
,
APIVersion
:
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
.
String
(),
APIVersion
:
testapi
.
Groups
[
v1
.
GroupName
]
.
GroupVersion
()
.
String
(),
},
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
"fake-not-scheduled"
,
...
...
test/e2e/gke_local_ssd.go
View file @
8bcbbd4d
...
...
@@ -23,7 +23,7 @@ import (
"k8s.io/api/core/v1"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/uuid"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api
/testapi
"
"k8s.io/kubernetes/test/e2e/framework"
.
"github.com/onsi/ginkgo"
...
...
@@ -74,7 +74,7 @@ func testPodWithSsd(command string) *v1.Pod {
return
&
v1
.
Pod
{
TypeMeta
:
metav1
.
TypeMeta
{
Kind
:
"Pod"
,
APIVersion
:
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
.
String
(),
APIVersion
:
testapi
.
Groups
[
v1
.
GroupName
]
.
GroupVersion
()
.
String
(),
},
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
podName
,
...
...
test/e2e/kubectl/proxy.go
View file @
8bcbbd4d
...
...
@@ -32,7 +32,7 @@ import (
"k8s.io/apimachinery/pkg/util/intstr"
"k8s.io/apimachinery/pkg/util/net"
clientset
"k8s.io/client-go/kubernetes"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api
/testapi
"
"k8s.io/kubernetes/test/e2e/framework"
testutils
"k8s.io/kubernetes/test/utils"
...
...
@@ -52,7 +52,7 @@ const (
)
var
_
=
SIGDescribe
(
"Kubectl Proxy"
,
func
()
{
version
:=
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
.
Version
version
:=
testapi
.
Groups
[
v1
.
GroupName
]
.
GroupVersion
()
.
Version
Context
(
"version "
+
version
,
func
()
{
options
:=
framework
.
FrameworkOptions
{
ClientQPS
:
-
1.0
,
...
...
test/e2e/kubelet.go
View file @
8bcbbd4d
...
...
@@ -28,7 +28,7 @@ import (
"k8s.io/apimachinery/pkg/util/uuid"
"k8s.io/apimachinery/pkg/util/wait"
clientset
"k8s.io/client-go/kubernetes"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api
/testapi
"
"k8s.io/kubernetes/test/e2e/framework"
testutils
"k8s.io/kubernetes/test/utils"
...
...
@@ -172,7 +172,7 @@ func createPodUsingNfs(f *framework.Framework, c clientset.Interface, ns, nfsIP,
pod
:=
&
v1
.
Pod
{
TypeMeta
:
metav1
.
TypeMeta
{
Kind
:
"Pod"
,
APIVersion
:
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
.
String
(),
APIVersion
:
testapi
.
Groups
[
v1
.
GroupName
]
.
GroupVersion
()
.
String
(),
},
ObjectMeta
:
metav1
.
ObjectMeta
{
GenerateName
:
"pod-nfs-vol-"
,
...
...
test/e2e/storage/BUILD
View file @
8bcbbd4d
...
...
@@ -31,7 +31,7 @@ go_library(
],
tags = ["automanaged"],
deps = [
"//pkg/api:go_default_library",
"//pkg/api
/testapi
:go_default_library",
"//pkg/api/v1/helper:go_default_library",
"//pkg/apis/storage/v1/util:go_default_library",
"//pkg/cloudprovider/providers/vsphere:go_default_library",
...
...
test/e2e/storage/pd.go
View file @
8bcbbd4d
...
...
@@ -36,7 +36,7 @@ import (
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/uuid"
v1core
"k8s.io/client-go/kubernetes/typed/core/v1"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api
/testapi
"
"k8s.io/kubernetes/test/e2e/framework"
)
...
...
@@ -619,7 +619,7 @@ func testPDPod(diskNames []string, targetNode types.NodeName, readOnly bool, num
pod
:=
&
v1
.
Pod
{
TypeMeta
:
metav1
.
TypeMeta
{
Kind
:
"Pod"
,
APIVersion
:
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
.
String
(),
APIVersion
:
testapi
.
Groups
[
v1
.
GroupName
]
.
GroupVersion
()
.
String
(),
},
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
"pd-test-"
+
string
(
uuid
.
NewUUID
()),
...
...
test/integration/apiserver/apiserver_test.go
View file @
8bcbbd4d
...
...
@@ -102,7 +102,7 @@ func newRS(namespace string) *v1beta1.ReplicaSet {
var
cascDel
=
`
{
"kind": "DeleteOptions",
"apiVersion": "`
+
api
.
Registry
.
GroupOrDie
(
api
.
GroupName
)
.
GroupVersion
.
String
()
+
`",
"apiVersion": "`
+
testapi
.
Groups
[
api
.
GroupName
]
.
GroupVersion
()
.
String
()
+
`",
"orphanDependents": false
}
`
...
...
test/integration/auth/accessreview_test.go
View file @
8bcbbd4d
...
...
@@ -28,6 +28,7 @@ import (
"k8s.io/apiserver/pkg/authorization/authorizer"
restclient
"k8s.io/client-go/rest"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/testapi"
authorizationapi
"k8s.io/kubernetes/pkg/apis/authorization"
clientset
"k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset"
"k8s.io/kubernetes/plugin/pkg/admission/admit"
...
...
@@ -60,7 +61,7 @@ func TestSubjectAccessReview(t *testing.T) {
_
,
s
,
closeFn
:=
framework
.
RunAMaster
(
masterConfig
)
defer
closeFn
()
clientset
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
&
api
.
Registry
.
GroupOrDie
(
api
.
GroupName
)
.
GroupVersion
}})
clientset
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Groups
[
api
.
GroupName
]
.
GroupVersion
()
}})
tests
:=
[]
struct
{
name
string
...
...
@@ -154,7 +155,7 @@ func TestSelfSubjectAccessReview(t *testing.T) {
_
,
s
,
closeFn
:=
framework
.
RunAMaster
(
masterConfig
)
defer
closeFn
()
clientset
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
&
api
.
Registry
.
GroupOrDie
(
api
.
GroupName
)
.
GroupVersion
}})
clientset
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Groups
[
api
.
GroupName
]
.
GroupVersion
()
}})
tests
:=
[]
struct
{
name
string
...
...
@@ -234,7 +235,7 @@ func TestLocalSubjectAccessReview(t *testing.T) {
_
,
s
,
closeFn
:=
framework
.
RunAMaster
(
masterConfig
)
defer
closeFn
()
clientset
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
&
api
.
Registry
.
GroupOrDie
(
api
.
GroupName
)
.
GroupVersion
}})
clientset
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Groups
[
api
.
GroupName
]
.
GroupVersion
()
}})
tests
:=
[]
struct
{
name
string
...
...
test/integration/auth/auth_test.go
View file @
8bcbbd4d
...
...
@@ -108,7 +108,7 @@ func timeoutPath(resource, namespace, name string) string {
var
aPod
string
=
`
{
"kind": "Pod",
"apiVersion": "`
+
api
.
Registry
.
GroupOrDie
(
api
.
GroupName
)
.
GroupVersion
.
String
()
+
`",
"apiVersion": "`
+
testapi
.
Groups
[
api
.
GroupName
]
.
GroupVersion
()
.
String
()
+
`",
"metadata": {
"name": "a",
"creationTimestamp": null%s
...
...
@@ -126,7 +126,7 @@ var aPod string = `
var
aRC
string
=
`
{
"kind": "ReplicationController",
"apiVersion": "`
+
api
.
Registry
.
GroupOrDie
(
api
.
GroupName
)
.
GroupVersion
.
String
()
+
`",
"apiVersion": "`
+
testapi
.
Groups
[
api
.
GroupName
]
.
GroupVersion
()
.
String
()
+
`",
"metadata": {
"name": "a",
"labels": {
...
...
@@ -159,7 +159,7 @@ var aRC string = `
var
aService
string
=
`
{
"kind": "Service",
"apiVersion": "`
+
api
.
Registry
.
GroupOrDie
(
api
.
GroupName
)
.
GroupVersion
.
String
()
+
`",
"apiVersion": "`
+
testapi
.
Groups
[
api
.
GroupName
]
.
GroupVersion
()
.
String
()
+
`",
"metadata": {
"name": "a",
"labels": {
...
...
@@ -183,7 +183,7 @@ var aService string = `
var
aNode
string
=
`
{
"kind": "Node",
"apiVersion": "`
+
api
.
Registry
.
GroupOrDie
(
api
.
GroupName
)
.
GroupVersion
.
String
()
+
`",
"apiVersion": "`
+
testapi
.
Groups
[
api
.
GroupName
]
.
GroupVersion
()
.
String
()
+
`",
"metadata": {
"name": "a"%s
},
...
...
@@ -197,7 +197,7 @@ func aEvent(namespace string) string {
return
`
{
"kind": "Event",
"apiVersion": "`
+
api
.
Registry
.
GroupOrDie
(
api
.
GroupName
)
.
GroupVersion
.
String
()
+
`",
"apiVersion": "`
+
testapi
.
Groups
[
api
.
GroupName
]
.
GroupVersion
()
.
String
()
+
`",
"metadata": {
"name": "a"%s
},
...
...
@@ -214,7 +214,7 @@ func aEvent(namespace string) string {
var
aBinding
string
=
`
{
"kind": "Binding",
"apiVersion": "`
+
api
.
Registry
.
GroupOrDie
(
api
.
GroupName
)
.
GroupVersion
.
String
()
+
`",
"apiVersion": "`
+
testapi
.
Groups
[
api
.
GroupName
]
.
GroupVersion
()
.
String
()
+
`",
"metadata": {
"name": "a"%s
},
...
...
@@ -237,7 +237,7 @@ var emptyEndpoints string = `
var
aEndpoints
string
=
`
{
"kind": "Endpoints",
"apiVersion": "`
+
api
.
Registry
.
GroupOrDie
(
api
.
GroupName
)
.
GroupVersion
.
String
()
+
`",
"apiVersion": "`
+
testapi
.
Groups
[
api
.
GroupName
]
.
GroupVersion
()
.
String
()
+
`",
"metadata": {
"name": "a"%s
},
...
...
@@ -262,7 +262,7 @@ var aEndpoints string = `
var
deleteNow
string
=
`
{
"kind": "DeleteOptions",
"apiVersion": "`
+
api
.
Registry
.
GroupOrDie
(
api
.
GroupName
)
.
GroupVersion
.
String
()
+
`",
"apiVersion": "`
+
testapi
.
Groups
[
api
.
GroupName
]
.
GroupVersion
()
.
String
()
+
`",
"gracePeriodSeconds": 0%s
}
`
...
...
test/integration/auth/rbac_test.go
View file @
8bcbbd4d
...
...
@@ -221,7 +221,7 @@ var (
`
podNamespace
=
`
{
"apiVersion": "`
+
api
.
Registry
.
GroupOrDie
(
api
.
GroupName
)
.
GroupVersion
.
String
()
+
`",
"apiVersion": "`
+
testapi
.
Groups
[
api
.
GroupName
]
.
GroupVersion
()
.
String
()
+
`",
"kind": "Namespace",
"metadata": {
"name": "pod-namespace"%s
...
...
@@ -230,7 +230,7 @@ var (
`
jobNamespace
=
`
{
"apiVersion": "`
+
api
.
Registry
.
GroupOrDie
(
api
.
GroupName
)
.
GroupVersion
.
String
()
+
`",
"apiVersion": "`
+
testapi
.
Groups
[
api
.
GroupName
]
.
GroupVersion
()
.
String
()
+
`",
"kind": "Namespace",
"metadata": {
"name": "job-namespace"%s
...
...
@@ -239,7 +239,7 @@ var (
`
forbiddenNamespace
=
`
{
"apiVersion": "`
+
api
.
Registry
.
GroupOrDie
(
api
.
GroupName
)
.
GroupVersion
.
String
()
+
`",
"apiVersion": "`
+
testapi
.
Groups
[
api
.
GroupName
]
.
GroupVersion
()
.
String
()
+
`",
"kind": "Namespace",
"metadata": {
"name": "forbidden-namespace"%s
...
...
@@ -510,7 +510,7 @@ func TestBootstrapping(t *testing.T) {
_
,
s
,
closeFn
:=
framework
.
RunAMaster
(
masterConfig
)
defer
closeFn
()
clientset
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
BearerToken
:
superUser
,
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
&
api
.
Registry
.
GroupOrDie
(
api
.
GroupName
)
.
GroupVersion
}})
clientset
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
BearerToken
:
superUser
,
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Groups
[
api
.
GroupName
]
.
GroupVersion
()
}})
watcher
,
err
:=
clientset
.
Rbac
()
.
ClusterRoles
()
.
Watch
(
metav1
.
ListOptions
{
ResourceVersion
:
"0"
})
if
err
!=
nil
{
...
...
test/integration/client/client_test.go
View file @
8bcbbd4d
...
...
@@ -39,6 +39,7 @@ import (
clientset
"k8s.io/client-go/kubernetes"
restclient
"k8s.io/client-go/rest"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/testapi"
"k8s.io/kubernetes/pkg/version"
e2e
"k8s.io/kubernetes/test/e2e/framework"
"k8s.io/kubernetes/test/integration/framework"
...
...
@@ -48,7 +49,7 @@ func TestClient(t *testing.T) {
_
,
s
,
closeFn
:=
framework
.
RunAMaster
(
nil
)
defer
closeFn
()
client
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
&
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
}})
client
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Groups
[
v1
.
GroupName
]
.
GroupVersion
()
}})
ns
:=
framework
.
CreateTestingNamespace
(
"client"
,
s
,
t
)
defer
framework
.
DeleteTestingNamespace
(
ns
,
s
,
t
)
...
...
@@ -120,7 +121,7 @@ func TestAtomicPut(t *testing.T) {
_
,
s
,
closeFn
:=
framework
.
RunAMaster
(
nil
)
defer
closeFn
()
c
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
&
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
}})
c
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Groups
[
v1
.
GroupName
]
.
GroupVersion
()
}})
ns
:=
framework
.
CreateTestingNamespace
(
"atomic-put"
,
s
,
t
)
defer
framework
.
DeleteTestingNamespace
(
ns
,
s
,
t
)
...
...
@@ -212,7 +213,7 @@ func TestPatch(t *testing.T) {
_
,
s
,
closeFn
:=
framework
.
RunAMaster
(
nil
)
defer
closeFn
()
c
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
&
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
}})
c
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Groups
[
v1
.
GroupName
]
.
GroupVersion
()
}})
ns
:=
framework
.
CreateTestingNamespace
(
"patch"
,
s
,
t
)
defer
framework
.
DeleteTestingNamespace
(
ns
,
s
,
t
)
...
...
@@ -351,7 +352,7 @@ func TestPatchWithCreateOnUpdate(t *testing.T) {
_
,
s
,
closeFn
:=
framework
.
RunAMaster
(
nil
)
defer
closeFn
()
c
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
&
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
}})
c
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Groups
[
v1
.
GroupName
]
.
GroupVersion
()
}})
ns
:=
framework
.
CreateTestingNamespace
(
"patch-with-create"
,
s
,
t
)
defer
framework
.
DeleteTestingNamespace
(
ns
,
s
,
t
)
...
...
@@ -462,7 +463,7 @@ func TestAPIVersions(t *testing.T) {
_
,
s
,
closeFn
:=
framework
.
RunAMaster
(
nil
)
defer
closeFn
()
c
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
&
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
}})
c
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Groups
[
v1
.
GroupName
]
.
GroupVersion
()
}})
clientVersion
:=
c
.
Core
()
.
RESTClient
()
.
APIVersion
()
.
String
()
g
,
err
:=
c
.
Discovery
()
.
ServerGroups
()
...
...
@@ -487,7 +488,7 @@ func TestSingleWatch(t *testing.T) {
ns
:=
framework
.
CreateTestingNamespace
(
"single-watch"
,
s
,
t
)
defer
framework
.
DeleteTestingNamespace
(
ns
,
s
,
t
)
client
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
&
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
}})
client
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Groups
[
v1
.
GroupName
]
.
GroupVersion
()
}})
mkEvent
:=
func
(
i
int
)
*
v1
.
Event
{
name
:=
fmt
.
Sprintf
(
"event-%v"
,
i
)
...
...
@@ -574,7 +575,7 @@ func TestMultiWatch(t *testing.T) {
ns
:=
framework
.
CreateTestingNamespace
(
"multi-watch"
,
s
,
t
)
defer
framework
.
DeleteTestingNamespace
(
ns
,
s
,
t
)
client
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
&
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
}})
client
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Groups
[
v1
.
GroupName
]
.
GroupVersion
()
}})
dummyEvent
:=
func
(
i
int
)
*
v1
.
Event
{
name
:=
fmt
.
Sprintf
(
"unrelated-%v"
,
i
)
...
...
@@ -830,7 +831,7 @@ func TestSelfLinkOnNamespace(t *testing.T) {
ns
:=
framework
.
CreateTestingNamespace
(
"selflink"
,
s
,
t
)
defer
framework
.
DeleteTestingNamespace
(
ns
,
s
,
t
)
c
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
&
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
}})
c
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Groups
[
v1
.
GroupName
]
.
GroupVersion
()
}})
runSelfLinkTestOnNamespace
(
t
,
c
,
ns
.
Name
)
}
test/integration/client/dynamic_client_test.go
View file @
8bcbbd4d
...
...
@@ -27,7 +27,6 @@ import (
"k8s.io/client-go/dynamic"
clientset
"k8s.io/client-go/kubernetes"
restclient
"k8s.io/client-go/rest"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/testapi"
"k8s.io/kubernetes/test/integration/framework"
)
...
...
@@ -39,7 +38,7 @@ func TestDynamicClient(t *testing.T) {
ns
:=
framework
.
CreateTestingNamespace
(
"dynamic-client"
,
s
,
t
)
defer
framework
.
DeleteTestingNamespace
(
ns
,
s
,
t
)
gv
:=
&
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
gv
:=
testapi
.
Groups
[
v1
.
GroupName
]
.
GroupVersion
()
config
:=
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
gv
},
...
...
test/integration/configmap/BUILD
View file @
8bcbbd4d
...
...
@@ -19,7 +19,7 @@ go_test(
"integration",
],
deps = [
"//pkg/api:go_default_library",
"//pkg/api
/testapi
:go_default_library",
"//test/integration:go_default_library",
"//test/integration/framework:go_default_library",
"//vendor/k8s.io/api/core/v1:go_default_library",
...
...
test/integration/configmap/configmap_test.go
View file @
8bcbbd4d
...
...
@@ -25,7 +25,7 @@ import (
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
clientset
"k8s.io/client-go/kubernetes"
restclient
"k8s.io/client-go/rest"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api
/testapi
"
"k8s.io/kubernetes/test/integration"
"k8s.io/kubernetes/test/integration/framework"
)
...
...
@@ -35,7 +35,7 @@ func TestConfigMap(t *testing.T) {
_
,
s
,
closeFn
:=
framework
.
RunAMaster
(
nil
)
defer
closeFn
()
client
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
&
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
}})
client
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Groups
[
v1
.
GroupName
]
.
GroupVersion
()
}})
ns
:=
framework
.
CreateTestingNamespace
(
"config-map"
,
s
,
t
)
defer
framework
.
DeleteTestingNamespace
(
ns
,
s
,
t
)
...
...
test/integration/defaulttolerationseconds/BUILD
View file @
8bcbbd4d
...
...
@@ -20,8 +20,8 @@ go_test(
"integration",
],
deps = [
"//pkg/api:go_default_library",
"//pkg/api/helper:go_default_library",
"//pkg/api/testapi:go_default_library",
"//plugin/pkg/admission/defaulttolerationseconds:go_default_library",
"//plugin/pkg/scheduler/algorithm:go_default_library",
"//test/integration/framework:go_default_library",
...
...
test/integration/defaulttolerationseconds/defaulttolerationseconds_test.go
View file @
8bcbbd4d
...
...
@@ -23,8 +23,8 @@ import (
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
clientset
"k8s.io/client-go/kubernetes"
restclient
"k8s.io/client-go/rest"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/helper"
"k8s.io/kubernetes/pkg/api/testapi"
"k8s.io/kubernetes/plugin/pkg/admission/defaulttolerationseconds"
"k8s.io/kubernetes/plugin/pkg/scheduler/algorithm"
"k8s.io/kubernetes/test/integration/framework"
...
...
@@ -38,7 +38,7 @@ func TestAdmission(t *testing.T) {
_
,
s
,
closeFn
:=
framework
.
RunAMaster
(
masterConfig
)
defer
closeFn
()
client
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
&
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
}})
client
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Groups
[
v1
.
GroupName
]
.
GroupVersion
()
}})
ns
:=
framework
.
CreateTestingNamespace
(
"default-toleration-seconds"
,
s
,
t
)
defer
framework
.
DeleteTestingNamespace
(
ns
,
s
,
t
)
...
...
test/integration/framework/master_utils.go
View file @
8bcbbd4d
...
...
@@ -123,7 +123,7 @@ func NewMasterComponents(c *Config) *MasterComponents {
// TODO: Allow callers to pipe through a different master url and create a client/start components using it.
glog
.
Infof
(
"Master %+v"
,
s
.
URL
)
// TODO: caesarxuchao: remove this client when the refactoring of client libraray is done.
clientset
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
&
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
},
QPS
:
c
.
QPS
,
Burst
:
c
.
Burst
})
clientset
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Groups
[
v1
.
GroupName
]
.
GroupVersion
()
},
QPS
:
c
.
QPS
,
Burst
:
c
.
Burst
})
rcStopCh
:=
make
(
chan
struct
{})
informerFactory
:=
informers
.
NewSharedInformerFactory
(
clientset
,
controller
.
NoResyncPeriodFunc
())
controllerManager
:=
replicationcontroller
.
NewReplicationManager
(
informerFactory
.
Core
()
.
V1
()
.
Pods
(),
informerFactory
.
Core
()
.
V1
()
.
ReplicationControllers
(),
clientset
,
c
.
Burst
)
...
...
test/integration/master/master_test.go
View file @
8bcbbd4d
...
...
@@ -510,7 +510,7 @@ func TestMasterService(t *testing.T) {
_
,
s
,
closeFn
:=
framework
.
RunAMaster
(
framework
.
NewIntegrationTestMasterConfig
())
defer
closeFn
()
client
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
&
api
.
Registry
.
GroupOrDie
(
api
.
GroupName
)
.
GroupVersion
}})
client
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Groups
[
api
.
GroupName
]
.
GroupVersion
()
}})
err
:=
wait
.
Poll
(
time
.
Second
,
time
.
Minute
,
func
()
(
bool
,
error
)
{
svcList
,
err
:=
client
.
Core
()
.
Services
(
metav1
.
NamespaceDefault
)
.
List
(
metav1
.
ListOptions
{})
...
...
@@ -552,7 +552,7 @@ func TestServiceAlloc(t *testing.T) {
_
,
s
,
closeFn
:=
framework
.
RunAMaster
(
cfg
)
defer
closeFn
()
client
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
&
api
.
Registry
.
GroupOrDie
(
api
.
GroupName
)
.
GroupVersion
}})
client
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Groups
[
api
.
GroupName
]
.
GroupVersion
()
}})
svc
:=
func
(
i
int
)
*
api
.
Service
{
return
&
api
.
Service
{
...
...
test/integration/metrics/BUILD
View file @
8bcbbd4d
...
...
@@ -40,7 +40,7 @@ go_test(
"integration",
],
deps = [
"//pkg/api:go_default_library",
"//pkg/api
/testapi
:go_default_library",
"//test/integration/framework:go_default_library",
"//vendor/github.com/golang/glog:go_default_library",
"//vendor/github.com/golang/protobuf/proto:go_default_library",
...
...
test/integration/metrics/metrics_test.go
View file @
8bcbbd4d
...
...
@@ -28,7 +28,7 @@ import (
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
clientset
"k8s.io/client-go/kubernetes"
restclient
"k8s.io/client-go/rest"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api
/testapi
"
"k8s.io/kubernetes/test/integration/framework"
"github.com/golang/glog"
...
...
@@ -111,7 +111,7 @@ func TestApiserverMetrics(t *testing.T) {
// Make a request to the apiserver to ensure there's at least one data point
// for the metrics we're expecting -- otherwise, they won't be exported.
client
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
&
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
}})
client
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Groups
[
v1
.
GroupName
]
.
GroupVersion
()
}})
if
_
,
err
:=
client
.
Core
()
.
Pods
(
metav1
.
NamespaceDefault
)
.
List
(
metav1
.
ListOptions
{});
err
!=
nil
{
t
.
Fatalf
(
"unexpected error getting pods: %v"
,
err
)
}
...
...
test/integration/objectmeta/BUILD
View file @
8bcbbd4d
...
...
@@ -19,7 +19,7 @@ go_test(
"integration",
],
deps = [
"//pkg/api:go_default_library",
"//pkg/api
/testapi
:go_default_library",
"//test/integration/framework:go_default_library",
"//vendor/github.com/stretchr/testify/assert:go_default_library",
"//vendor/k8s.io/api/core/v1:go_default_library",
...
...
test/integration/objectmeta/objectmeta_test.go
View file @
8bcbbd4d
...
...
@@ -25,7 +25,7 @@ import (
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
clientset
"k8s.io/client-go/kubernetes"
restclient
"k8s.io/client-go/rest"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api
/testapi
"
"k8s.io/kubernetes/test/integration/framework"
)
...
...
@@ -34,7 +34,7 @@ func TestIgnoreClusterName(t *testing.T) {
_
,
s
,
closeFn
:=
framework
.
RunAMaster
(
config
)
defer
closeFn
()
client
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
&
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
}})
client
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Groups
[
v1
.
GroupName
]
.
GroupVersion
()
}})
ns
:=
v1
.
Namespace
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
"test-namespace"
,
...
...
test/integration/pods/BUILD
View file @
8bcbbd4d
...
...
@@ -19,7 +19,7 @@ go_test(
"integration",
],
deps = [
"//pkg/api:go_default_library",
"//pkg/api
/testapi
:go_default_library",
"//test/integration:go_default_library",
"//test/integration/framework:go_default_library",
"//vendor/k8s.io/api/core/v1:go_default_library",
...
...
test/integration/pods/pods_test.go
View file @
8bcbbd4d
...
...
@@ -24,7 +24,7 @@ import (
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
clientset
"k8s.io/client-go/kubernetes"
restclient
"k8s.io/client-go/rest"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api
/testapi
"
"k8s.io/kubernetes/test/integration"
"k8s.io/kubernetes/test/integration/framework"
)
...
...
@@ -36,7 +36,7 @@ func TestPodUpdateActiveDeadlineSeconds(t *testing.T) {
ns
:=
framework
.
CreateTestingNamespace
(
"pod-activedeadline-update"
,
s
,
t
)
defer
framework
.
DeleteTestingNamespace
(
ns
,
s
,
t
)
client
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
&
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
}})
client
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Groups
[
v1
.
GroupName
]
.
GroupVersion
()
}})
var
(
iZero
=
int64
(
0
)
...
...
@@ -154,7 +154,7 @@ func TestPodReadOnlyFilesystem(t *testing.T) {
ns
:=
framework
.
CreateTestingNamespace
(
"pod-readonly-root"
,
s
,
t
)
defer
framework
.
DeleteTestingNamespace
(
ns
,
s
,
t
)
client
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
&
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
}})
client
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Groups
[
v1
.
GroupName
]
.
GroupVersion
()
}})
pod
:=
&
v1
.
Pod
{
ObjectMeta
:
metav1
.
ObjectMeta
{
...
...
test/integration/quota/BUILD
View file @
8bcbbd4d
...
...
@@ -20,6 +20,7 @@ go_test(
],
deps = [
"//pkg/api:go_default_library",
"//pkg/api/testapi:go_default_library",
"//pkg/client/clientset_generated/internalclientset:go_default_library",
"//pkg/client/informers/informers_generated/internalversion:go_default_library",
"//pkg/controller:go_default_library",
...
...
test/integration/quota/quota_test.go
View file @
8bcbbd4d
...
...
@@ -36,6 +36,7 @@ import (
restclient
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/record"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/testapi"
"k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset"
internalinformers
"k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion"
"k8s.io/kubernetes/pkg/controller"
...
...
@@ -63,8 +64,8 @@ func TestQuota(t *testing.T) {
}))
admissionCh
:=
make
(
chan
struct
{})
clientset
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
QPS
:
-
1
,
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
&
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
}})
internalClientset
:=
internalclientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
QPS
:
-
1
,
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
&
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
}})
clientset
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
QPS
:
-
1
,
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Groups
[
v1
.
GroupName
]
.
GroupVersion
()
}})
internalClientset
:=
internalclientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
QPS
:
-
1
,
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Groups
[
v1
.
GroupName
]
.
GroupVersion
()
}})
config
:=
&
resourcequotaapi
.
Configuration
{}
admission
,
err
:=
resourcequota
.
NewResourceQuota
(
config
,
5
,
admissionCh
)
if
err
!=
nil
{
...
...
@@ -241,8 +242,8 @@ func TestQuotaLimitedResourceDenial(t *testing.T) {
}))
admissionCh
:=
make
(
chan
struct
{})
clientset
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
QPS
:
-
1
,
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
&
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
}})
internalClientset
:=
internalclientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
QPS
:
-
1
,
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
&
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
}})
clientset
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
QPS
:
-
1
,
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Groups
[
v1
.
GroupName
]
.
GroupVersion
()
}})
internalClientset
:=
internalclientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
QPS
:
-
1
,
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Groups
[
v1
.
GroupName
]
.
GroupVersion
()
}})
// stop creation of a pod resource unless there is a quota
config
:=
&
resourcequotaapi
.
Configuration
{
...
...
test/integration/scheduler/BUILD
View file @
8bcbbd4d
...
...
@@ -21,6 +21,7 @@ go_test(
],
deps = [
"//pkg/api:go_default_library",
"//pkg/api/testapi:go_default_library",
"//plugin/cmd/kube-scheduler/app:go_default_library",
"//plugin/cmd/kube-scheduler/app/options:go_default_library",
"//plugin/pkg/scheduler:go_default_library",
...
...
test/integration/scheduler/extender_test.go
View file @
8bcbbd4d
...
...
@@ -38,6 +38,7 @@ import (
restclient
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/record"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/testapi"
"k8s.io/kubernetes/plugin/pkg/scheduler"
_
"k8s.io/kubernetes/plugin/pkg/scheduler/algorithmprovider"
schedulerapi
"k8s.io/kubernetes/plugin/pkg/scheduler/api"
...
...
@@ -293,7 +294,7 @@ func TestSchedulerExtender(t *testing.T) {
ns
:=
framework
.
CreateTestingNamespace
(
"scheduler-extender"
,
s
,
t
)
defer
framework
.
DeleteTestingNamespace
(
ns
,
s
,
t
)
clientSet
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
&
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
}})
clientSet
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Groups
[
v1
.
GroupName
]
.
GroupVersion
()
}})
extender1
:=
&
Extender
{
name
:
"extender1"
,
...
...
@@ -354,7 +355,7 @@ func TestSchedulerExtender(t *testing.T) {
},
},
}
policy
.
APIVersion
=
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
.
String
()
policy
.
APIVersion
=
testapi
.
Groups
[
v1
.
GroupName
]
.
GroupVersion
()
.
String
()
informerFactory
:=
informers
.
NewSharedInformerFactory
(
clientSet
,
0
)
schedulerConfigFactory
:=
factory
.
NewConfigFactory
(
...
...
test/integration/scheduler/scheduler_test.go
View file @
8bcbbd4d
...
...
@@ -37,6 +37,7 @@ import (
"k8s.io/client-go/tools/cache"
"k8s.io/client-go/tools/record"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/testapi"
"k8s.io/kubernetes/plugin/cmd/kube-scheduler/app"
"k8s.io/kubernetes/plugin/cmd/kube-scheduler/app/options"
"k8s.io/kubernetes/plugin/pkg/scheduler"
...
...
@@ -82,7 +83,7 @@ func TestSchedulerCreationFromConfigMap(t *testing.T) {
ns
:=
framework
.
CreateTestingNamespace
(
"configmap"
,
s
,
t
)
defer
framework
.
DeleteTestingNamespace
(
ns
,
s
,
t
)
clientSet
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
&
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
}})
clientSet
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Groups
[
v1
.
GroupName
]
.
GroupVersion
()
}})
defer
clientSet
.
Core
()
.
Nodes
()
.
DeleteCollection
(
nil
,
metav1
.
ListOptions
{})
informerFactory
:=
informers
.
NewSharedInformerFactory
(
clientSet
,
0
)
...
...
@@ -112,7 +113,7 @@ func TestSchedulerCreationFromConfigMap(t *testing.T) {
},
}
policyConfigMap
.
APIVersion
=
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
.
String
()
policyConfigMap
.
APIVersion
=
testapi
.
Groups
[
v1
.
GroupName
]
.
GroupVersion
()
.
String
()
clientSet
.
Core
()
.
ConfigMaps
(
metav1
.
NamespaceSystem
)
.
Create
(
&
policyConfigMap
)
eventBroadcaster
:=
record
.
NewBroadcaster
()
...
...
@@ -162,7 +163,7 @@ func TestSchedulerCreationFromNonExistentConfigMap(t *testing.T) {
ns
:=
framework
.
CreateTestingNamespace
(
"configmap"
,
s
,
t
)
defer
framework
.
DeleteTestingNamespace
(
ns
,
s
,
t
)
clientSet
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
&
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
}})
clientSet
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Groups
[
v1
.
GroupName
]
.
GroupVersion
()
}})
defer
clientSet
.
Core
()
.
Nodes
()
.
DeleteCollection
(
nil
,
metav1
.
ListOptions
{})
informerFactory
:=
informers
.
NewSharedInformerFactory
(
clientSet
,
0
)
...
...
@@ -199,7 +200,7 @@ func TestSchedulerCreationInLegacyMode(t *testing.T) {
ns
:=
framework
.
CreateTestingNamespace
(
"configmap"
,
s
,
t
)
defer
framework
.
DeleteTestingNamespace
(
ns
,
s
,
t
)
clientSet
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
&
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
}})
clientSet
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Groups
[
v1
.
GroupName
]
.
GroupVersion
()
}})
defer
clientSet
.
Core
()
.
Nodes
()
.
DeleteCollection
(
nil
,
metav1
.
ListOptions
{})
informerFactory
:=
informers
.
NewSharedInformerFactory
(
clientSet
,
0
)
...
...
@@ -241,7 +242,7 @@ func TestUnschedulableNodes(t *testing.T) {
ns
:=
framework
.
CreateTestingNamespace
(
"unschedulable-nodes"
,
s
,
t
)
defer
framework
.
DeleteTestingNamespace
(
ns
,
s
,
t
)
clientSet
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
&
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
}})
clientSet
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Groups
[
v1
.
GroupName
]
.
GroupVersion
()
}})
informerFactory
:=
informers
.
NewSharedInformerFactory
(
clientSet
,
0
)
schedulerConfigFactory
:=
factory
.
NewConfigFactory
(
...
...
@@ -520,7 +521,7 @@ func TestMultiScheduler(t *testing.T) {
- testPodNoAnnotation2 and testPodWithAnnotationFitsDefault2 should NOT be scheduled
*/
// 1. create and start default-scheduler
clientSet
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
&
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
}})
clientSet
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Groups
[
v1
.
GroupName
]
.
GroupVersion
()
}})
// NOTE: This test cannot run in parallel, because it is creating and deleting
// non-namespaced objects (Nodes).
...
...
@@ -610,7 +611,7 @@ func TestMultiScheduler(t *testing.T) {
}
// 5. create and start a scheduler with name "foo-scheduler"
clientSet2
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
&
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
}})
clientSet2
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Groups
[
v1
.
GroupName
]
.
GroupVersion
()
}})
informerFactory2
:=
informers
.
NewSharedInformerFactory
(
clientSet
,
0
)
schedulerConfigFactory2
:=
factory
.
NewConfigFactory
(
...
...
@@ -716,7 +717,7 @@ func TestAllocatable(t *testing.T) {
defer
framework
.
DeleteTestingNamespace
(
ns
,
s
,
t
)
// 1. create and start default-scheduler
clientSet
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
&
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
}})
clientSet
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Groups
[
v1
.
GroupName
]
.
GroupVersion
()
}})
informerFactory
:=
informers
.
NewSharedInformerFactory
(
clientSet
,
0
)
// NOTE: This test cannot run in parallel, because it is creating and deleting
...
...
test/integration/scheduler_perf/BUILD
View file @
8bcbbd4d
...
...
@@ -19,6 +19,7 @@ go_library(
],
deps = [
"//pkg/api:go_default_library",
"//pkg/api/testapi:go_default_library",
"//plugin/pkg/scheduler:go_default_library",
"//plugin/pkg/scheduler/algorithmprovider:go_default_library",
"//plugin/pkg/scheduler/factory:go_default_library",
...
...
test/integration/scheduler_perf/util.go
View file @
8bcbbd4d
...
...
@@ -29,6 +29,7 @@ import (
restclient
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/record"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/testapi"
"k8s.io/kubernetes/plugin/pkg/scheduler"
_
"k8s.io/kubernetes/plugin/pkg/scheduler/algorithmprovider"
"k8s.io/kubernetes/plugin/pkg/scheduler/factory"
...
...
@@ -54,7 +55,7 @@ func mustSetupScheduler() (schedulerConfigurator scheduler.Configurator, destroy
clientSet
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
&
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
},
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Groups
[
v1
.
GroupName
]
.
GroupVersion
()
},
QPS
:
5000.0
,
Burst
:
5000
,
})
...
...
test/integration/secrets/BUILD
View file @
8bcbbd4d
...
...
@@ -19,7 +19,7 @@ go_test(
"integration",
],
deps = [
"//pkg/api:go_default_library",
"//pkg/api
/testapi
:go_default_library",
"//test/integration:go_default_library",
"//test/integration/framework:go_default_library",
"//vendor/k8s.io/api/core/v1:go_default_library",
...
...
test/integration/secrets/secrets_test.go
View file @
8bcbbd4d
...
...
@@ -25,7 +25,7 @@ import (
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
clientset
"k8s.io/client-go/kubernetes"
restclient
"k8s.io/client-go/rest"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api
/testapi
"
"k8s.io/kubernetes/test/integration"
"k8s.io/kubernetes/test/integration/framework"
)
...
...
@@ -41,7 +41,7 @@ func TestSecrets(t *testing.T) {
_
,
s
,
closeFn
:=
framework
.
RunAMaster
(
nil
)
defer
closeFn
()
client
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
&
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
}})
client
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Groups
[
v1
.
GroupName
]
.
GroupVersion
()
}})
ns
:=
framework
.
CreateTestingNamespace
(
"secret"
,
s
,
t
)
defer
framework
.
DeleteTestingNamespace
(
ns
,
s
,
t
)
...
...
test/integration/serviceaccount/BUILD
View file @
8bcbbd4d
...
...
@@ -19,7 +19,7 @@ go_test(
"integration",
],
deps = [
"//pkg/api:go_default_library",
"//pkg/api
/testapi
:go_default_library",
"//pkg/client/clientset_generated/internalclientset:go_default_library",
"//pkg/client/informers/informers_generated/internalversion:go_default_library",
"//pkg/controller:go_default_library",
...
...
test/integration/serviceaccount/service_account_test.go
View file @
8bcbbd4d
...
...
@@ -44,7 +44,7 @@ import (
"k8s.io/client-go/informers"
clientset
"k8s.io/client-go/kubernetes"
restclient
"k8s.io/client-go/rest"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api
/testapi
"
"k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset"
internalinformers
"k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion"
"k8s.io/kubernetes/pkg/controller"
...
...
@@ -346,11 +346,11 @@ func startServiceAccountTestServer(t *testing.T) (*clientset.Clientset, restclie
}))
// Anonymous client config
clientConfig
:=
restclient
.
Config
{
Host
:
apiServer
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
&
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
}}
clientConfig
:=
restclient
.
Config
{
Host
:
apiServer
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Groups
[
v1
.
GroupName
]
.
GroupVersion
()
}}
// Root client
// TODO: remove rootClient after we refactor pkg/admission to use the clientset.
rootClientset
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
apiServer
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
&
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
},
BearerToken
:
rootToken
})
internalRootClientset
:=
internalclientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
apiServer
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
&
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
},
BearerToken
:
rootToken
})
rootClientset
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
apiServer
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Groups
[
v1
.
GroupName
]
.
GroupVersion
()
},
BearerToken
:
rootToken
})
internalRootClientset
:=
internalclientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
apiServer
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Groups
[
v1
.
GroupName
]
.
GroupVersion
()
},
BearerToken
:
rootToken
})
// Set up two authenticators:
// 1. A token authenticator that maps the rootToken to the "root" user
// 2. A ServiceAccountToken authenticator that validates ServiceAccount tokens
...
...
test/integration/storageclasses/BUILD
View file @
8bcbbd4d
...
...
@@ -19,7 +19,7 @@ go_test(
"integration",
],
deps = [
"//pkg/api:go_default_library",
"//pkg/api
/testapi
:go_default_library",
"//test/integration/framework:go_default_library",
"//vendor/k8s.io/api/core/v1:go_default_library",
"//vendor/k8s.io/api/storage/v1:go_default_library",
...
...
test/integration/storageclasses/storage_classes_test.go
View file @
8bcbbd4d
...
...
@@ -27,7 +27,7 @@ import (
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
clientset
"k8s.io/client-go/kubernetes"
restclient
"k8s.io/client-go/rest"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api
/testapi
"
"k8s.io/kubernetes/test/integration/framework"
)
...
...
@@ -38,7 +38,7 @@ func TestStorageClasses(t *testing.T) {
_
,
s
,
closeFn
:=
framework
.
RunAMaster
(
nil
)
defer
closeFn
()
client
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
&
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
}})
client
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Groups
[
v1
.
GroupName
]
.
GroupVersion
()
}})
ns
:=
framework
.
CreateTestingNamespace
(
"storageclass"
,
s
,
t
)
defer
framework
.
DeleteTestingNamespace
(
ns
,
s
,
t
)
...
...
test/integration/volume/BUILD
View file @
8bcbbd4d
...
...
@@ -21,6 +21,7 @@ go_test(
],
deps = [
"//pkg/api:go_default_library",
"//pkg/api/testapi:go_default_library",
"//pkg/api/v1/ref:go_default_library",
"//pkg/cloudprovider/providers/fake:go_default_library",
"//pkg/controller/volume/attachdetach:go_default_library",
...
...
test/integration/volume/attach_detach_test.go
View file @
8bcbbd4d
...
...
@@ -29,6 +29,7 @@ import (
restclient
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/cache"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/testapi"
fakecloud
"k8s.io/kubernetes/pkg/cloudprovider/providers/fake"
"k8s.io/kubernetes/pkg/controller/volume/attachdetach"
volumecache
"k8s.io/kubernetes/pkg/controller/volume/attachdetach/cache"
...
...
@@ -323,7 +324,7 @@ func waitForPodFuncInDSWP(t *testing.T, dswp volumecache.DesiredStateOfWorld, ch
func
createAdClients
(
ns
*
v1
.
Namespace
,
t
*
testing
.
T
,
server
*
httptest
.
Server
,
syncPeriod
time
.
Duration
)
(
*
clientset
.
Clientset
,
attachdetach
.
AttachDetachController
,
informers
.
SharedInformerFactory
)
{
config
:=
restclient
.
Config
{
Host
:
server
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
&
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
},
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Groups
[
v1
.
GroupName
]
.
GroupVersion
()
},
QPS
:
1000000
,
Burst
:
1000000
,
}
...
...
test/integration/volume/persistent_volumes_test.go
View file @
8bcbbd4d
...
...
@@ -34,6 +34,7 @@ import (
clientset
"k8s.io/client-go/kubernetes"
restclient
"k8s.io/client-go/rest"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/testapi"
"k8s.io/kubernetes/pkg/api/v1/ref"
fakecloud
"k8s.io/kubernetes/pkg/cloudprovider/providers/fake"
persistentvolumecontroller
"k8s.io/kubernetes/pkg/controller/volume/persistentvolume"
...
...
@@ -1099,13 +1100,13 @@ func createClients(ns *v1.Namespace, t *testing.T, s *httptest.Server, syncPerio
// creates many objects and default values were too low.
binderClient
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
&
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
},
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Groups
[
v1
.
GroupName
]
.
GroupVersion
()
},
QPS
:
1000000
,
Burst
:
1000000
,
})
testClient
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
&
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
},
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Groups
[
v1
.
GroupName
]
.
GroupVersion
()
},
QPS
:
1000000
,
Burst
:
1000000
,
})
...
...
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