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
be8a9b96
Unverified
Commit
be8a9b96
authored
Feb 26, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
Feb 26, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #74422 from liggitt/client-version-methods
Remove deprecated versionless client interface methods
parents
c487757e
d1e865ee
Hide whitespace changes
Inline
Side-by-side
Showing
75 changed files
with
218 additions
and
643 deletions
+218
-643
idempotency_test.go
cmd/kubeadm/app/util/apiclient/idempotency_test.go
+1
-1
certificate_controller_test.go
pkg/controller/certificates/certificate_controller_test.go
+1
-1
namespaced_resources_deleter_test.go
...r/namespace/deletion/namespaced_resources_deleter_test.go
+4
-4
horizontal_test.go
pkg/controller/podautoscaler/horizontal_test.go
+2
-2
legacy_horizontal_test.go
pkg/controller/podautoscaler/legacy_horizontal_test.go
+2
-2
replica_set_test.go
pkg/controller/replicaset/replica_set_test.go
+1
-1
test_utils.go
pkg/controller/testutil/test_utils.go
+1
-1
attach_detach_controller_test.go
...ller/volume/attachdetach/attach_detach_controller_test.go
+2
-2
cp.go
pkg/kubectl/cmd/cp/cp.go
+1
-1
scale.go
pkg/kubectl/cmd/scale/scale.go
+1
-1
scalejob_test.go
pkg/kubectl/cmd/scale/scalejob_test.go
+4
-4
top_node.go
pkg/kubectl/cmd/top/top_node.go
+1
-1
top_pod.go
pkg/kubectl/cmd/top/top_pod.go
+2
-2
describe.go
pkg/kubectl/describe/versioned/describe.go
+60
-60
cordon.go
pkg/kubectl/drain/cordon.go
+1
-1
helpers_test.go
pkg/kubectl/polymorphichelpers/helpers_test.go
+1
-1
rolling_updater_test.go
pkg/kubectl/rolling_updater_test.go
+10
-10
client_ca_hook_test.go
pkg/master/client_ca_hook_test.go
+1
-1
controller_test.go
pkg/master/controller_test.go
+5
-5
master_test.go
pkg/master/master_test.go
+2
-2
repair_test.go
...gistry/core/service/ipallocator/controller/repair_test.go
+4
-4
repair_test.go
...stry/core/service/portallocator/controller/repair_test.go
+4
-4
nodeinfomanager_test.go
pkg/volume/csi/nodeinfomanager/nodeinfomanager_test.go
+2
-2
glusterfs.go
pkg/volume/glusterfs/glusterfs.go
+1
-1
rbd.go
pkg/volume/rbd/rbd.go
+1
-1
storageos_test.go
pkg/volume/storageos/storageos_test.go
+1
-1
admission.go
plugin/pkg/admission/namespace/autoprovision/admission.go
+1
-1
admission.go
plugin/pkg/admission/namespace/exists/admission.go
+1
-1
admission.go
plugin/pkg/admission/podnodeselector/admission.go
+1
-1
resource_access.go
plugin/pkg/admission/resourcequota/resource_access.go
+1
-1
admission.go
plugin/pkg/admission/serviceaccount/admission.go
+1
-1
clientset.go
...les/client-go/pkg/client/clientset/versioned/clientset.go
+0
-8
clientset_generated.go
...kg/client/clientset/versioned/fake/clientset_generated.go
+0
-5
clientset.go
...ons-apiserver/pkg/client/clientset/clientset/clientset.go
+0
-8
clientset_generated.go
...kg/client/clientset/clientset/fake/clientset_generated.go
+0
-5
resources.go
...tensions-apiserver/test/integration/fixtures/resources.go
+1
-1
main_test.go
...ng/src/k8s.io/client-go/examples/fake-client/main_test.go
+1
-1
clientset.go
staging/src/k8s.io/client-go/kubernetes/clientset.go
+0
-144
clientset_generated.go
...c/k8s.io/client-go/kubernetes/fake/clientset_generated.go
+0
-90
informerwatcher_test.go
.../src/k8s.io/client-go/tools/watch/informerwatcher_test.go
+2
-2
clientset.go
...ator/_examples/MixedCase/clientset/versioned/clientset.go
+0
-8
clientset_generated.go
...MixedCase/clientset/versioned/fake/clientset_generated.go
+0
-5
clientset.go
...ator/_examples/apiserver/clientset/versioned/clientset.go
+0
-16
clientset_generated.go
...apiserver/clientset/versioned/fake/clientset_generated.go
+0
-10
clientset.go
...-generator/_examples/crd/clientset/versioned/clientset.go
+0
-16
clientset_generated.go
...mples/crd/clientset/versioned/fake/clientset_generated.go
+0
-10
generator_fake_for_clientset.go
...lient-gen/generators/fake/generator_fake_for_clientset.go
+0
-4
generator_for_clientset.go
...ator/cmd/client-gen/generators/generator_for_clientset.go
+1
-15
helpers.go
...src/k8s.io/code-generator/cmd/client-gen/types/helpers.go
+1
-3
types.go
...g/src/k8s.io/code-generator/cmd/client-gen/types/types.go
+2
-5
clientset.go
...8s.io/csi-api/pkg/client/clientset/versioned/clientset.go
+0
-8
clientset_generated.go
...kg/client/clientset/versioned/fake/clientset_generated.go
+0
-5
clientset.go
...tor/pkg/client/clientset_generated/clientset/clientset.go
+0
-8
clientset_generated.go
...clientset_generated/clientset/fake/clientset_generated.go
+0
-5
clientset.go
...8s.io/metrics/pkg/client/clientset/versioned/clientset.go
+0
-8
clientset_generated.go
...kg/client/clientset/versioned/fake/clientset_generated.go
+0
-5
clientset.go
...s.io/node-api/pkg/client/clientset/versioned/clientset.go
+0
-8
clientset_generated.go
...kg/client/clientset/versioned/fake/clientset_generated.go
+0
-5
clientset.go
...-apiserver/pkg/generated/clientset/versioned/clientset.go
+0
-8
clientset_generated.go
...generated/clientset/versioned/fake/clientset_generated.go
+0
-5
clientset.go
...controller/pkg/generated/clientset/versioned/clientset.go
+0
-8
clientset_generated.go
...generated/clientset/versioned/fake/clientset_generated.go
+0
-5
podlogs.go
test/e2e/framework/podlogs/podlogs.go
+6
-5
defaulttolerationseconds_test.go
...defaulttolerationseconds/defaulttolerationseconds_test.go
+1
-1
evictions_test.go
test/integration/evictions/evictions_test.go
+10
-10
metrics_test.go
test/integration/metrics/metrics_test.go
+1
-1
objectmeta_test.go
test/integration/objectmeta/objectmeta_test.go
+2
-2
pods_test.go
test/integration/pods/pods_test.go
+3
-3
quota_test.go
test/integration/quota/quota_test.go
+9
-9
service_account_test.go
test/integration/serviceaccount/service_account_test.go
+25
-25
statefulset_test.go
test/integration/statefulset/statefulset_test.go
+2
-2
util.go
test/integration/statefulset/util.go
+2
-2
ttlcontroller_test.go
test/integration/ttlcontroller/ttlcontroller_test.go
+2
-2
attach_detach_test.go
test/integration/volume/attach_detach_test.go
+15
-15
persistent_volumes_test.go
test/integration/volume/persistent_volumes_test.go
+11
-11
No files found.
cmd/kubeadm/app/util/apiclient/idempotency_test.go
View file @
be8a9b96
...
@@ -62,7 +62,7 @@ func TestPatchNodeNonErrorCases(t *testing.T) {
...
@@ -62,7 +62,7 @@ func TestPatchNodeNonErrorCases(t *testing.T) {
for
_
,
tc
:=
range
testcases
{
for
_
,
tc
:=
range
testcases
{
t
.
Run
(
tc
.
name
,
func
(
t
*
testing
.
T
)
{
t
.
Run
(
tc
.
name
,
func
(
t
*
testing
.
T
)
{
client
:=
fake
.
NewSimpleClientset
()
client
:=
fake
.
NewSimpleClientset
()
_
,
err
:=
client
.
Core
()
.
Nodes
()
.
Create
(
&
tc
.
node
)
_
,
err
:=
client
.
Core
V1
()
.
Nodes
()
.
Create
(
&
tc
.
node
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatalf
(
"failed to create node to fake client: %v"
,
err
)
t
.
Fatalf
(
"failed to create node to fake client: %v"
,
err
)
}
}
...
...
pkg/controller/certificates/certificate_controller_test.go
View file @
be8a9b96
...
@@ -47,7 +47,7 @@ func TestCertificateController(t *testing.T) {
...
@@ -47,7 +47,7 @@ func TestCertificateController(t *testing.T) {
Reason
:
"test reason"
,
Reason
:
"test reason"
,
Message
:
"test message"
,
Message
:
"test message"
,
})
})
_
,
err
:=
client
.
Certificates
()
.
CertificateSigningRequests
()
.
UpdateApproval
(
csr
)
_
,
err
:=
client
.
Certificates
V1beta1
()
.
CertificateSigningRequests
()
.
UpdateApproval
(
csr
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
...
...
pkg/controller/namespace/deletion/namespaced_resources_deleter_test.go
View file @
be8a9b96
...
@@ -66,7 +66,7 @@ func TestFinalizeNamespaceFunc(t *testing.T) {
...
@@ -66,7 +66,7 @@ func TestFinalizeNamespaceFunc(t *testing.T) {
},
},
}
}
d
:=
namespacedResourcesDeleter
{
d
:=
namespacedResourcesDeleter
{
nsClient
:
mockClient
.
Core
()
.
Namespaces
(),
nsClient
:
mockClient
.
Core
V1
()
.
Namespaces
(),
finalizerToken
:
v1
.
FinalizerKubernetes
,
finalizerToken
:
v1
.
FinalizerKubernetes
,
}
}
d
.
finalizeNamespace
(
testNamespace
)
d
.
finalizeNamespace
(
testNamespace
)
...
@@ -180,7 +180,7 @@ func testSyncNamespaceThatIsTerminating(t *testing.T, versions *metav1.APIVersio
...
@@ -180,7 +180,7 @@ func testSyncNamespaceThatIsTerminating(t *testing.T, versions *metav1.APIVersio
fn
:=
func
()
([]
*
metav1
.
APIResourceList
,
error
)
{
fn
:=
func
()
([]
*
metav1
.
APIResourceList
,
error
)
{
return
resources
,
nil
return
resources
,
nil
}
}
d
:=
NewNamespacedResourcesDeleter
(
mockClient
.
Core
()
.
Namespaces
(),
dynamicClient
,
mockClient
.
Core
(),
fn
,
v1
.
FinalizerKubernetes
,
true
)
d
:=
NewNamespacedResourcesDeleter
(
mockClient
.
Core
V1
()
.
Namespaces
(),
dynamicClient
,
mockClient
.
CoreV1
(),
fn
,
v1
.
FinalizerKubernetes
,
true
)
if
err
:=
d
.
Delete
(
testInput
.
testNamespace
.
Name
);
err
!=
nil
{
if
err
:=
d
.
Delete
(
testInput
.
testNamespace
.
Name
);
err
!=
nil
{
t
.
Errorf
(
"scenario %s - Unexpected error when synching namespace %v"
,
scenario
,
err
)
t
.
Errorf
(
"scenario %s - Unexpected error when synching namespace %v"
,
scenario
,
err
)
}
}
...
@@ -219,7 +219,7 @@ func TestRetryOnConflictError(t *testing.T) {
...
@@ -219,7 +219,7 @@ func TestRetryOnConflictError(t *testing.T) {
}
}
namespace
:=
&
v1
.
Namespace
{}
namespace
:=
&
v1
.
Namespace
{}
d
:=
namespacedResourcesDeleter
{
d
:=
namespacedResourcesDeleter
{
nsClient
:
mockClient
.
Core
()
.
Namespaces
(),
nsClient
:
mockClient
.
Core
V1
()
.
Namespaces
(),
}
}
_
,
err
:=
d
.
retryOnConflictError
(
namespace
,
retryOnce
)
_
,
err
:=
d
.
retryOnConflictError
(
namespace
,
retryOnce
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -255,7 +255,7 @@ func TestSyncNamespaceThatIsActive(t *testing.T) {
...
@@ -255,7 +255,7 @@ func TestSyncNamespaceThatIsActive(t *testing.T) {
fn
:=
func
()
([]
*
metav1
.
APIResourceList
,
error
)
{
fn
:=
func
()
([]
*
metav1
.
APIResourceList
,
error
)
{
return
testResources
(),
nil
return
testResources
(),
nil
}
}
d
:=
NewNamespacedResourcesDeleter
(
mockClient
.
Core
()
.
Namespaces
(),
nil
,
mockClient
.
Core
(),
d
:=
NewNamespacedResourcesDeleter
(
mockClient
.
Core
V1
()
.
Namespaces
(),
nil
,
mockClient
.
CoreV1
(),
fn
,
v1
.
FinalizerKubernetes
,
true
)
fn
,
v1
.
FinalizerKubernetes
,
true
)
err
:=
d
.
Delete
(
testNamespace
.
Name
)
err
:=
d
.
Delete
(
testNamespace
.
Name
)
if
err
!=
nil
{
if
err
!=
nil
{
...
...
pkg/controller/podautoscaler/horizontal_test.go
View file @
be8a9b96
...
@@ -665,9 +665,9 @@ func (tc *testCase) setupController(t *testing.T) (*HorizontalController, inform
...
@@ -665,9 +665,9 @@ func (tc *testCase) setupController(t *testing.T) (*HorizontalController, inform
defaultDownscalestabilizationWindow
:=
5
*
time
.
Minute
defaultDownscalestabilizationWindow
:=
5
*
time
.
Minute
hpaController
:=
NewHorizontalController
(
hpaController
:=
NewHorizontalController
(
eventClient
.
Core
(),
eventClient
.
Core
V1
(),
testScaleClient
,
testScaleClient
,
testClient
.
Autoscaling
(),
testClient
.
Autoscaling
V1
(),
testrestmapper
.
TestOnlyStaticRESTMapper
(
legacyscheme
.
Scheme
),
testrestmapper
.
TestOnlyStaticRESTMapper
(
legacyscheme
.
Scheme
),
metricsClient
,
metricsClient
,
informerFactory
.
Autoscaling
()
.
V1
()
.
HorizontalPodAutoscalers
(),
informerFactory
.
Autoscaling
()
.
V1
()
.
HorizontalPodAutoscalers
(),
...
...
pkg/controller/podautoscaler/legacy_horizontal_test.go
View file @
be8a9b96
...
@@ -494,9 +494,9 @@ func (tc *legacyTestCase) runTest(t *testing.T) {
...
@@ -494,9 +494,9 @@ func (tc *legacyTestCase) runTest(t *testing.T) {
defaultDownscaleStabilisationWindow
:=
5
*
time
.
Minute
defaultDownscaleStabilisationWindow
:=
5
*
time
.
Minute
hpaController
:=
NewHorizontalController
(
hpaController
:=
NewHorizontalController
(
eventClient
.
Core
(),
eventClient
.
Core
V1
(),
testScaleClient
,
testScaleClient
,
testClient
.
Autoscaling
(),
testClient
.
Autoscaling
V1
(),
testrestmapper
.
TestOnlyStaticRESTMapper
(
legacyscheme
.
Scheme
),
testrestmapper
.
TestOnlyStaticRESTMapper
(
legacyscheme
.
Scheme
),
metricsClient
,
metricsClient
,
informerFactory
.
Autoscaling
()
.
V1
()
.
HorizontalPodAutoscalers
(),
informerFactory
.
Autoscaling
()
.
V1
()
.
HorizontalPodAutoscalers
(),
...
...
pkg/controller/replicaset/replica_set_test.go
View file @
be8a9b96
...
@@ -672,7 +672,7 @@ func TestControllerUpdateStatusWithFailure(t *testing.T) {
...
@@ -672,7 +672,7 @@ func TestControllerUpdateStatusWithFailure(t *testing.T) {
fakeClient
.
AddReactor
(
"*"
,
"*"
,
func
(
action
core
.
Action
)
(
bool
,
runtime
.
Object
,
error
)
{
fakeClient
.
AddReactor
(
"*"
,
"*"
,
func
(
action
core
.
Action
)
(
bool
,
runtime
.
Object
,
error
)
{
return
true
,
&
apps
.
ReplicaSet
{},
fmt
.
Errorf
(
"Fake error"
)
return
true
,
&
apps
.
ReplicaSet
{},
fmt
.
Errorf
(
"Fake error"
)
})
})
fakeRSClient
:=
fakeClient
.
Apps
()
.
ReplicaSets
(
"default"
)
fakeRSClient
:=
fakeClient
.
Apps
V1
()
.
ReplicaSets
(
"default"
)
numReplicas
:=
int32
(
10
)
numReplicas
:=
int32
(
10
)
newStatus
:=
apps
.
ReplicaSetStatus
{
Replicas
:
numReplicas
}
newStatus
:=
apps
.
ReplicaSetStatus
{
Replicas
:
numReplicas
}
updateReplicaSetStatus
(
fakeRSClient
,
rs
,
newStatus
)
updateReplicaSetStatus
(
fakeRSClient
,
rs
,
newStatus
)
...
...
pkg/controller/testutil/test_utils.go
View file @
be8a9b96
...
@@ -96,7 +96,7 @@ func (m *FakeNodeHandler) GetUpdatedNodesCopy() []*v1.Node {
...
@@ -96,7 +96,7 @@ func (m *FakeNodeHandler) GetUpdatedNodesCopy() []*v1.Node {
// Core returns fake CoreInterface.
// Core returns fake CoreInterface.
func
(
m
*
FakeNodeHandler
)
Core
()
v1core
.
CoreV1Interface
{
func
(
m
*
FakeNodeHandler
)
Core
()
v1core
.
CoreV1Interface
{
return
&
FakeLegacyHandler
{
m
.
Clientset
.
Core
(),
m
}
return
&
FakeLegacyHandler
{
m
.
Clientset
.
Core
V1
(),
m
}
}
}
// CoreV1 returns fake CoreV1Interface
// CoreV1 returns fake CoreV1Interface
...
...
pkg/controller/volume/attachdetach/attach_detach_controller_test.go
View file @
be8a9b96
...
@@ -156,7 +156,7 @@ func attachDetachRecoveryTestCase(t *testing.T, extraPods1 []*v1.Pod, extraPods2
...
@@ -156,7 +156,7 @@ func attachDetachRecoveryTestCase(t *testing.T, extraPods1 []*v1.Pod, extraPods2
stopCh
:=
make
(
chan
struct
{})
stopCh
:=
make
(
chan
struct
{})
pods
,
err
:=
fakeKubeClient
.
Core
()
.
Pods
(
v1
.
NamespaceAll
)
.
List
(
metav1
.
ListOptions
{})
pods
,
err
:=
fakeKubeClient
.
Core
V1
()
.
Pods
(
v1
.
NamespaceAll
)
.
List
(
metav1
.
ListOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatalf
(
"Run failed with error. Expected: <no error> Actual: %v"
,
err
)
t
.
Fatalf
(
"Run failed with error. Expected: <no error> Actual: %v"
,
err
)
}
}
...
@@ -166,7 +166,7 @@ func attachDetachRecoveryTestCase(t *testing.T, extraPods1 []*v1.Pod, extraPods2
...
@@ -166,7 +166,7 @@ func attachDetachRecoveryTestCase(t *testing.T, extraPods1 []*v1.Pod, extraPods2
podInformer
.
GetIndexer
()
.
Add
(
&
podToAdd
)
podInformer
.
GetIndexer
()
.
Add
(
&
podToAdd
)
podsNum
++
podsNum
++
}
}
nodes
,
err
:=
fakeKubeClient
.
Core
()
.
Nodes
()
.
List
(
metav1
.
ListOptions
{})
nodes
,
err
:=
fakeKubeClient
.
Core
V1
()
.
Nodes
()
.
List
(
metav1
.
ListOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatalf
(
"Run failed with error. Expected: <no error> Actual: %v"
,
err
)
t
.
Fatalf
(
"Run failed with error. Expected: <no error> Actual: %v"
,
err
)
}
}
...
...
pkg/kubectl/cmd/cp/cp.go
View file @
be8a9b96
...
@@ -499,7 +499,7 @@ func (o *CopyOptions) execute(options *exec.ExecOptions) error {
...
@@ -499,7 +499,7 @@ func (o *CopyOptions) execute(options *exec.ExecOptions) error {
}
}
options
.
Config
=
o
.
ClientConfig
options
.
Config
=
o
.
ClientConfig
options
.
PodClient
=
o
.
Clientset
.
Core
()
options
.
PodClient
=
o
.
Clientset
.
Core
V1
()
if
err
:=
options
.
Validate
();
err
!=
nil
{
if
err
:=
options
.
Validate
();
err
!=
nil
{
return
err
return
err
...
...
pkg/kubectl/cmd/scale/scale.go
View file @
be8a9b96
...
@@ -228,7 +228,7 @@ func (o *ScaleOptions) RunScale() error {
...
@@ -228,7 +228,7 @@ func (o *ScaleOptions) RunScale() error {
// go down the legacy jobs path. This can be removed in 3.14 For now, contain it.
// go down the legacy jobs path. This can be removed in 3.14 For now, contain it.
fmt
.
Fprintf
(
o
.
ErrOut
,
"%s scale job is DEPRECATED and will be removed in a future version.
\n
"
,
o
.
parent
)
fmt
.
Fprintf
(
o
.
ErrOut
,
"%s scale job is DEPRECATED and will be removed in a future version.
\n
"
,
o
.
parent
)
if
err
:=
ScaleJob
(
info
,
o
.
clientSet
.
Batch
(),
uint
(
o
.
Replicas
),
precondition
,
retry
,
waitForReplicas
);
err
!=
nil
{
if
err
:=
ScaleJob
(
info
,
o
.
clientSet
.
Batch
V1
(),
uint
(
o
.
Replicas
),
precondition
,
retry
,
waitForReplicas
);
err
!=
nil
{
return
err
return
err
}
}
...
...
pkg/kubectl/cmd/scale/scalejob_test.go
View file @
be8a9b96
...
@@ -69,7 +69,7 @@ func (c *errorJobClient) Jobs(namespace string) batchclient.JobInterface {
...
@@ -69,7 +69,7 @@ func (c *errorJobClient) Jobs(namespace string) batchclient.JobInterface {
}
}
func
TestJobScaleRetry
(
t
*
testing
.
T
)
{
func
TestJobScaleRetry
(
t
*
testing
.
T
)
{
fake
:=
&
errorJobClient
{
JobsGetter
:
fake
.
NewSimpleClientset
()
.
Batch
(),
conflict
:
true
}
fake
:=
&
errorJobClient
{
JobsGetter
:
fake
.
NewSimpleClientset
()
.
Batch
V1
(),
conflict
:
true
}
scaler
:=
&
JobPsuedoScaler
{
JobsClient
:
fake
}
scaler
:=
&
JobPsuedoScaler
{
JobsClient
:
fake
}
preconditions
:=
ScalePrecondition
{
-
1
,
""
}
preconditions
:=
ScalePrecondition
{
-
1
,
""
}
count
:=
uint
(
3
)
count
:=
uint
(
3
)
...
@@ -103,7 +103,7 @@ func job() *batch.Job {
...
@@ -103,7 +103,7 @@ func job() *batch.Job {
func
TestJobScale
(
t
*
testing
.
T
)
{
func
TestJobScale
(
t
*
testing
.
T
)
{
fakeClientset
:=
fake
.
NewSimpleClientset
(
job
())
fakeClientset
:=
fake
.
NewSimpleClientset
(
job
())
scaler
:=
&
JobPsuedoScaler
{
JobsClient
:
fakeClientset
.
Batch
()}
scaler
:=
&
JobPsuedoScaler
{
JobsClient
:
fakeClientset
.
Batch
V1
()}
preconditions
:=
ScalePrecondition
{
-
1
,
""
}
preconditions
:=
ScalePrecondition
{
-
1
,
""
}
count
:=
uint
(
3
)
count
:=
uint
(
3
)
name
:=
"foo"
name
:=
"foo"
...
@@ -122,7 +122,7 @@ func TestJobScale(t *testing.T) {
...
@@ -122,7 +122,7 @@ func TestJobScale(t *testing.T) {
}
}
func
TestJobScaleInvalid
(
t
*
testing
.
T
)
{
func
TestJobScaleInvalid
(
t
*
testing
.
T
)
{
fake
:=
&
errorJobClient
{
JobsGetter
:
fake
.
NewSimpleClientset
()
.
Batch
(),
invalid
:
true
}
fake
:=
&
errorJobClient
{
JobsGetter
:
fake
.
NewSimpleClientset
()
.
Batch
V1
(),
invalid
:
true
}
scaler
:=
&
JobPsuedoScaler
{
JobsClient
:
fake
}
scaler
:=
&
JobPsuedoScaler
{
JobsClient
:
fake
}
preconditions
:=
ScalePrecondition
{
-
1
,
""
}
preconditions
:=
ScalePrecondition
{
-
1
,
""
}
count
:=
uint
(
3
)
count
:=
uint
(
3
)
...
@@ -150,7 +150,7 @@ func TestJobScaleFailsPreconditions(t *testing.T) {
...
@@ -150,7 +150,7 @@ func TestJobScaleFailsPreconditions(t *testing.T) {
Parallelism
:
&
ten
,
Parallelism
:
&
ten
,
},
},
})
})
scaler
:=
&
JobPsuedoScaler
{
JobsClient
:
fake
.
Batch
()}
scaler
:=
&
JobPsuedoScaler
{
JobsClient
:
fake
.
Batch
V1
()}
preconditions
:=
ScalePrecondition
{
2
,
""
}
preconditions
:=
ScalePrecondition
{
2
,
""
}
count
:=
uint
(
3
)
count
:=
uint
(
3
)
name
:=
"foo"
name
:=
"foo"
...
...
pkg/kubectl/cmd/top/top_node.go
View file @
be8a9b96
...
@@ -219,7 +219,7 @@ func (o TopNodeOptions) RunTopNode() error {
...
@@ -219,7 +219,7 @@ func (o TopNodeOptions) RunTopNode() error {
func
getNodeMetricsFromMetricsAPI
(
metricsClient
metricsclientset
.
Interface
,
resourceName
string
,
selector
labels
.
Selector
)
(
*
metricsapi
.
NodeMetricsList
,
error
)
{
func
getNodeMetricsFromMetricsAPI
(
metricsClient
metricsclientset
.
Interface
,
resourceName
string
,
selector
labels
.
Selector
)
(
*
metricsapi
.
NodeMetricsList
,
error
)
{
var
err
error
var
err
error
versionedMetrics
:=
&
metricsV1beta1api
.
NodeMetricsList
{}
versionedMetrics
:=
&
metricsV1beta1api
.
NodeMetricsList
{}
mc
:=
metricsClient
.
Metrics
()
mc
:=
metricsClient
.
Metrics
V1beta1
()
nm
:=
mc
.
NodeMetricses
()
nm
:=
mc
.
NodeMetricses
()
if
resourceName
!=
""
{
if
resourceName
!=
""
{
m
,
err
:=
nm
.
Get
(
resourceName
,
metav1
.
GetOptions
{})
m
,
err
:=
nm
.
Get
(
resourceName
,
metav1
.
GetOptions
{})
...
...
pkg/kubectl/cmd/top/top_pod.go
View file @
be8a9b96
...
@@ -205,13 +205,13 @@ func getMetricsFromMetricsAPI(metricsClient metricsclientset.Interface, namespac
...
@@ -205,13 +205,13 @@ func getMetricsFromMetricsAPI(metricsClient metricsclientset.Interface, namespac
}
}
versionedMetrics
:=
&
metricsv1beta1api
.
PodMetricsList
{}
versionedMetrics
:=
&
metricsv1beta1api
.
PodMetricsList
{}
if
resourceName
!=
""
{
if
resourceName
!=
""
{
m
,
err
:=
metricsClient
.
Metrics
()
.
PodMetricses
(
ns
)
.
Get
(
resourceName
,
metav1
.
GetOptions
{})
m
,
err
:=
metricsClient
.
Metrics
V1beta1
()
.
PodMetricses
(
ns
)
.
Get
(
resourceName
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
versionedMetrics
.
Items
=
[]
metricsv1beta1api
.
PodMetrics
{
*
m
}
versionedMetrics
.
Items
=
[]
metricsv1beta1api
.
PodMetrics
{
*
m
}
}
else
{
}
else
{
versionedMetrics
,
err
=
metricsClient
.
Metrics
()
.
PodMetricses
(
ns
)
.
List
(
metav1
.
ListOptions
{
LabelSelector
:
selector
.
String
()})
versionedMetrics
,
err
=
metricsClient
.
Metrics
V1beta1
()
.
PodMetricses
(
ns
)
.
List
(
metav1
.
ListOptions
{
LabelSelector
:
selector
.
String
()})
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
...
...
pkg/kubectl/describe/versioned/describe.go
View file @
be8a9b96
...
@@ -222,7 +222,7 @@ func GenericDescriberFor(mapping *meta.RESTMapping, clientConfig *rest.Config) (
...
@@ -222,7 +222,7 @@ func GenericDescriberFor(mapping *meta.RESTMapping, clientConfig *rest.Config) (
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
false
return
nil
,
false
}
}
eventsClient
:=
clientSet
.
Core
()
eventsClient
:=
clientSet
.
Core
V1
()
return
&
genericDescriber
{
mapping
,
dynamicClient
,
eventsClient
},
true
return
&
genericDescriber
{
mapping
,
dynamicClient
,
eventsClient
},
true
}
}
...
@@ -349,11 +349,11 @@ type NamespaceDescriber struct {
...
@@ -349,11 +349,11 @@ type NamespaceDescriber struct {
}
}
func
(
d
*
NamespaceDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
func
(
d
*
NamespaceDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
ns
,
err
:=
d
.
Core
()
.
Namespaces
()
.
Get
(
name
,
metav1
.
GetOptions
{})
ns
,
err
:=
d
.
Core
V1
()
.
Namespaces
()
.
Get
(
name
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
return
""
,
err
return
""
,
err
}
}
resourceQuotaList
,
err
:=
d
.
Core
()
.
ResourceQuotas
(
name
)
.
List
(
metav1
.
ListOptions
{})
resourceQuotaList
,
err
:=
d
.
Core
V1
()
.
ResourceQuotas
(
name
)
.
List
(
metav1
.
ListOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
if
errors
.
IsNotFound
(
err
)
{
if
errors
.
IsNotFound
(
err
)
{
// Server does not support resource quotas.
// Server does not support resource quotas.
...
@@ -363,7 +363,7 @@ func (d *NamespaceDescriber) Describe(namespace, name string, describerSettings
...
@@ -363,7 +363,7 @@ func (d *NamespaceDescriber) Describe(namespace, name string, describerSettings
return
""
,
err
return
""
,
err
}
}
}
}
limitRangeList
,
err
:=
d
.
Core
()
.
LimitRanges
(
name
)
.
List
(
metav1
.
ListOptions
{})
limitRangeList
,
err
:=
d
.
Core
V1
()
.
LimitRanges
(
name
)
.
List
(
metav1
.
ListOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
if
errors
.
IsNotFound
(
err
)
{
if
errors
.
IsNotFound
(
err
)
{
// Server does not support limit ranges.
// Server does not support limit ranges.
...
@@ -522,7 +522,7 @@ type LimitRangeDescriber struct {
...
@@ -522,7 +522,7 @@ type LimitRangeDescriber struct {
}
}
func
(
d
*
LimitRangeDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
func
(
d
*
LimitRangeDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
lr
:=
d
.
Core
()
.
LimitRanges
(
namespace
)
lr
:=
d
.
Core
V1
()
.
LimitRanges
(
namespace
)
limitRange
,
err
:=
lr
.
Get
(
name
,
metav1
.
GetOptions
{})
limitRange
,
err
:=
lr
.
Get
(
name
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -549,7 +549,7 @@ type ResourceQuotaDescriber struct {
...
@@ -549,7 +549,7 @@ type ResourceQuotaDescriber struct {
}
}
func
(
d
*
ResourceQuotaDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
func
(
d
*
ResourceQuotaDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
rq
:=
d
.
Core
()
.
ResourceQuotas
(
namespace
)
rq
:=
d
.
Core
V1
()
.
ResourceQuotas
(
namespace
)
resourceQuota
,
err
:=
rq
.
Get
(
name
,
metav1
.
GetOptions
{})
resourceQuota
,
err
:=
rq
.
Get
(
name
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -619,10 +619,10 @@ type PodDescriber struct {
...
@@ -619,10 +619,10 @@ type PodDescriber struct {
}
}
func
(
d
*
PodDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
func
(
d
*
PodDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
pod
,
err
:=
d
.
Core
()
.
Pods
(
namespace
)
.
Get
(
name
,
metav1
.
GetOptions
{})
pod
,
err
:=
d
.
Core
V1
()
.
Pods
(
namespace
)
.
Get
(
name
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
if
describerSettings
.
ShowEvents
{
if
describerSettings
.
ShowEvents
{
eventsInterface
:=
d
.
Core
()
.
Events
(
namespace
)
eventsInterface
:=
d
.
Core
V1
()
.
Events
(
namespace
)
selector
:=
eventsInterface
.
GetFieldSelector
(
&
name
,
&
namespace
,
nil
,
nil
)
selector
:=
eventsInterface
.
GetFieldSelector
(
&
name
,
&
namespace
,
nil
,
nil
)
options
:=
metav1
.
ListOptions
{
FieldSelector
:
selector
.
String
()}
options
:=
metav1
.
ListOptions
{
FieldSelector
:
selector
.
String
()}
events
,
err2
:=
eventsInterface
.
List
(
options
)
events
,
err2
:=
eventsInterface
.
List
(
options
)
...
@@ -647,7 +647,7 @@ func (d *PodDescriber) Describe(namespace, name string, describerSettings descri
...
@@ -647,7 +647,7 @@ func (d *PodDescriber) Describe(namespace, name string, describerSettings descri
if
_
,
isMirrorPod
:=
pod
.
Annotations
[
corev1
.
MirrorPodAnnotationKey
];
isMirrorPod
{
if
_
,
isMirrorPod
:=
pod
.
Annotations
[
corev1
.
MirrorPodAnnotationKey
];
isMirrorPod
{
ref
.
UID
=
types
.
UID
(
pod
.
Annotations
[
corev1
.
MirrorPodAnnotationKey
])
ref
.
UID
=
types
.
UID
(
pod
.
Annotations
[
corev1
.
MirrorPodAnnotationKey
])
}
}
events
,
_
=
d
.
Core
()
.
Events
(
namespace
)
.
Search
(
scheme
.
Scheme
,
ref
)
events
,
_
=
d
.
Core
V1
()
.
Events
(
namespace
)
.
Search
(
scheme
.
Scheme
,
ref
)
}
}
}
}
...
@@ -1263,7 +1263,7 @@ type PersistentVolumeDescriber struct {
...
@@ -1263,7 +1263,7 @@ type PersistentVolumeDescriber struct {
}
}
func
(
d
*
PersistentVolumeDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
func
(
d
*
PersistentVolumeDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
c
:=
d
.
Core
()
.
PersistentVolumes
()
c
:=
d
.
Core
V1
()
.
PersistentVolumes
()
pv
,
err
:=
c
.
Get
(
name
,
metav1
.
GetOptions
{})
pv
,
err
:=
c
.
Get
(
name
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -1272,7 +1272,7 @@ func (d *PersistentVolumeDescriber) Describe(namespace, name string, describerSe
...
@@ -1272,7 +1272,7 @@ func (d *PersistentVolumeDescriber) Describe(namespace, name string, describerSe
var
events
*
corev1
.
EventList
var
events
*
corev1
.
EventList
if
describerSettings
.
ShowEvents
{
if
describerSettings
.
ShowEvents
{
events
,
_
=
d
.
Core
()
.
Events
(
namespace
)
.
Search
(
scheme
.
Scheme
,
pv
)
events
,
_
=
d
.
Core
V1
()
.
Events
(
namespace
)
.
Search
(
scheme
.
Scheme
,
pv
)
}
}
return
describePersistentVolume
(
pv
,
events
)
return
describePersistentVolume
(
pv
,
events
)
...
@@ -1411,21 +1411,21 @@ type PersistentVolumeClaimDescriber struct {
...
@@ -1411,21 +1411,21 @@ type PersistentVolumeClaimDescriber struct {
}
}
func
(
d
*
PersistentVolumeClaimDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
func
(
d
*
PersistentVolumeClaimDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
c
:=
d
.
Core
()
.
PersistentVolumeClaims
(
namespace
)
c
:=
d
.
Core
V1
()
.
PersistentVolumeClaims
(
namespace
)
pvc
,
err
:=
c
.
Get
(
name
,
metav1
.
GetOptions
{})
pvc
,
err
:=
c
.
Get
(
name
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
return
""
,
err
return
""
,
err
}
}
pc
:=
d
.
Core
()
.
Pods
(
namespace
)
pc
:=
d
.
Core
V1
()
.
Pods
(
namespace
)
mountPods
,
err
:=
getMountPods
(
pc
,
pvc
.
Name
)
mountPods
,
err
:=
getMountPods
(
pc
,
pvc
.
Name
)
if
err
!=
nil
{
if
err
!=
nil
{
return
""
,
err
return
""
,
err
}
}
events
,
_
:=
d
.
Core
()
.
Events
(
namespace
)
.
Search
(
scheme
.
Scheme
,
pvc
)
events
,
_
:=
d
.
Core
V1
()
.
Events
(
namespace
)
.
Search
(
scheme
.
Scheme
,
pvc
)
return
describePersistentVolumeClaim
(
pvc
,
events
,
mountPods
)
return
describePersistentVolumeClaim
(
pvc
,
events
,
mountPods
)
}
}
...
@@ -1872,8 +1872,8 @@ type ReplicationControllerDescriber struct {
...
@@ -1872,8 +1872,8 @@ type ReplicationControllerDescriber struct {
}
}
func
(
d
*
ReplicationControllerDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
func
(
d
*
ReplicationControllerDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
rc
:=
d
.
Core
()
.
ReplicationControllers
(
namespace
)
rc
:=
d
.
Core
V1
()
.
ReplicationControllers
(
namespace
)
pc
:=
d
.
Core
()
.
Pods
(
namespace
)
pc
:=
d
.
Core
V1
()
.
Pods
(
namespace
)
controller
,
err
:=
rc
.
Get
(
name
,
metav1
.
GetOptions
{})
controller
,
err
:=
rc
.
Get
(
name
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -1887,7 +1887,7 @@ func (d *ReplicationControllerDescriber) Describe(namespace, name string, descri
...
@@ -1887,7 +1887,7 @@ func (d *ReplicationControllerDescriber) Describe(namespace, name string, descri
var
events
*
corev1
.
EventList
var
events
*
corev1
.
EventList
if
describerSettings
.
ShowEvents
{
if
describerSettings
.
ShowEvents
{
events
,
_
=
d
.
Core
()
.
Events
(
namespace
)
.
Search
(
scheme
.
Scheme
,
controller
)
events
,
_
=
d
.
Core
V1
()
.
Events
(
namespace
)
.
Search
(
scheme
.
Scheme
,
controller
)
}
}
return
describeReplicationController
(
controller
,
events
,
running
,
waiting
,
succeeded
,
failed
)
return
describeReplicationController
(
controller
,
events
,
running
,
waiting
,
succeeded
,
failed
)
...
@@ -1944,8 +1944,8 @@ type ReplicaSetDescriber struct {
...
@@ -1944,8 +1944,8 @@ type ReplicaSetDescriber struct {
}
}
func
(
d
*
ReplicaSetDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
func
(
d
*
ReplicaSetDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
rsc
:=
d
.
Apps
()
.
ReplicaSets
(
namespace
)
rsc
:=
d
.
Apps
V1
()
.
ReplicaSets
(
namespace
)
pc
:=
d
.
Core
()
.
Pods
(
namespace
)
pc
:=
d
.
Core
V1
()
.
Pods
(
namespace
)
rs
,
err
:=
rsc
.
Get
(
name
,
metav1
.
GetOptions
{})
rs
,
err
:=
rsc
.
Get
(
name
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -1961,7 +1961,7 @@ func (d *ReplicaSetDescriber) Describe(namespace, name string, describerSettings
...
@@ -1961,7 +1961,7 @@ func (d *ReplicaSetDescriber) Describe(namespace, name string, describerSettings
var
events
*
corev1
.
EventList
var
events
*
corev1
.
EventList
if
describerSettings
.
ShowEvents
{
if
describerSettings
.
ShowEvents
{
events
,
_
=
d
.
Core
()
.
Events
(
namespace
)
.
Search
(
scheme
.
Scheme
,
rs
)
events
,
_
=
d
.
Core
V1
()
.
Events
(
namespace
)
.
Search
(
scheme
.
Scheme
,
rs
)
}
}
return
describeReplicaSet
(
rs
,
events
,
running
,
waiting
,
succeeded
,
failed
,
getPodErr
)
return
describeReplicaSet
(
rs
,
events
,
running
,
waiting
,
succeeded
,
failed
,
getPodErr
)
...
@@ -2006,14 +2006,14 @@ type JobDescriber struct {
...
@@ -2006,14 +2006,14 @@ type JobDescriber struct {
}
}
func
(
d
*
JobDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
func
(
d
*
JobDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
job
,
err
:=
d
.
Batch
()
.
Jobs
(
namespace
)
.
Get
(
name
,
metav1
.
GetOptions
{})
job
,
err
:=
d
.
Batch
V1
()
.
Jobs
(
namespace
)
.
Get
(
name
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
return
""
,
err
return
""
,
err
}
}
var
events
*
corev1
.
EventList
var
events
*
corev1
.
EventList
if
describerSettings
.
ShowEvents
{
if
describerSettings
.
ShowEvents
{
events
,
_
=
d
.
Core
()
.
Events
(
namespace
)
.
Search
(
scheme
.
Scheme
,
job
)
events
,
_
=
d
.
Core
V1
()
.
Events
(
namespace
)
.
Search
(
scheme
.
Scheme
,
job
)
}
}
return
describeJob
(
job
,
events
)
return
describeJob
(
job
,
events
)
...
@@ -2160,8 +2160,8 @@ type DaemonSetDescriber struct {
...
@@ -2160,8 +2160,8 @@ type DaemonSetDescriber struct {
}
}
func
(
d
*
DaemonSetDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
func
(
d
*
DaemonSetDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
dc
:=
d
.
Apps
()
.
DaemonSets
(
namespace
)
dc
:=
d
.
Apps
V1
()
.
DaemonSets
(
namespace
)
pc
:=
d
.
Core
()
.
Pods
(
namespace
)
pc
:=
d
.
Core
V1
()
.
Pods
(
namespace
)
daemon
,
err
:=
dc
.
Get
(
name
,
metav1
.
GetOptions
{})
daemon
,
err
:=
dc
.
Get
(
name
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -2179,7 +2179,7 @@ func (d *DaemonSetDescriber) Describe(namespace, name string, describerSettings
...
@@ -2179,7 +2179,7 @@ func (d *DaemonSetDescriber) Describe(namespace, name string, describerSettings
var
events
*
corev1
.
EventList
var
events
*
corev1
.
EventList
if
describerSettings
.
ShowEvents
{
if
describerSettings
.
ShowEvents
{
events
,
_
=
d
.
Core
()
.
Events
(
namespace
)
.
Search
(
scheme
.
Scheme
,
daemon
)
events
,
_
=
d
.
Core
V1
()
.
Events
(
namespace
)
.
Search
(
scheme
.
Scheme
,
daemon
)
}
}
return
describeDaemonSet
(
daemon
,
events
,
running
,
waiting
,
succeeded
,
failed
)
return
describeDaemonSet
(
daemon
,
events
,
running
,
waiting
,
succeeded
,
failed
)
...
@@ -2218,7 +2218,7 @@ type SecretDescriber struct {
...
@@ -2218,7 +2218,7 @@ type SecretDescriber struct {
}
}
func
(
d
*
SecretDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
func
(
d
*
SecretDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
c
:=
d
.
Core
()
.
Secrets
(
namespace
)
c
:=
d
.
Core
V1
()
.
Secrets
(
namespace
)
secret
,
err
:=
c
.
Get
(
name
,
metav1
.
GetOptions
{})
secret
,
err
:=
c
.
Get
(
name
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -2258,7 +2258,7 @@ type IngressDescriber struct {
...
@@ -2258,7 +2258,7 @@ type IngressDescriber struct {
}
}
func
(
i
*
IngressDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
func
(
i
*
IngressDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
c
:=
i
.
Extensions
()
.
Ingresses
(
namespace
)
c
:=
i
.
Extensions
V1beta1
()
.
Ingresses
(
namespace
)
ing
,
err
:=
c
.
Get
(
name
,
metav1
.
GetOptions
{})
ing
,
err
:=
c
.
Get
(
name
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
return
""
,
err
return
""
,
err
...
@@ -2267,8 +2267,8 @@ func (i *IngressDescriber) Describe(namespace, name string, describerSettings de
...
@@ -2267,8 +2267,8 @@ func (i *IngressDescriber) Describe(namespace, name string, describerSettings de
}
}
func
(
i
*
IngressDescriber
)
describeBackend
(
ns
string
,
backend
*
extensionsv1beta1
.
IngressBackend
)
string
{
func
(
i
*
IngressDescriber
)
describeBackend
(
ns
string
,
backend
*
extensionsv1beta1
.
IngressBackend
)
string
{
endpoints
,
_
:=
i
.
Core
()
.
Endpoints
(
ns
)
.
Get
(
backend
.
ServiceName
,
metav1
.
GetOptions
{})
endpoints
,
_
:=
i
.
Core
V1
()
.
Endpoints
(
ns
)
.
Get
(
backend
.
ServiceName
,
metav1
.
GetOptions
{})
service
,
_
:=
i
.
Core
()
.
Services
(
ns
)
.
Get
(
backend
.
ServiceName
,
metav1
.
GetOptions
{})
service
,
_
:=
i
.
Core
V1
()
.
Services
(
ns
)
.
Get
(
backend
.
ServiceName
,
metav1
.
GetOptions
{})
spName
:=
""
spName
:=
""
for
i
:=
range
service
.
Spec
.
Ports
{
for
i
:=
range
service
.
Spec
.
Ports
{
sp
:=
&
service
.
Spec
.
Ports
[
i
]
sp
:=
&
service
.
Spec
.
Ports
[
i
]
...
@@ -2330,7 +2330,7 @@ func (i *IngressDescriber) describeIngress(ing *extensionsv1beta1.Ingress, descr
...
@@ -2330,7 +2330,7 @@ func (i *IngressDescriber) describeIngress(ing *extensionsv1beta1.Ingress, descr
describeIngressAnnotations
(
w
,
ing
.
Annotations
)
describeIngressAnnotations
(
w
,
ing
.
Annotations
)
if
describerSettings
.
ShowEvents
{
if
describerSettings
.
ShowEvents
{
events
,
_
:=
i
.
Core
()
.
Events
(
ing
.
Namespace
)
.
Search
(
scheme
.
Scheme
,
ing
)
events
,
_
:=
i
.
Core
V1
()
.
Events
(
ing
.
Namespace
)
.
Search
(
scheme
.
Scheme
,
ing
)
if
events
!=
nil
{
if
events
!=
nil
{
DescribeEvents
(
events
,
w
)
DescribeEvents
(
events
,
w
)
}
}
...
@@ -2366,17 +2366,17 @@ type ServiceDescriber struct {
...
@@ -2366,17 +2366,17 @@ type ServiceDescriber struct {
}
}
func
(
d
*
ServiceDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
func
(
d
*
ServiceDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
c
:=
d
.
Core
()
.
Services
(
namespace
)
c
:=
d
.
Core
V1
()
.
Services
(
namespace
)
service
,
err
:=
c
.
Get
(
name
,
metav1
.
GetOptions
{})
service
,
err
:=
c
.
Get
(
name
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
return
""
,
err
return
""
,
err
}
}
endpoints
,
_
:=
d
.
Core
()
.
Endpoints
(
namespace
)
.
Get
(
name
,
metav1
.
GetOptions
{})
endpoints
,
_
:=
d
.
Core
V1
()
.
Endpoints
(
namespace
)
.
Get
(
name
,
metav1
.
GetOptions
{})
var
events
*
corev1
.
EventList
var
events
*
corev1
.
EventList
if
describerSettings
.
ShowEvents
{
if
describerSettings
.
ShowEvents
{
events
,
_
=
d
.
Core
()
.
Events
(
namespace
)
.
Search
(
scheme
.
Scheme
,
service
)
events
,
_
=
d
.
Core
V1
()
.
Events
(
namespace
)
.
Search
(
scheme
.
Scheme
,
service
)
}
}
return
describeService
(
service
,
endpoints
,
events
)
return
describeService
(
service
,
endpoints
,
events
)
}
}
...
@@ -2464,7 +2464,7 @@ type EndpointsDescriber struct {
...
@@ -2464,7 +2464,7 @@ type EndpointsDescriber struct {
}
}
func
(
d
*
EndpointsDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
func
(
d
*
EndpointsDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
c
:=
d
.
Core
()
.
Endpoints
(
namespace
)
c
:=
d
.
Core
V1
()
.
Endpoints
(
namespace
)
ep
,
err
:=
c
.
Get
(
name
,
metav1
.
GetOptions
{})
ep
,
err
:=
c
.
Get
(
name
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -2473,7 +2473,7 @@ func (d *EndpointsDescriber) Describe(namespace, name string, describerSettings
...
@@ -2473,7 +2473,7 @@ func (d *EndpointsDescriber) Describe(namespace, name string, describerSettings
var
events
*
corev1
.
EventList
var
events
*
corev1
.
EventList
if
describerSettings
.
ShowEvents
{
if
describerSettings
.
ShowEvents
{
events
,
_
=
d
.
Core
()
.
Events
(
namespace
)
.
Search
(
scheme
.
Scheme
,
ep
)
events
,
_
=
d
.
Core
V1
()
.
Events
(
namespace
)
.
Search
(
scheme
.
Scheme
,
ep
)
}
}
return
describeEndpoints
(
ep
,
events
)
return
describeEndpoints
(
ep
,
events
)
...
@@ -2539,7 +2539,7 @@ type ServiceAccountDescriber struct {
...
@@ -2539,7 +2539,7 @@ type ServiceAccountDescriber struct {
}
}
func
(
d
*
ServiceAccountDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
func
(
d
*
ServiceAccountDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
c
:=
d
.
Core
()
.
ServiceAccounts
(
namespace
)
c
:=
d
.
Core
V1
()
.
ServiceAccounts
(
namespace
)
serviceAccount
,
err
:=
c
.
Get
(
name
,
metav1
.
GetOptions
{})
serviceAccount
,
err
:=
c
.
Get
(
name
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -2551,7 +2551,7 @@ func (d *ServiceAccountDescriber) Describe(namespace, name string, describerSett
...
@@ -2551,7 +2551,7 @@ func (d *ServiceAccountDescriber) Describe(namespace, name string, describerSett
// missingSecrets is the set of all secrets present in the
// missingSecrets is the set of all secrets present in the
// serviceAccount but not present in the set of existing secrets.
// serviceAccount but not present in the set of existing secrets.
missingSecrets
:=
sets
.
NewString
()
missingSecrets
:=
sets
.
NewString
()
secrets
,
err
:=
d
.
Core
()
.
Secrets
(
namespace
)
.
List
(
metav1
.
ListOptions
{})
secrets
,
err
:=
d
.
Core
V1
()
.
Secrets
(
namespace
)
.
List
(
metav1
.
ListOptions
{})
// errors are tolerated here in order to describe the serviceAccount with all
// errors are tolerated here in order to describe the serviceAccount with all
// of the secrets that it references, even if those secrets cannot be fetched.
// of the secrets that it references, even if those secrets cannot be fetched.
...
@@ -2585,7 +2585,7 @@ func (d *ServiceAccountDescriber) Describe(namespace, name string, describerSett
...
@@ -2585,7 +2585,7 @@ func (d *ServiceAccountDescriber) Describe(namespace, name string, describerSett
var
events
*
corev1
.
EventList
var
events
*
corev1
.
EventList
if
describerSettings
.
ShowEvents
{
if
describerSettings
.
ShowEvents
{
events
,
_
=
d
.
Core
()
.
Events
(
namespace
)
.
Search
(
scheme
.
Scheme
,
serviceAccount
)
events
,
_
=
d
.
Core
V1
()
.
Events
(
namespace
)
.
Search
(
scheme
.
Scheme
,
serviceAccount
)
}
}
return
describeServiceAccount
(
serviceAccount
,
tokens
,
missingSecrets
,
events
)
return
describeServiceAccount
(
serviceAccount
,
tokens
,
missingSecrets
,
events
)
...
@@ -2656,7 +2656,7 @@ type RoleDescriber struct {
...
@@ -2656,7 +2656,7 @@ type RoleDescriber struct {
}
}
func
(
d
*
RoleDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
func
(
d
*
RoleDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
role
,
err
:=
d
.
Rbac
()
.
Roles
(
namespace
)
.
Get
(
name
,
metav1
.
GetOptions
{})
role
,
err
:=
d
.
Rbac
V1
()
.
Roles
(
namespace
)
.
Get
(
name
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
return
""
,
err
return
""
,
err
}
}
...
@@ -2695,7 +2695,7 @@ type ClusterRoleDescriber struct {
...
@@ -2695,7 +2695,7 @@ type ClusterRoleDescriber struct {
}
}
func
(
d
*
ClusterRoleDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
func
(
d
*
ClusterRoleDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
role
,
err
:=
d
.
Rbac
()
.
ClusterRoles
()
.
Get
(
name
,
metav1
.
GetOptions
{})
role
,
err
:=
d
.
Rbac
V1
()
.
ClusterRoles
()
.
Get
(
name
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
return
""
,
err
return
""
,
err
}
}
...
@@ -2751,7 +2751,7 @@ type RoleBindingDescriber struct {
...
@@ -2751,7 +2751,7 @@ type RoleBindingDescriber struct {
}
}
func
(
d
*
RoleBindingDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
func
(
d
*
RoleBindingDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
binding
,
err
:=
d
.
Rbac
()
.
RoleBindings
(
namespace
)
.
Get
(
name
,
metav1
.
GetOptions
{})
binding
,
err
:=
d
.
Rbac
V1
()
.
RoleBindings
(
namespace
)
.
Get
(
name
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
return
""
,
err
return
""
,
err
}
}
...
@@ -2783,7 +2783,7 @@ type ClusterRoleBindingDescriber struct {
...
@@ -2783,7 +2783,7 @@ type ClusterRoleBindingDescriber struct {
}
}
func
(
d
*
ClusterRoleBindingDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
func
(
d
*
ClusterRoleBindingDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
binding
,
err
:=
d
.
Rbac
()
.
ClusterRoleBindings
()
.
Get
(
name
,
metav1
.
GetOptions
{})
binding
,
err
:=
d
.
Rbac
V1
()
.
ClusterRoleBindings
()
.
Get
(
name
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
return
""
,
err
return
""
,
err
}
}
...
@@ -2815,7 +2815,7 @@ type NodeDescriber struct {
...
@@ -2815,7 +2815,7 @@ type NodeDescriber struct {
}
}
func
(
d
*
NodeDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
func
(
d
*
NodeDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
mc
:=
d
.
Core
()
.
Nodes
()
mc
:=
d
.
Core
V1
()
.
Nodes
()
node
,
err
:=
mc
.
Get
(
name
,
metav1
.
GetOptions
{})
node
,
err
:=
mc
.
Get
(
name
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
return
""
,
err
return
""
,
err
...
@@ -2828,7 +2828,7 @@ func (d *NodeDescriber) Describe(namespace, name string, describerSettings descr
...
@@ -2828,7 +2828,7 @@ func (d *NodeDescriber) Describe(namespace, name string, describerSettings descr
// in a policy aware setting, users may have access to a node, but not all pods
// in a policy aware setting, users may have access to a node, but not all pods
// in that case, we note that the user does not have access to the pods
// in that case, we note that the user does not have access to the pods
canViewPods
:=
true
canViewPods
:=
true
nodeNonTerminatedPodsList
,
err
:=
d
.
Core
()
.
Pods
(
namespace
)
.
List
(
metav1
.
ListOptions
{
FieldSelector
:
fieldSelector
.
String
()})
nodeNonTerminatedPodsList
,
err
:=
d
.
Core
V1
()
.
Pods
(
namespace
)
.
List
(
metav1
.
ListOptions
{
FieldSelector
:
fieldSelector
.
String
()})
if
err
!=
nil
{
if
err
!=
nil
{
if
!
errors
.
IsForbidden
(
err
)
{
if
!
errors
.
IsForbidden
(
err
)
{
return
""
,
err
return
""
,
err
...
@@ -2843,7 +2843,7 @@ func (d *NodeDescriber) Describe(namespace, name string, describerSettings descr
...
@@ -2843,7 +2843,7 @@ func (d *NodeDescriber) Describe(namespace, name string, describerSettings descr
}
else
{
}
else
{
// TODO: We haven't decided the namespace for Node object yet.
// TODO: We haven't decided the namespace for Node object yet.
ref
.
UID
=
types
.
UID
(
ref
.
Name
)
ref
.
UID
=
types
.
UID
(
ref
.
Name
)
events
,
_
=
d
.
Core
()
.
Events
(
""
)
.
Search
(
scheme
.
Scheme
,
ref
)
events
,
_
=
d
.
Core
V1
()
.
Events
(
""
)
.
Search
(
scheme
.
Scheme
,
ref
)
}
}
}
}
...
@@ -2939,11 +2939,11 @@ type StatefulSetDescriber struct {
...
@@ -2939,11 +2939,11 @@ type StatefulSetDescriber struct {
}
}
func
(
p
*
StatefulSetDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
func
(
p
*
StatefulSetDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
ps
,
err
:=
p
.
client
.
Apps
()
.
StatefulSets
(
namespace
)
.
Get
(
name
,
metav1
.
GetOptions
{})
ps
,
err
:=
p
.
client
.
Apps
V1
()
.
StatefulSets
(
namespace
)
.
Get
(
name
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
return
""
,
err
return
""
,
err
}
}
pc
:=
p
.
client
.
Core
()
.
Pods
(
namespace
)
pc
:=
p
.
client
.
Core
V1
()
.
Pods
(
namespace
)
selector
,
err
:=
metav1
.
LabelSelectorAsSelector
(
ps
.
Spec
.
Selector
)
selector
,
err
:=
metav1
.
LabelSelectorAsSelector
(
ps
.
Spec
.
Selector
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -2957,7 +2957,7 @@ func (p *StatefulSetDescriber) Describe(namespace, name string, describerSetting
...
@@ -2957,7 +2957,7 @@ func (p *StatefulSetDescriber) Describe(namespace, name string, describerSetting
var
events
*
corev1
.
EventList
var
events
*
corev1
.
EventList
if
describerSettings
.
ShowEvents
{
if
describerSettings
.
ShowEvents
{
events
,
_
=
p
.
client
.
Core
()
.
Events
(
namespace
)
.
Search
(
scheme
.
Scheme
,
ps
)
events
,
_
=
p
.
client
.
Core
V1
()
.
Events
(
namespace
)
.
Search
(
scheme
.
Scheme
,
ps
)
}
}
return
describeStatefulSet
(
ps
,
selector
,
events
,
running
,
waiting
,
succeeded
,
failed
)
return
describeStatefulSet
(
ps
,
selector
,
events
,
running
,
waiting
,
succeeded
,
failed
)
...
@@ -2997,7 +2997,7 @@ type CertificateSigningRequestDescriber struct {
...
@@ -2997,7 +2997,7 @@ type CertificateSigningRequestDescriber struct {
}
}
func
(
p
*
CertificateSigningRequestDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
func
(
p
*
CertificateSigningRequestDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
csr
,
err
:=
p
.
client
.
Certificates
()
.
CertificateSigningRequests
()
.
Get
(
name
,
metav1
.
GetOptions
{})
csr
,
err
:=
p
.
client
.
Certificates
V1beta1
()
.
CertificateSigningRequests
()
.
Get
(
name
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
return
""
,
err
return
""
,
err
}
}
...
@@ -3013,7 +3013,7 @@ func (p *CertificateSigningRequestDescriber) Describe(namespace, name string, de
...
@@ -3013,7 +3013,7 @@ func (p *CertificateSigningRequestDescriber) Describe(namespace, name string, de
var
events
*
corev1
.
EventList
var
events
*
corev1
.
EventList
if
describerSettings
.
ShowEvents
{
if
describerSettings
.
ShowEvents
{
events
,
_
=
p
.
client
.
Core
()
.
Events
(
namespace
)
.
Search
(
scheme
.
Scheme
,
csr
)
events
,
_
=
p
.
client
.
Core
V1
()
.
Events
(
namespace
)
.
Search
(
scheme
.
Scheme
,
csr
)
}
}
return
describeCertificateSigningRequest
(
csr
,
cr
,
status
,
events
)
return
describeCertificateSigningRequest
(
csr
,
cr
,
status
,
events
)
...
@@ -3081,7 +3081,7 @@ func (d *HorizontalPodAutoscalerDescriber) Describe(namespace, name string, desc
...
@@ -3081,7 +3081,7 @@ func (d *HorizontalPodAutoscalerDescriber) Describe(namespace, name string, desc
var
events
*
corev1
.
EventList
var
events
*
corev1
.
EventList
if
describerSettings
.
ShowEvents
{
if
describerSettings
.
ShowEvents
{
events
,
_
=
d
.
client
.
Core
()
.
Events
(
namespace
)
.
Search
(
scheme
.
Scheme
,
hpa
)
events
,
_
=
d
.
client
.
Core
V1
()
.
Events
(
namespace
)
.
Search
(
scheme
.
Scheme
,
hpa
)
}
}
return
describeHorizontalPodAutoscaler
(
hpa
,
events
,
d
)
return
describeHorizontalPodAutoscaler
(
hpa
,
events
,
d
)
...
@@ -3411,7 +3411,7 @@ type ConfigMapDescriber struct {
...
@@ -3411,7 +3411,7 @@ type ConfigMapDescriber struct {
}
}
func
(
d
*
ConfigMapDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
func
(
d
*
ConfigMapDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
c
:=
d
.
Core
()
.
ConfigMaps
(
namespace
)
c
:=
d
.
Core
V1
()
.
ConfigMaps
(
namespace
)
configMap
,
err
:=
c
.
Get
(
name
,
metav1
.
GetOptions
{})
configMap
,
err
:=
c
.
Get
(
name
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -3431,7 +3431,7 @@ func (d *ConfigMapDescriber) Describe(namespace, name string, describerSettings
...
@@ -3431,7 +3431,7 @@ func (d *ConfigMapDescriber) Describe(namespace, name string, describerSettings
w
.
Write
(
LEVEL_0
,
"%s
\n
"
,
string
(
v
))
w
.
Write
(
LEVEL_0
,
"%s
\n
"
,
string
(
v
))
}
}
if
describerSettings
.
ShowEvents
{
if
describerSettings
.
ShowEvents
{
events
,
err
:=
d
.
Core
()
.
Events
(
namespace
)
.
Search
(
scheme
.
Scheme
,
configMap
)
events
,
err
:=
d
.
Core
V1
()
.
Events
(
namespace
)
.
Search
(
scheme
.
Scheme
,
configMap
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
...
@@ -3449,7 +3449,7 @@ type NetworkPolicyDescriber struct {
...
@@ -3449,7 +3449,7 @@ type NetworkPolicyDescriber struct {
}
}
func
(
d
*
NetworkPolicyDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
func
(
d
*
NetworkPolicyDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
c
:=
d
.
Networking
()
.
NetworkPolicies
(
namespace
)
c
:=
d
.
Networking
V1
()
.
NetworkPolicies
(
namespace
)
networkPolicy
,
err
:=
c
.
Get
(
name
,
metav1
.
GetOptions
{})
networkPolicy
,
err
:=
c
.
Get
(
name
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -3580,14 +3580,14 @@ type StorageClassDescriber struct {
...
@@ -3580,14 +3580,14 @@ type StorageClassDescriber struct {
}
}
func
(
s
*
StorageClassDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
func
(
s
*
StorageClassDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
sc
,
err
:=
s
.
Storage
()
.
StorageClasses
()
.
Get
(
name
,
metav1
.
GetOptions
{})
sc
,
err
:=
s
.
Storage
V1
()
.
StorageClasses
()
.
Get
(
name
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
return
""
,
err
return
""
,
err
}
}
var
events
*
corev1
.
EventList
var
events
*
corev1
.
EventList
if
describerSettings
.
ShowEvents
{
if
describerSettings
.
ShowEvents
{
events
,
_
=
s
.
Core
()
.
Events
(
namespace
)
.
Search
(
scheme
.
Scheme
,
sc
)
events
,
_
=
s
.
Core
V1
()
.
Events
(
namespace
)
.
Search
(
scheme
.
Scheme
,
sc
)
}
}
return
describeStorageClass
(
sc
,
events
)
return
describeStorageClass
(
sc
,
events
)
...
@@ -3664,14 +3664,14 @@ type PodDisruptionBudgetDescriber struct {
...
@@ -3664,14 +3664,14 @@ type PodDisruptionBudgetDescriber struct {
}
}
func
(
p
*
PodDisruptionBudgetDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
func
(
p
*
PodDisruptionBudgetDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
pdb
,
err
:=
p
.
Policy
()
.
PodDisruptionBudgets
(
namespace
)
.
Get
(
name
,
metav1
.
GetOptions
{})
pdb
,
err
:=
p
.
Policy
V1beta1
()
.
PodDisruptionBudgets
(
namespace
)
.
Get
(
name
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
return
""
,
err
return
""
,
err
}
}
var
events
*
corev1
.
EventList
var
events
*
corev1
.
EventList
if
describerSettings
.
ShowEvents
{
if
describerSettings
.
ShowEvents
{
events
,
_
=
p
.
Core
()
.
Events
(
namespace
)
.
Search
(
scheme
.
Scheme
,
pdb
)
events
,
_
=
p
.
Core
V1
()
.
Events
(
namespace
)
.
Search
(
scheme
.
Scheme
,
pdb
)
}
}
return
describePodDisruptionBudget
(
pdb
,
events
)
return
describePodDisruptionBudget
(
pdb
,
events
)
...
@@ -3720,7 +3720,7 @@ func (s *PriorityClassDescriber) Describe(namespace, name string, describerSetti
...
@@ -3720,7 +3720,7 @@ func (s *PriorityClassDescriber) Describe(namespace, name string, describerSetti
var
events
*
corev1
.
EventList
var
events
*
corev1
.
EventList
if
describerSettings
.
ShowEvents
{
if
describerSettings
.
ShowEvents
{
events
,
_
=
s
.
Core
()
.
Events
(
namespace
)
.
Search
(
scheme
.
Scheme
,
pc
)
events
,
_
=
s
.
Core
V1
()
.
Events
(
namespace
)
.
Search
(
scheme
.
Scheme
,
pc
)
}
}
return
describePriorityClass
(
pc
,
events
)
return
describePriorityClass
(
pc
,
events
)
...
@@ -3749,7 +3749,7 @@ type PodSecurityPolicyDescriber struct {
...
@@ -3749,7 +3749,7 @@ type PodSecurityPolicyDescriber struct {
}
}
func
(
d
*
PodSecurityPolicyDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
func
(
d
*
PodSecurityPolicyDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
psp
,
err
:=
d
.
Policy
()
.
PodSecurityPolicies
()
.
Get
(
name
,
metav1
.
GetOptions
{})
psp
,
err
:=
d
.
Policy
V1beta1
()
.
PodSecurityPolicies
()
.
Get
(
name
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
return
""
,
err
return
""
,
err
}
}
...
...
pkg/kubectl/drain/cordon.go
View file @
be8a9b96
...
@@ -73,7 +73,7 @@ func (c *CordonHelper) UpdateIfRequired(desired bool) bool {
...
@@ -73,7 +73,7 @@ func (c *CordonHelper) UpdateIfRequired(desired bool) bool {
// JSON, or if either patch or update calls fail; it will also return a second error
// JSON, or if either patch or update calls fail; it will also return a second error
// whenever creating a patch has failed
// whenever creating a patch has failed
func
(
c
*
CordonHelper
)
PatchOrReplace
(
clientset
kubernetes
.
Interface
)
(
error
,
error
)
{
func
(
c
*
CordonHelper
)
PatchOrReplace
(
clientset
kubernetes
.
Interface
)
(
error
,
error
)
{
client
:=
clientset
.
Core
()
.
Nodes
()
client
:=
clientset
.
Core
V1
()
.
Nodes
()
oldData
,
err
:=
json
.
Marshal
(
c
.
node
)
oldData
,
err
:=
json
.
Marshal
(
c
.
node
)
if
err
!=
nil
{
if
err
!=
nil
{
...
...
pkg/kubectl/polymorphichelpers/helpers_test.go
View file @
be8a9b96
...
@@ -174,7 +174,7 @@ func TestGetFirstPod(t *testing.T) {
...
@@ -174,7 +174,7 @@ func TestGetFirstPod(t *testing.T) {
}
}
selector
:=
labels
.
Set
(
labelSet
)
.
AsSelector
()
selector
:=
labels
.
Set
(
labelSet
)
.
AsSelector
()
pod
,
numPods
,
err
:=
GetFirstPod
(
fake
.
Core
(),
metav1
.
NamespaceDefault
,
selector
.
String
(),
1
*
time
.
Minute
,
test
.
sortBy
)
pod
,
numPods
,
err
:=
GetFirstPod
(
fake
.
Core
V1
(),
metav1
.
NamespaceDefault
,
selector
.
String
(),
1
*
time
.
Minute
,
test
.
sortBy
)
pod
.
Spec
.
SecurityContext
=
nil
pod
.
Spec
.
SecurityContext
=
nil
if
!
test
.
expectedErr
&&
err
!=
nil
{
if
!
test
.
expectedErr
&&
err
!=
nil
{
t
.
Errorf
(
"%s: unexpected error: %v"
,
test
.
name
,
err
)
t
.
Errorf
(
"%s: unexpected error: %v"
,
test
.
name
,
err
)
...
...
pkg/kubectl/rolling_updater_test.go
View file @
be8a9b96
...
@@ -903,8 +903,8 @@ func TestUpdate_assignOriginalAnnotation(t *testing.T) {
...
@@ -903,8 +903,8 @@ func TestUpdate_assignOriginalAnnotation(t *testing.T) {
newRc
:=
newRc
(
1
,
1
)
newRc
:=
newRc
(
1
,
1
)
fake
:=
fake
.
NewSimpleClientset
(
oldRc
)
fake
:=
fake
.
NewSimpleClientset
(
oldRc
)
updater
:=
&
RollingUpdater
{
updater
:=
&
RollingUpdater
{
rcClient
:
fake
.
Core
(),
rcClient
:
fake
.
Core
V1
(),
podClient
:
fake
.
Core
(),
podClient
:
fake
.
Core
V1
(),
ns
:
"default"
,
ns
:
"default"
,
scaleAndWait
:
func
(
rc
*
corev1
.
ReplicationController
,
retry
*
RetryParams
,
wait
*
RetryParams
)
(
*
corev1
.
ReplicationController
,
error
)
{
scaleAndWait
:
func
(
rc
*
corev1
.
ReplicationController
,
retry
*
RetryParams
,
wait
*
RetryParams
)
(
*
corev1
.
ReplicationController
,
error
)
{
return
rc
,
nil
return
rc
,
nil
...
@@ -1101,7 +1101,7 @@ func TestRollingUpdater_multipleContainersInPod(t *testing.T) {
...
@@ -1101,7 +1101,7 @@ func TestRollingUpdater_multipleContainersInPod(t *testing.T) {
Container
:
tt
.
container
,
Container
:
tt
.
container
,
DeploymentKey
:
tt
.
deploymentKey
,
DeploymentKey
:
tt
.
deploymentKey
,
}
}
updatedRc
,
err
:=
CreateNewControllerFromCurrentController
(
fake
.
Core
(),
codec
,
config
)
updatedRc
,
err
:=
CreateNewControllerFromCurrentController
(
fake
.
Core
V1
(),
codec
,
config
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Errorf
(
"unexpected error: %v"
,
err
)
t
.
Errorf
(
"unexpected error: %v"
,
err
)
}
}
...
@@ -1177,8 +1177,8 @@ func TestRollingUpdater_cleanupWithClients(t *testing.T) {
...
@@ -1177,8 +1177,8 @@ func TestRollingUpdater_cleanupWithClients(t *testing.T) {
fake
:=
fake
.
NewSimpleClientset
(
objs
...
)
fake
:=
fake
.
NewSimpleClientset
(
objs
...
)
updater
:=
&
RollingUpdater
{
updater
:=
&
RollingUpdater
{
ns
:
"default"
,
ns
:
"default"
,
rcClient
:
fake
.
Core
(),
rcClient
:
fake
.
Core
V1
(),
podClient
:
fake
.
Core
(),
podClient
:
fake
.
Core
V1
(),
}
}
config
:=
&
RollingUpdaterConfig
{
config
:=
&
RollingUpdaterConfig
{
Out
:
ioutil
.
Discard
,
Out
:
ioutil
.
Discard
,
...
@@ -1227,7 +1227,7 @@ func TestRollingUpdater_cleanupWithClients_Rename(t *testing.T) {
...
@@ -1227,7 +1227,7 @@ func TestRollingUpdater_cleanupWithClients_Rename(t *testing.T) {
return
false
,
nil
,
nil
return
false
,
nil
,
nil
})
})
err
:=
Rename
(
fake
.
Core
(),
rcExisting
,
rc
.
Name
)
err
:=
Rename
(
fake
.
Core
V1
(),
rcExisting
,
rc
.
Name
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatal
(
err
)
t
.
Fatal
(
err
)
}
}
...
@@ -1315,7 +1315,7 @@ func TestFindSourceController(t *testing.T) {
...
@@ -1315,7 +1315,7 @@ func TestFindSourceController(t *testing.T) {
for
_
,
tt
:=
range
tests
{
for
_
,
tt
:=
range
tests
{
t
.
Run
(
tt
.
name
,
func
(
t
*
testing
.
T
)
{
t
.
Run
(
tt
.
name
,
func
(
t
*
testing
.
T
)
{
fakeClient
:=
fake
.
NewSimpleClientset
(
tt
.
list
)
fakeClient
:=
fake
.
NewSimpleClientset
(
tt
.
list
)
ctrl
,
err
:=
FindSourceController
(
fakeClient
.
Core
(),
"default"
,
tt
.
name
)
ctrl
,
err
:=
FindSourceController
(
fakeClient
.
Core
V1
(),
"default"
,
tt
.
name
)
if
tt
.
expectError
&&
err
==
nil
{
if
tt
.
expectError
&&
err
==
nil
{
t
.
Errorf
(
"unexpected non-error"
)
t
.
Errorf
(
"unexpected non-error"
)
}
}
...
@@ -1425,7 +1425,7 @@ func TestUpdateExistingReplicationController(t *testing.T) {
...
@@ -1425,7 +1425,7 @@ func TestUpdateExistingReplicationController(t *testing.T) {
t
.
Run
(
tt
.
name
,
func
(
t
*
testing
.
T
)
{
t
.
Run
(
tt
.
name
,
func
(
t
*
testing
.
T
)
{
buffer
:=
&
bytes
.
Buffer
{}
buffer
:=
&
bytes
.
Buffer
{}
fakeClient
:=
fake
.
NewSimpleClientset
(
tt
.
expectedRc
)
fakeClient
:=
fake
.
NewSimpleClientset
(
tt
.
expectedRc
)
rc
,
err
:=
UpdateExistingReplicationController
(
fakeClient
.
Core
(),
fakeClient
.
Core
(),
tt
.
rc
,
"default"
,
tt
.
name
,
tt
.
deploymentKey
,
tt
.
deploymentValue
,
buffer
)
rc
,
err
:=
UpdateExistingReplicationController
(
fakeClient
.
Core
V1
(),
fakeClient
.
CoreV1
(),
tt
.
rc
,
"default"
,
tt
.
name
,
tt
.
deploymentKey
,
tt
.
deploymentValue
,
buffer
)
if
!
reflect
.
DeepEqual
(
rc
,
tt
.
expectedRc
)
{
if
!
reflect
.
DeepEqual
(
rc
,
tt
.
expectedRc
)
{
t
.
Errorf
(
"expected:
\n
%#v
\n
got:
\n
%#v
\n
"
,
tt
.
expectedRc
,
rc
)
t
.
Errorf
(
"expected:
\n
%#v
\n
got:
\n
%#v
\n
"
,
tt
.
expectedRc
,
rc
)
}
}
...
@@ -1832,8 +1832,8 @@ func TestRollingUpdater_readyPods(t *testing.T) {
...
@@ -1832,8 +1832,8 @@ func TestRollingUpdater_readyPods(t *testing.T) {
updater
:=
&
RollingUpdater
{
updater
:=
&
RollingUpdater
{
ns
:
"default"
,
ns
:
"default"
,
rcClient
:
client
.
Core
(),
rcClient
:
client
.
Core
V1
(),
podClient
:
client
.
Core
(),
podClient
:
client
.
Core
V1
(),
nowFn
:
tt
.
nowFn
,
nowFn
:
tt
.
nowFn
,
}
}
oldReady
,
newReady
,
err
:=
updater
.
readyPods
(
tt
.
oldRc
,
tt
.
newRc
,
tt
.
minReadySeconds
)
oldReady
,
newReady
,
err
:=
updater
.
readyPods
(
tt
.
oldRc
,
tt
.
newRc
,
tt
.
minReadySeconds
)
...
...
pkg/master/client_ca_hook_test.go
View file @
be8a9b96
...
@@ -215,7 +215,7 @@ func TestWriteClientCAs(t *testing.T) {
...
@@ -215,7 +215,7 @@ func TestWriteClientCAs(t *testing.T) {
for
_
,
test
:=
range
tests
{
for
_
,
test
:=
range
tests
{
t
.
Run
(
test
.
name
,
func
(
t
*
testing
.
T
)
{
t
.
Run
(
test
.
name
,
func
(
t
*
testing
.
T
)
{
client
:=
fake
.
NewSimpleClientset
(
test
.
preexistingObjs
...
)
client
:=
fake
.
NewSimpleClientset
(
test
.
preexistingObjs
...
)
test
.
hook
.
tryToWriteClientCAs
(
client
.
Core
())
test
.
hook
.
tryToWriteClientCAs
(
client
.
Core
V1
())
actualConfigMaps
,
updated
:=
getFinalConfigMaps
(
client
)
actualConfigMaps
,
updated
:=
getFinalConfigMaps
(
client
)
if
!
reflect
.
DeepEqual
(
test
.
expectedConfigMaps
,
actualConfigMaps
)
{
if
!
reflect
.
DeepEqual
(
test
.
expectedConfigMaps
,
actualConfigMaps
)
{
...
...
pkg/master/controller_test.go
View file @
be8a9b96
...
@@ -392,7 +392,7 @@ func TestReconcileEndpoints(t *testing.T) {
...
@@ -392,7 +392,7 @@ func TestReconcileEndpoints(t *testing.T) {
if
test
.
endpoints
!=
nil
{
if
test
.
endpoints
!=
nil
{
fakeClient
=
fake
.
NewSimpleClientset
(
test
.
endpoints
)
fakeClient
=
fake
.
NewSimpleClientset
(
test
.
endpoints
)
}
}
reconciler
:=
reconcilers
.
NewMasterCountEndpointReconciler
(
test
.
additionalMasters
+
1
,
fakeClient
.
Core
())
reconciler
:=
reconcilers
.
NewMasterCountEndpointReconciler
(
test
.
additionalMasters
+
1
,
fakeClient
.
Core
V1
())
err
:=
reconciler
.
ReconcileEndpoints
(
test
.
serviceName
,
net
.
ParseIP
(
test
.
ip
),
test
.
endpointPorts
,
true
)
err
:=
reconciler
.
ReconcileEndpoints
(
test
.
serviceName
,
net
.
ParseIP
(
test
.
ip
),
test
.
endpointPorts
,
true
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Errorf
(
"case %q: unexpected error: %v"
,
test
.
testName
,
err
)
t
.
Errorf
(
"case %q: unexpected error: %v"
,
test
.
testName
,
err
)
...
@@ -510,7 +510,7 @@ func TestReconcileEndpoints(t *testing.T) {
...
@@ -510,7 +510,7 @@ func TestReconcileEndpoints(t *testing.T) {
if
test
.
endpoints
!=
nil
{
if
test
.
endpoints
!=
nil
{
fakeClient
=
fake
.
NewSimpleClientset
(
test
.
endpoints
)
fakeClient
=
fake
.
NewSimpleClientset
(
test
.
endpoints
)
}
}
reconciler
:=
reconcilers
.
NewMasterCountEndpointReconciler
(
test
.
additionalMasters
+
1
,
fakeClient
.
Core
())
reconciler
:=
reconcilers
.
NewMasterCountEndpointReconciler
(
test
.
additionalMasters
+
1
,
fakeClient
.
Core
V1
())
err
:=
reconciler
.
ReconcileEndpoints
(
test
.
serviceName
,
net
.
ParseIP
(
test
.
ip
),
test
.
endpointPorts
,
false
)
err
:=
reconciler
.
ReconcileEndpoints
(
test
.
serviceName
,
net
.
ParseIP
(
test
.
ip
),
test
.
endpointPorts
,
false
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Errorf
(
"case %q: unexpected error: %v"
,
test
.
testName
,
err
)
t
.
Errorf
(
"case %q: unexpected error: %v"
,
test
.
testName
,
err
)
...
@@ -593,7 +593,7 @@ func TestCreateOrUpdateMasterService(t *testing.T) {
...
@@ -593,7 +593,7 @@ func TestCreateOrUpdateMasterService(t *testing.T) {
for
_
,
test
:=
range
create_tests
{
for
_
,
test
:=
range
create_tests
{
master
:=
Controller
{}
master
:=
Controller
{}
fakeClient
:=
fake
.
NewSimpleClientset
()
fakeClient
:=
fake
.
NewSimpleClientset
()
master
.
ServiceClient
=
fakeClient
.
Core
()
master
.
ServiceClient
=
fakeClient
.
Core
V1
()
master
.
CreateOrUpdateMasterServiceIfNeeded
(
test
.
serviceName
,
net
.
ParseIP
(
"1.2.3.4"
),
test
.
servicePorts
,
test
.
serviceType
,
false
)
master
.
CreateOrUpdateMasterServiceIfNeeded
(
test
.
serviceName
,
net
.
ParseIP
(
"1.2.3.4"
),
test
.
servicePorts
,
test
.
serviceType
,
false
)
creates
:=
[]
core
.
CreateAction
{}
creates
:=
[]
core
.
CreateAction
{}
for
_
,
action
:=
range
fakeClient
.
Actions
()
{
for
_
,
action
:=
range
fakeClient
.
Actions
()
{
...
@@ -875,7 +875,7 @@ func TestCreateOrUpdateMasterService(t *testing.T) {
...
@@ -875,7 +875,7 @@ func TestCreateOrUpdateMasterService(t *testing.T) {
for
_
,
test
:=
range
reconcile_tests
{
for
_
,
test
:=
range
reconcile_tests
{
master
:=
Controller
{}
master
:=
Controller
{}
fakeClient
:=
fake
.
NewSimpleClientset
(
test
.
service
)
fakeClient
:=
fake
.
NewSimpleClientset
(
test
.
service
)
master
.
ServiceClient
=
fakeClient
.
Core
()
master
.
ServiceClient
=
fakeClient
.
Core
V1
()
err
:=
master
.
CreateOrUpdateMasterServiceIfNeeded
(
test
.
serviceName
,
net
.
ParseIP
(
"1.2.3.4"
),
test
.
servicePorts
,
test
.
serviceType
,
true
)
err
:=
master
.
CreateOrUpdateMasterServiceIfNeeded
(
test
.
serviceName
,
net
.
ParseIP
(
"1.2.3.4"
),
test
.
servicePorts
,
test
.
serviceType
,
true
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Errorf
(
"case %q: unexpected error: %v"
,
test
.
testName
,
err
)
t
.
Errorf
(
"case %q: unexpected error: %v"
,
test
.
testName
,
err
)
...
@@ -934,7 +934,7 @@ func TestCreateOrUpdateMasterService(t *testing.T) {
...
@@ -934,7 +934,7 @@ func TestCreateOrUpdateMasterService(t *testing.T) {
for
_
,
test
:=
range
non_reconcile_tests
{
for
_
,
test
:=
range
non_reconcile_tests
{
master
:=
Controller
{}
master
:=
Controller
{}
fakeClient
:=
fake
.
NewSimpleClientset
(
test
.
service
)
fakeClient
:=
fake
.
NewSimpleClientset
(
test
.
service
)
master
.
ServiceClient
=
fakeClient
.
Core
()
master
.
ServiceClient
=
fakeClient
.
Core
V1
()
err
:=
master
.
CreateOrUpdateMasterServiceIfNeeded
(
test
.
serviceName
,
net
.
ParseIP
(
"1.2.3.4"
),
test
.
servicePorts
,
test
.
serviceType
,
false
)
err
:=
master
.
CreateOrUpdateMasterServiceIfNeeded
(
test
.
serviceName
,
net
.
ParseIP
(
"1.2.3.4"
),
test
.
servicePorts
,
test
.
serviceType
,
false
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Errorf
(
"case %q: unexpected error: %v"
,
test
.
testName
,
err
)
t
.
Errorf
(
"case %q: unexpected error: %v"
,
test
.
testName
,
err
)
...
...
pkg/master/master_test.go
View file @
be8a9b96
...
@@ -237,7 +237,7 @@ func makeNodeList(nodes []string, nodeResources apiv1.NodeResources) *apiv1.Node
...
@@ -237,7 +237,7 @@ func makeNodeList(nodes []string, nodeResources apiv1.NodeResources) *apiv1.Node
func
TestGetNodeAddresses
(
t
*
testing
.
T
)
{
func
TestGetNodeAddresses
(
t
*
testing
.
T
)
{
assert
:=
assert
.
New
(
t
)
assert
:=
assert
.
New
(
t
)
fakeNodeClient
:=
fake
.
NewSimpleClientset
(
makeNodeList
([]
string
{
"node1"
,
"node2"
},
apiv1
.
NodeResources
{}))
.
Core
()
.
Nodes
()
fakeNodeClient
:=
fake
.
NewSimpleClientset
(
makeNodeList
([]
string
{
"node1"
,
"node2"
},
apiv1
.
NodeResources
{}))
.
Core
V1
()
.
Nodes
()
addressProvider
:=
nodeAddressProvider
{
fakeNodeClient
}
addressProvider
:=
nodeAddressProvider
{
fakeNodeClient
}
// Fail case (no addresses associated with nodes)
// Fail case (no addresses associated with nodes)
...
@@ -261,7 +261,7 @@ func TestGetNodeAddresses(t *testing.T) {
...
@@ -261,7 +261,7 @@ func TestGetNodeAddresses(t *testing.T) {
func
TestGetNodeAddressesWithOnlySomeExternalIP
(
t
*
testing
.
T
)
{
func
TestGetNodeAddressesWithOnlySomeExternalIP
(
t
*
testing
.
T
)
{
assert
:=
assert
.
New
(
t
)
assert
:=
assert
.
New
(
t
)
fakeNodeClient
:=
fake
.
NewSimpleClientset
(
makeNodeList
([]
string
{
"node1"
,
"node2"
,
"node3"
},
apiv1
.
NodeResources
{}))
.
Core
()
.
Nodes
()
fakeNodeClient
:=
fake
.
NewSimpleClientset
(
makeNodeList
([]
string
{
"node1"
,
"node2"
,
"node3"
},
apiv1
.
NodeResources
{}))
.
Core
V1
()
.
Nodes
()
addressProvider
:=
nodeAddressProvider
{
fakeNodeClient
}
addressProvider
:=
nodeAddressProvider
{
fakeNodeClient
}
// Pass case with 1 External type IP (index == 1) and nodes (indexes 0 & 2) have no External IP.
// Pass case with 1 External type IP (index == 1) and nodes (indexes 0 & 2) have no External IP.
...
...
pkg/registry/core/service/ipallocator/controller/repair_test.go
View file @
be8a9b96
...
@@ -56,7 +56,7 @@ func TestRepair(t *testing.T) {
...
@@ -56,7 +56,7 @@ func TestRepair(t *testing.T) {
item
:
&
api
.
RangeAllocation
{
Range
:
"192.168.1.0/24"
},
item
:
&
api
.
RangeAllocation
{
Range
:
"192.168.1.0/24"
},
}
}
_
,
cidr
,
_
:=
net
.
ParseCIDR
(
ipregistry
.
item
.
Range
)
_
,
cidr
,
_
:=
net
.
ParseCIDR
(
ipregistry
.
item
.
Range
)
r
:=
NewRepair
(
0
,
fakeClient
.
Core
(),
fakeClient
.
Core
(),
cidr
,
ipregistry
)
r
:=
NewRepair
(
0
,
fakeClient
.
Core
V1
(),
fakeClient
.
CoreV1
(),
cidr
,
ipregistry
)
if
err
:=
r
.
RunOnce
();
err
!=
nil
{
if
err
:=
r
.
RunOnce
();
err
!=
nil
{
t
.
Fatal
(
err
)
t
.
Fatal
(
err
)
...
@@ -69,7 +69,7 @@ func TestRepair(t *testing.T) {
...
@@ -69,7 +69,7 @@ func TestRepair(t *testing.T) {
item
:
&
api
.
RangeAllocation
{
Range
:
"192.168.1.0/24"
},
item
:
&
api
.
RangeAllocation
{
Range
:
"192.168.1.0/24"
},
updateErr
:
fmt
.
Errorf
(
"test error"
),
updateErr
:
fmt
.
Errorf
(
"test error"
),
}
}
r
=
NewRepair
(
0
,
fakeClient
.
Core
(),
fakeClient
.
Core
(),
cidr
,
ipregistry
)
r
=
NewRepair
(
0
,
fakeClient
.
Core
V1
(),
fakeClient
.
CoreV1
(),
cidr
,
ipregistry
)
if
err
:=
r
.
RunOnce
();
!
strings
.
Contains
(
err
.
Error
(),
": test error"
)
{
if
err
:=
r
.
RunOnce
();
!
strings
.
Contains
(
err
.
Error
(),
": test error"
)
{
t
.
Fatal
(
err
)
t
.
Fatal
(
err
)
}
}
...
@@ -97,7 +97,7 @@ func TestRepairLeak(t *testing.T) {
...
@@ -97,7 +97,7 @@ func TestRepairLeak(t *testing.T) {
},
},
}
}
r
:=
NewRepair
(
0
,
fakeClient
.
Core
(),
fakeClient
.
Core
(),
cidr
,
ipregistry
)
r
:=
NewRepair
(
0
,
fakeClient
.
Core
V1
(),
fakeClient
.
CoreV1
(),
cidr
,
ipregistry
)
// Run through the "leak detection holdoff" loops.
// Run through the "leak detection holdoff" loops.
for
i
:=
0
;
i
<
(
numRepairsBeforeLeakCleanup
-
1
);
i
++
{
for
i
:=
0
;
i
<
(
numRepairsBeforeLeakCleanup
-
1
);
i
++
{
if
err
:=
r
.
RunOnce
();
err
!=
nil
{
if
err
:=
r
.
RunOnce
();
err
!=
nil
{
...
@@ -170,7 +170,7 @@ func TestRepairWithExisting(t *testing.T) {
...
@@ -170,7 +170,7 @@ func TestRepairWithExisting(t *testing.T) {
Data
:
dst
.
Data
,
Data
:
dst
.
Data
,
},
},
}
}
r
:=
NewRepair
(
0
,
fakeClient
.
Core
(),
fakeClient
.
Core
(),
cidr
,
ipregistry
)
r
:=
NewRepair
(
0
,
fakeClient
.
Core
V1
(),
fakeClient
.
CoreV1
(),
cidr
,
ipregistry
)
if
err
:=
r
.
RunOnce
();
err
!=
nil
{
if
err
:=
r
.
RunOnce
();
err
!=
nil
{
t
.
Fatal
(
err
)
t
.
Fatal
(
err
)
}
}
...
...
pkg/registry/core/service/portallocator/controller/repair_test.go
View file @
be8a9b96
...
@@ -56,7 +56,7 @@ func TestRepair(t *testing.T) {
...
@@ -56,7 +56,7 @@ func TestRepair(t *testing.T) {
item
:
&
api
.
RangeAllocation
{
Range
:
"100-200"
},
item
:
&
api
.
RangeAllocation
{
Range
:
"100-200"
},
}
}
pr
,
_
:=
net
.
ParsePortRange
(
registry
.
item
.
Range
)
pr
,
_
:=
net
.
ParsePortRange
(
registry
.
item
.
Range
)
r
:=
NewRepair
(
0
,
fakeClient
.
Core
(),
fakeClient
.
Core
(),
*
pr
,
registry
)
r
:=
NewRepair
(
0
,
fakeClient
.
Core
V1
(),
fakeClient
.
CoreV1
(),
*
pr
,
registry
)
if
err
:=
r
.
RunOnce
();
err
!=
nil
{
if
err
:=
r
.
RunOnce
();
err
!=
nil
{
t
.
Fatal
(
err
)
t
.
Fatal
(
err
)
...
@@ -69,7 +69,7 @@ func TestRepair(t *testing.T) {
...
@@ -69,7 +69,7 @@ func TestRepair(t *testing.T) {
item
:
&
api
.
RangeAllocation
{
Range
:
"100-200"
},
item
:
&
api
.
RangeAllocation
{
Range
:
"100-200"
},
updateErr
:
fmt
.
Errorf
(
"test error"
),
updateErr
:
fmt
.
Errorf
(
"test error"
),
}
}
r
=
NewRepair
(
0
,
fakeClient
.
Core
(),
fakeClient
.
Core
(),
*
pr
,
registry
)
r
=
NewRepair
(
0
,
fakeClient
.
Core
V1
(),
fakeClient
.
CoreV1
(),
*
pr
,
registry
)
if
err
:=
r
.
RunOnce
();
!
strings
.
Contains
(
err
.
Error
(),
": test error"
)
{
if
err
:=
r
.
RunOnce
();
!
strings
.
Contains
(
err
.
Error
(),
": test error"
)
{
t
.
Fatal
(
err
)
t
.
Fatal
(
err
)
}
}
...
@@ -97,7 +97,7 @@ func TestRepairLeak(t *testing.T) {
...
@@ -97,7 +97,7 @@ func TestRepairLeak(t *testing.T) {
},
},
}
}
r
:=
NewRepair
(
0
,
fakeClient
.
Core
(),
fakeClient
.
Core
(),
*
pr
,
registry
)
r
:=
NewRepair
(
0
,
fakeClient
.
Core
V1
(),
fakeClient
.
CoreV1
(),
*
pr
,
registry
)
// Run through the "leak detection holdoff" loops.
// Run through the "leak detection holdoff" loops.
for
i
:=
0
;
i
<
(
numRepairsBeforeLeakCleanup
-
1
);
i
++
{
for
i
:=
0
;
i
<
(
numRepairsBeforeLeakCleanup
-
1
);
i
++
{
if
err
:=
r
.
RunOnce
();
err
!=
nil
{
if
err
:=
r
.
RunOnce
();
err
!=
nil
{
...
@@ -182,7 +182,7 @@ func TestRepairWithExisting(t *testing.T) {
...
@@ -182,7 +182,7 @@ func TestRepairWithExisting(t *testing.T) {
Data
:
dst
.
Data
,
Data
:
dst
.
Data
,
},
},
}
}
r
:=
NewRepair
(
0
,
fakeClient
.
Core
(),
fakeClient
.
Core
(),
*
pr
,
registry
)
r
:=
NewRepair
(
0
,
fakeClient
.
Core
V1
(),
fakeClient
.
CoreV1
(),
*
pr
,
registry
)
if
err
:=
r
.
RunOnce
();
err
!=
nil
{
if
err
:=
r
.
RunOnce
();
err
!=
nil
{
t
.
Fatal
(
err
)
t
.
Fatal
(
err
)
}
}
...
...
pkg/volume/csi/nodeinfomanager/nodeinfomanager_test.go
View file @
be8a9b96
...
@@ -605,7 +605,7 @@ func TestInstallCSIDriverExistingAnnotation(t *testing.T) {
...
@@ -605,7 +605,7 @@ func TestInstallCSIDriverExistingAnnotation(t *testing.T) {
}
}
// Assert
// Assert
nodeInfo
,
err
:=
csiClient
.
Csi
()
.
CSINodeInfos
()
.
Get
(
nodeName
,
metav1
.
GetOptions
{})
nodeInfo
,
err
:=
csiClient
.
Csi
V1alpha1
()
.
CSINodeInfos
()
.
Get
(
nodeName
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Errorf
(
"error getting CSINodeInfo: %v"
,
err
)
t
.
Errorf
(
"error getting CSINodeInfo: %v"
,
err
)
continue
continue
...
@@ -1018,7 +1018,7 @@ func test(t *testing.T, addNodeInfo bool, csiNodeInfoEnabled bool, testcases []t
...
@@ -1018,7 +1018,7 @@ func test(t *testing.T, addNodeInfo bool, csiNodeInfoEnabled bool, testcases []t
}
}
/* CSINodeInfo validation */
/* CSINodeInfo validation */
nodeInfo
,
err
:=
csiClient
.
Csi
()
.
CSINodeInfos
()
.
Get
(
nodeName
,
metav1
.
GetOptions
{})
nodeInfo
,
err
:=
csiClient
.
Csi
V1alpha1
()
.
CSINodeInfos
()
.
Get
(
nodeName
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Errorf
(
"error getting CSINodeInfo: %v"
,
err
)
t
.
Errorf
(
"error getting CSINodeInfo: %v"
,
err
)
continue
continue
...
...
pkg/volume/glusterfs/glusterfs.go
View file @
be8a9b96
...
@@ -153,7 +153,7 @@ func (plugin *glusterfsPlugin) NewMounter(spec *volume.Spec, pod *v1.Pod, _ volu
...
@@ -153,7 +153,7 @@ func (plugin *glusterfsPlugin) NewMounter(spec *volume.Spec, pod *v1.Pod, _ volu
if
kubeClient
==
nil
{
if
kubeClient
==
nil
{
return
nil
,
fmt
.
Errorf
(
"failed to get kube client to initialize mounter"
)
return
nil
,
fmt
.
Errorf
(
"failed to get kube client to initialize mounter"
)
}
}
ep
,
err
:=
kubeClient
.
Core
()
.
Endpoints
(
epNamespace
)
.
Get
(
epName
,
metav1
.
GetOptions
{})
ep
,
err
:=
kubeClient
.
Core
V1
()
.
Endpoints
(
epNamespace
)
.
Get
(
epName
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
klog
.
Errorf
(
"failed to get endpoint %s: %v"
,
epName
,
err
)
klog
.
Errorf
(
"failed to get endpoint %s: %v"
,
epName
,
err
)
...
...
pkg/volume/rbd/rbd.go
View file @
be8a9b96
...
@@ -472,7 +472,7 @@ func (plugin *rbdPlugin) NewBlockVolumeMapper(spec *volume.Spec, pod *v1.Pod, _
...
@@ -472,7 +472,7 @@ func (plugin *rbdPlugin) NewBlockVolumeMapper(spec *volume.Spec, pod *v1.Pod, _
if
kubeClient
==
nil
{
if
kubeClient
==
nil
{
return
nil
,
fmt
.
Errorf
(
"Cannot get kube client"
)
return
nil
,
fmt
.
Errorf
(
"Cannot get kube client"
)
}
}
secrets
,
err
:=
kubeClient
.
Core
()
.
Secrets
(
secretNs
)
.
Get
(
secretName
,
metav1
.
GetOptions
{})
secrets
,
err
:=
kubeClient
.
Core
V1
()
.
Secrets
(
secretNs
)
.
Get
(
secretName
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
err
=
fmt
.
Errorf
(
"Couldn't get secret %v/%v err: %v"
,
secretNs
,
secretName
,
err
)
err
=
fmt
.
Errorf
(
"Couldn't get secret %v/%v err: %v"
,
secretNs
,
secretName
,
err
)
return
nil
,
err
return
nil
,
err
...
...
pkg/volume/storageos/storageos_test.go
View file @
be8a9b96
...
@@ -171,7 +171,7 @@ func TestPlugin(t *testing.T) {
...
@@ -171,7 +171,7 @@ func TestPlugin(t *testing.T) {
client
:=
fake
.
NewSimpleClientset
()
client
:=
fake
.
NewSimpleClientset
()
client
.
Core
()
.
Secrets
(
"default"
)
.
Create
(
&
v1
.
Secret
{
client
.
Core
V1
()
.
Secrets
(
"default"
)
.
Create
(
&
v1
.
Secret
{
ObjectMeta
:
metav1
.
ObjectMeta
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
secretName
,
Name
:
secretName
,
Namespace
:
"default"
,
Namespace
:
"default"
,
...
...
plugin/pkg/admission/namespace/autoprovision/admission.go
View file @
be8a9b96
...
@@ -89,7 +89,7 @@ func (p *Provision) Admit(a admission.Attributes, o admission.ObjectInterfaces)
...
@@ -89,7 +89,7 @@ func (p *Provision) Admit(a admission.Attributes, o admission.ObjectInterfaces)
Status
:
corev1
.
NamespaceStatus
{},
Status
:
corev1
.
NamespaceStatus
{},
}
}
_
,
err
=
p
.
client
.
Core
()
.
Namespaces
()
.
Create
(
namespace
)
_
,
err
=
p
.
client
.
Core
V1
()
.
Namespaces
()
.
Create
(
namespace
)
if
err
!=
nil
&&
!
errors
.
IsAlreadyExists
(
err
)
{
if
err
!=
nil
&&
!
errors
.
IsAlreadyExists
(
err
)
{
return
admission
.
NewForbidden
(
a
,
err
)
return
admission
.
NewForbidden
(
a
,
err
)
}
}
...
...
plugin/pkg/admission/namespace/exists/admission.go
View file @
be8a9b96
...
@@ -75,7 +75,7 @@ func (e *Exists) Validate(a admission.Attributes, o admission.ObjectInterfaces)
...
@@ -75,7 +75,7 @@ func (e *Exists) Validate(a admission.Attributes, o admission.ObjectInterfaces)
}
}
// in case of latency in our caches, make a call direct to storage to verify that it truly exists or not
// in case of latency in our caches, make a call direct to storage to verify that it truly exists or not
_
,
err
=
e
.
client
.
Core
()
.
Namespaces
()
.
Get
(
a
.
GetNamespace
(),
metav1
.
GetOptions
{})
_
,
err
=
e
.
client
.
Core
V1
()
.
Namespaces
()
.
Get
(
a
.
GetNamespace
(),
metav1
.
GetOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
if
errors
.
IsNotFound
(
err
)
{
if
errors
.
IsNotFound
(
err
)
{
return
err
return
err
...
...
plugin/pkg/admission/podnodeselector/admission.go
View file @
be8a9b96
...
@@ -216,7 +216,7 @@ func (p *podNodeSelector) ValidateInitialization() error {
...
@@ -216,7 +216,7 @@ func (p *podNodeSelector) ValidateInitialization() error {
}
}
func
(
p
*
podNodeSelector
)
defaultGetNamespace
(
name
string
)
(
*
corev1
.
Namespace
,
error
)
{
func
(
p
*
podNodeSelector
)
defaultGetNamespace
(
name
string
)
(
*
corev1
.
Namespace
,
error
)
{
namespace
,
err
:=
p
.
client
.
Core
()
.
Namespaces
()
.
Get
(
name
,
metav1
.
GetOptions
{})
namespace
,
err
:=
p
.
client
.
Core
V1
()
.
Namespaces
()
.
Get
(
name
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"namespace %s does not exist"
,
name
)
return
nil
,
fmt
.
Errorf
(
"namespace %s does not exist"
,
name
)
}
}
...
...
plugin/pkg/admission/resourcequota/resource_access.go
View file @
be8a9b96
...
@@ -125,7 +125,7 @@ func (e *quotaAccessor) GetQuotas(namespace string) ([]corev1.ResourceQuota, err
...
@@ -125,7 +125,7 @@ func (e *quotaAccessor) GetQuotas(namespace string) ([]corev1.ResourceQuota, err
// If there is already in-flight List() for a given namespace, we should wait until
// If there is already in-flight List() for a given namespace, we should wait until
// it is finished and cache is updated instead of doing the same, also to avoid
// it is finished and cache is updated instead of doing the same, also to avoid
// throttling - see #22422 for details.
// throttling - see #22422 for details.
liveList
,
err
:=
e
.
client
.
Core
()
.
ResourceQuotas
(
namespace
)
.
List
(
metav1
.
ListOptions
{})
liveList
,
err
:=
e
.
client
.
Core
V1
()
.
ResourceQuotas
(
namespace
)
.
List
(
metav1
.
ListOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
...
...
plugin/pkg/admission/serviceaccount/admission.go
View file @
be8a9b96
...
@@ -304,7 +304,7 @@ func (s *serviceAccount) getServiceAccount(namespace string, name string) (*core
...
@@ -304,7 +304,7 @@ func (s *serviceAccount) getServiceAccount(namespace string, name string) (*core
if
i
!=
0
{
if
i
!=
0
{
time
.
Sleep
(
retryInterval
)
time
.
Sleep
(
retryInterval
)
}
}
serviceAccount
,
err
:=
s
.
client
.
Core
()
.
ServiceAccounts
(
namespace
)
.
Get
(
name
,
metav1
.
GetOptions
{})
serviceAccount
,
err
:=
s
.
client
.
Core
V1
()
.
ServiceAccounts
(
namespace
)
.
Get
(
name
,
metav1
.
GetOptions
{})
if
err
==
nil
{
if
err
==
nil
{
return
serviceAccount
,
nil
return
serviceAccount
,
nil
}
}
...
...
staging/src/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/clientset.go
View file @
be8a9b96
...
@@ -28,8 +28,6 @@ import (
...
@@ -28,8 +28,6 @@ import (
type
Interface
interface
{
type
Interface
interface
{
Discovery
()
discovery
.
DiscoveryInterface
Discovery
()
discovery
.
DiscoveryInterface
CrV1
()
crv1
.
CrV1Interface
CrV1
()
crv1
.
CrV1Interface
// Deprecated: please explicitly pick a version if possible.
Cr
()
crv1
.
CrV1Interface
}
}
// Clientset contains the clients for groups. Each group has exactly one
// Clientset contains the clients for groups. Each group has exactly one
...
@@ -44,12 +42,6 @@ func (c *Clientset) CrV1() crv1.CrV1Interface {
...
@@ -44,12 +42,6 @@ func (c *Clientset) CrV1() crv1.CrV1Interface {
return
c
.
crV1
return
c
.
crV1
}
}
// Deprecated: Cr retrieves the default version of CrClient.
// Please explicitly pick a version.
func
(
c
*
Clientset
)
Cr
()
crv1
.
CrV1Interface
{
return
c
.
crV1
}
// Discovery retrieves the DiscoveryClient
// Discovery retrieves the DiscoveryClient
func
(
c
*
Clientset
)
Discovery
()
discovery
.
DiscoveryInterface
{
func
(
c
*
Clientset
)
Discovery
()
discovery
.
DiscoveryInterface
{
if
c
==
nil
{
if
c
==
nil
{
...
...
staging/src/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/fake/clientset_generated.go
View file @
be8a9b96
...
@@ -75,8 +75,3 @@ var _ clientset.Interface = &Clientset{}
...
@@ -75,8 +75,3 @@ var _ clientset.Interface = &Clientset{}
func
(
c
*
Clientset
)
CrV1
()
crv1
.
CrV1Interface
{
func
(
c
*
Clientset
)
CrV1
()
crv1
.
CrV1Interface
{
return
&
fakecrv1
.
FakeCrV1
{
Fake
:
&
c
.
Fake
}
return
&
fakecrv1
.
FakeCrV1
{
Fake
:
&
c
.
Fake
}
}
}
// Cr retrieves the CrV1Client
func
(
c
*
Clientset
)
Cr
()
crv1
.
CrV1Interface
{
return
&
fakecrv1
.
FakeCrV1
{
Fake
:
&
c
.
Fake
}
}
staging/src/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/clientset.go
View file @
be8a9b96
...
@@ -28,8 +28,6 @@ import (
...
@@ -28,8 +28,6 @@ import (
type
Interface
interface
{
type
Interface
interface
{
Discovery
()
discovery
.
DiscoveryInterface
Discovery
()
discovery
.
DiscoveryInterface
ApiextensionsV1beta1
()
apiextensionsv1beta1
.
ApiextensionsV1beta1Interface
ApiextensionsV1beta1
()
apiextensionsv1beta1
.
ApiextensionsV1beta1Interface
// Deprecated: please explicitly pick a version if possible.
Apiextensions
()
apiextensionsv1beta1
.
ApiextensionsV1beta1Interface
}
}
// Clientset contains the clients for groups. Each group has exactly one
// Clientset contains the clients for groups. Each group has exactly one
...
@@ -44,12 +42,6 @@ func (c *Clientset) ApiextensionsV1beta1() apiextensionsv1beta1.ApiextensionsV1b
...
@@ -44,12 +42,6 @@ func (c *Clientset) ApiextensionsV1beta1() apiextensionsv1beta1.ApiextensionsV1b
return
c
.
apiextensionsV1beta1
return
c
.
apiextensionsV1beta1
}
}
// Deprecated: Apiextensions retrieves the default version of ApiextensionsClient.
// Please explicitly pick a version.
func
(
c
*
Clientset
)
Apiextensions
()
apiextensionsv1beta1
.
ApiextensionsV1beta1Interface
{
return
c
.
apiextensionsV1beta1
}
// Discovery retrieves the DiscoveryClient
// Discovery retrieves the DiscoveryClient
func
(
c
*
Clientset
)
Discovery
()
discovery
.
DiscoveryInterface
{
func
(
c
*
Clientset
)
Discovery
()
discovery
.
DiscoveryInterface
{
if
c
==
nil
{
if
c
==
nil
{
...
...
staging/src/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/fake/clientset_generated.go
View file @
be8a9b96
...
@@ -75,8 +75,3 @@ var _ clientset.Interface = &Clientset{}
...
@@ -75,8 +75,3 @@ var _ clientset.Interface = &Clientset{}
func
(
c
*
Clientset
)
ApiextensionsV1beta1
()
apiextensionsv1beta1
.
ApiextensionsV1beta1Interface
{
func
(
c
*
Clientset
)
ApiextensionsV1beta1
()
apiextensionsv1beta1
.
ApiextensionsV1beta1Interface
{
return
&
fakeapiextensionsv1beta1
.
FakeApiextensionsV1beta1
{
Fake
:
&
c
.
Fake
}
return
&
fakeapiextensionsv1beta1
.
FakeApiextensionsV1beta1
{
Fake
:
&
c
.
Fake
}
}
}
// Apiextensions retrieves the ApiextensionsV1beta1Client
func
(
c
*
Clientset
)
Apiextensions
()
apiextensionsv1beta1
.
ApiextensionsV1beta1Interface
{
return
&
fakeapiextensionsv1beta1
.
FakeApiextensionsV1beta1
{
Fake
:
&
c
.
Fake
}
}
staging/src/k8s.io/apiextensions-apiserver/test/integration/fixtures/resources.go
View file @
be8a9b96
...
@@ -355,7 +355,7 @@ func isWatchCachePrimed(crd *apiextensionsv1beta1.CustomResourceDefinition, dyna
...
@@ -355,7 +355,7 @@ func isWatchCachePrimed(crd *apiextensionsv1beta1.CustomResourceDefinition, dyna
// DeleteCustomResourceDefinition deletes a CRD and waits until it disappears from discovery.
// DeleteCustomResourceDefinition deletes a CRD and waits until it disappears from discovery.
func
DeleteCustomResourceDefinition
(
crd
*
apiextensionsv1beta1
.
CustomResourceDefinition
,
apiExtensionsClient
clientset
.
Interface
)
error
{
func
DeleteCustomResourceDefinition
(
crd
*
apiextensionsv1beta1
.
CustomResourceDefinition
,
apiExtensionsClient
clientset
.
Interface
)
error
{
if
err
:=
apiExtensionsClient
.
Apiextensions
()
.
CustomResourceDefinitions
()
.
Delete
(
crd
.
Name
,
nil
);
err
!=
nil
{
if
err
:=
apiExtensionsClient
.
Apiextensions
V1beta1
()
.
CustomResourceDefinitions
()
.
Delete
(
crd
.
Name
,
nil
);
err
!=
nil
{
return
err
return
err
}
}
for
_
,
version
:=
range
servedVersions
(
crd
)
{
for
_
,
version
:=
range
servedVersions
(
crd
)
{
...
...
staging/src/k8s.io/client-go/examples/fake-client/main_test.go
View file @
be8a9b96
...
@@ -61,7 +61,7 @@ func TestFakeClient(t *testing.T) {
...
@@ -61,7 +61,7 @@ func TestFakeClient(t *testing.T) {
// Inject an event into the fake client.
// Inject an event into the fake client.
p
:=
&
v1
.
Pod
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
"my-pod"
}}
p
:=
&
v1
.
Pod
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
"my-pod"
}}
_
,
err
:=
client
.
Core
()
.
Pods
(
"test-ns"
)
.
Create
(
p
)
_
,
err
:=
client
.
Core
V1
()
.
Pods
(
"test-ns"
)
.
Create
(
p
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Errorf
(
"error injecting pod add: %v"
,
err
)
t
.
Errorf
(
"error injecting pod add: %v"
,
err
)
}
}
...
...
staging/src/k8s.io/client-go/kubernetes/clientset.go
View file @
be8a9b96
...
@@ -61,74 +61,38 @@ import (
...
@@ -61,74 +61,38 @@ import (
type
Interface
interface
{
type
Interface
interface
{
Discovery
()
discovery
.
DiscoveryInterface
Discovery
()
discovery
.
DiscoveryInterface
AdmissionregistrationV1beta1
()
admissionregistrationv1beta1
.
AdmissionregistrationV1beta1Interface
AdmissionregistrationV1beta1
()
admissionregistrationv1beta1
.
AdmissionregistrationV1beta1Interface
// Deprecated: please explicitly pick a version if possible.
Admissionregistration
()
admissionregistrationv1beta1
.
AdmissionregistrationV1beta1Interface
AppsV1
()
appsv1
.
AppsV1Interface
AppsV1
()
appsv1
.
AppsV1Interface
// Deprecated: please explicitly pick a version if possible.
Apps
()
appsv1
.
AppsV1Interface
AppsV1beta1
()
appsv1beta1
.
AppsV1beta1Interface
AppsV1beta1
()
appsv1beta1
.
AppsV1beta1Interface
AppsV1beta2
()
appsv1beta2
.
AppsV1beta2Interface
AppsV1beta2
()
appsv1beta2
.
AppsV1beta2Interface
AuditregistrationV1alpha1
()
auditregistrationv1alpha1
.
AuditregistrationV1alpha1Interface
AuditregistrationV1alpha1
()
auditregistrationv1alpha1
.
AuditregistrationV1alpha1Interface
// Deprecated: please explicitly pick a version if possible.
Auditregistration
()
auditregistrationv1alpha1
.
AuditregistrationV1alpha1Interface
AuthenticationV1
()
authenticationv1
.
AuthenticationV1Interface
AuthenticationV1
()
authenticationv1
.
AuthenticationV1Interface
// Deprecated: please explicitly pick a version if possible.
Authentication
()
authenticationv1
.
AuthenticationV1Interface
AuthenticationV1beta1
()
authenticationv1beta1
.
AuthenticationV1beta1Interface
AuthenticationV1beta1
()
authenticationv1beta1
.
AuthenticationV1beta1Interface
AuthorizationV1
()
authorizationv1
.
AuthorizationV1Interface
AuthorizationV1
()
authorizationv1
.
AuthorizationV1Interface
// Deprecated: please explicitly pick a version if possible.
Authorization
()
authorizationv1
.
AuthorizationV1Interface
AuthorizationV1beta1
()
authorizationv1beta1
.
AuthorizationV1beta1Interface
AuthorizationV1beta1
()
authorizationv1beta1
.
AuthorizationV1beta1Interface
AutoscalingV1
()
autoscalingv1
.
AutoscalingV1Interface
AutoscalingV1
()
autoscalingv1
.
AutoscalingV1Interface
// Deprecated: please explicitly pick a version if possible.
Autoscaling
()
autoscalingv1
.
AutoscalingV1Interface
AutoscalingV2beta1
()
autoscalingv2beta1
.
AutoscalingV2beta1Interface
AutoscalingV2beta1
()
autoscalingv2beta1
.
AutoscalingV2beta1Interface
AutoscalingV2beta2
()
autoscalingv2beta2
.
AutoscalingV2beta2Interface
AutoscalingV2beta2
()
autoscalingv2beta2
.
AutoscalingV2beta2Interface
BatchV1
()
batchv1
.
BatchV1Interface
BatchV1
()
batchv1
.
BatchV1Interface
// Deprecated: please explicitly pick a version if possible.
Batch
()
batchv1
.
BatchV1Interface
BatchV1beta1
()
batchv1beta1
.
BatchV1beta1Interface
BatchV1beta1
()
batchv1beta1
.
BatchV1beta1Interface
BatchV2alpha1
()
batchv2alpha1
.
BatchV2alpha1Interface
BatchV2alpha1
()
batchv2alpha1
.
BatchV2alpha1Interface
CertificatesV1beta1
()
certificatesv1beta1
.
CertificatesV1beta1Interface
CertificatesV1beta1
()
certificatesv1beta1
.
CertificatesV1beta1Interface
// Deprecated: please explicitly pick a version if possible.
Certificates
()
certificatesv1beta1
.
CertificatesV1beta1Interface
CoordinationV1beta1
()
coordinationv1beta1
.
CoordinationV1beta1Interface
CoordinationV1beta1
()
coordinationv1beta1
.
CoordinationV1beta1Interface
CoordinationV1
()
coordinationv1
.
CoordinationV1Interface
CoordinationV1
()
coordinationv1
.
CoordinationV1Interface
// Deprecated: please explicitly pick a version if possible.
Coordination
()
coordinationv1
.
CoordinationV1Interface
CoreV1
()
corev1
.
CoreV1Interface
CoreV1
()
corev1
.
CoreV1Interface
// Deprecated: please explicitly pick a version if possible.
Core
()
corev1
.
CoreV1Interface
EventsV1beta1
()
eventsv1beta1
.
EventsV1beta1Interface
EventsV1beta1
()
eventsv1beta1
.
EventsV1beta1Interface
// Deprecated: please explicitly pick a version if possible.
Events
()
eventsv1beta1
.
EventsV1beta1Interface
ExtensionsV1beta1
()
extensionsv1beta1
.
ExtensionsV1beta1Interface
ExtensionsV1beta1
()
extensionsv1beta1
.
ExtensionsV1beta1Interface
// Deprecated: please explicitly pick a version if possible.
Extensions
()
extensionsv1beta1
.
ExtensionsV1beta1Interface
NetworkingV1
()
networkingv1
.
NetworkingV1Interface
NetworkingV1
()
networkingv1
.
NetworkingV1Interface
// Deprecated: please explicitly pick a version if possible.
Networking
()
networkingv1
.
NetworkingV1Interface
NetworkingV1beta1
()
networkingv1beta1
.
NetworkingV1beta1Interface
NetworkingV1beta1
()
networkingv1beta1
.
NetworkingV1beta1Interface
PolicyV1beta1
()
policyv1beta1
.
PolicyV1beta1Interface
PolicyV1beta1
()
policyv1beta1
.
PolicyV1beta1Interface
// Deprecated: please explicitly pick a version if possible.
Policy
()
policyv1beta1
.
PolicyV1beta1Interface
RbacV1
()
rbacv1
.
RbacV1Interface
RbacV1
()
rbacv1
.
RbacV1Interface
// Deprecated: please explicitly pick a version if possible.
Rbac
()
rbacv1
.
RbacV1Interface
RbacV1beta1
()
rbacv1beta1
.
RbacV1beta1Interface
RbacV1beta1
()
rbacv1beta1
.
RbacV1beta1Interface
RbacV1alpha1
()
rbacv1alpha1
.
RbacV1alpha1Interface
RbacV1alpha1
()
rbacv1alpha1
.
RbacV1alpha1Interface
SchedulingV1alpha1
()
schedulingv1alpha1
.
SchedulingV1alpha1Interface
SchedulingV1alpha1
()
schedulingv1alpha1
.
SchedulingV1alpha1Interface
SchedulingV1beta1
()
schedulingv1beta1
.
SchedulingV1beta1Interface
SchedulingV1beta1
()
schedulingv1beta1
.
SchedulingV1beta1Interface
SchedulingV1
()
schedulingv1
.
SchedulingV1Interface
SchedulingV1
()
schedulingv1
.
SchedulingV1Interface
// Deprecated: please explicitly pick a version if possible.
Scheduling
()
schedulingv1
.
SchedulingV1Interface
SettingsV1alpha1
()
settingsv1alpha1
.
SettingsV1alpha1Interface
SettingsV1alpha1
()
settingsv1alpha1
.
SettingsV1alpha1Interface
// Deprecated: please explicitly pick a version if possible.
Settings
()
settingsv1alpha1
.
SettingsV1alpha1Interface
StorageV1beta1
()
storagev1beta1
.
StorageV1beta1Interface
StorageV1beta1
()
storagev1beta1
.
StorageV1beta1Interface
StorageV1
()
storagev1
.
StorageV1Interface
StorageV1
()
storagev1
.
StorageV1Interface
// Deprecated: please explicitly pick a version if possible.
Storage
()
storagev1
.
StorageV1Interface
StorageV1alpha1
()
storagev1alpha1
.
StorageV1alpha1Interface
StorageV1alpha1
()
storagev1alpha1
.
StorageV1alpha1Interface
}
}
...
@@ -177,23 +141,11 @@ func (c *Clientset) AdmissionregistrationV1beta1() admissionregistrationv1beta1.
...
@@ -177,23 +141,11 @@ func (c *Clientset) AdmissionregistrationV1beta1() admissionregistrationv1beta1.
return
c
.
admissionregistrationV1beta1
return
c
.
admissionregistrationV1beta1
}
}
// Deprecated: Admissionregistration retrieves the default version of AdmissionregistrationClient.
// Please explicitly pick a version.
func
(
c
*
Clientset
)
Admissionregistration
()
admissionregistrationv1beta1
.
AdmissionregistrationV1beta1Interface
{
return
c
.
admissionregistrationV1beta1
}
// AppsV1 retrieves the AppsV1Client
// AppsV1 retrieves the AppsV1Client
func
(
c
*
Clientset
)
AppsV1
()
appsv1
.
AppsV1Interface
{
func
(
c
*
Clientset
)
AppsV1
()
appsv1
.
AppsV1Interface
{
return
c
.
appsV1
return
c
.
appsV1
}
}
// Deprecated: Apps retrieves the default version of AppsClient.
// Please explicitly pick a version.
func
(
c
*
Clientset
)
Apps
()
appsv1
.
AppsV1Interface
{
return
c
.
appsV1
}
// AppsV1beta1 retrieves the AppsV1beta1Client
// AppsV1beta1 retrieves the AppsV1beta1Client
func
(
c
*
Clientset
)
AppsV1beta1
()
appsv1beta1
.
AppsV1beta1Interface
{
func
(
c
*
Clientset
)
AppsV1beta1
()
appsv1beta1
.
AppsV1beta1Interface
{
return
c
.
appsV1beta1
return
c
.
appsV1beta1
...
@@ -209,23 +161,11 @@ func (c *Clientset) AuditregistrationV1alpha1() auditregistrationv1alpha1.Auditr
...
@@ -209,23 +161,11 @@ func (c *Clientset) AuditregistrationV1alpha1() auditregistrationv1alpha1.Auditr
return
c
.
auditregistrationV1alpha1
return
c
.
auditregistrationV1alpha1
}
}
// Deprecated: Auditregistration retrieves the default version of AuditregistrationClient.
// Please explicitly pick a version.
func
(
c
*
Clientset
)
Auditregistration
()
auditregistrationv1alpha1
.
AuditregistrationV1alpha1Interface
{
return
c
.
auditregistrationV1alpha1
}
// AuthenticationV1 retrieves the AuthenticationV1Client
// AuthenticationV1 retrieves the AuthenticationV1Client
func
(
c
*
Clientset
)
AuthenticationV1
()
authenticationv1
.
AuthenticationV1Interface
{
func
(
c
*
Clientset
)
AuthenticationV1
()
authenticationv1
.
AuthenticationV1Interface
{
return
c
.
authenticationV1
return
c
.
authenticationV1
}
}
// Deprecated: Authentication retrieves the default version of AuthenticationClient.
// Please explicitly pick a version.
func
(
c
*
Clientset
)
Authentication
()
authenticationv1
.
AuthenticationV1Interface
{
return
c
.
authenticationV1
}
// AuthenticationV1beta1 retrieves the AuthenticationV1beta1Client
// AuthenticationV1beta1 retrieves the AuthenticationV1beta1Client
func
(
c
*
Clientset
)
AuthenticationV1beta1
()
authenticationv1beta1
.
AuthenticationV1beta1Interface
{
func
(
c
*
Clientset
)
AuthenticationV1beta1
()
authenticationv1beta1
.
AuthenticationV1beta1Interface
{
return
c
.
authenticationV1beta1
return
c
.
authenticationV1beta1
...
@@ -236,12 +176,6 @@ func (c *Clientset) AuthorizationV1() authorizationv1.AuthorizationV1Interface {
...
@@ -236,12 +176,6 @@ func (c *Clientset) AuthorizationV1() authorizationv1.AuthorizationV1Interface {
return
c
.
authorizationV1
return
c
.
authorizationV1
}
}
// Deprecated: Authorization retrieves the default version of AuthorizationClient.
// Please explicitly pick a version.
func
(
c
*
Clientset
)
Authorization
()
authorizationv1
.
AuthorizationV1Interface
{
return
c
.
authorizationV1
}
// AuthorizationV1beta1 retrieves the AuthorizationV1beta1Client
// AuthorizationV1beta1 retrieves the AuthorizationV1beta1Client
func
(
c
*
Clientset
)
AuthorizationV1beta1
()
authorizationv1beta1
.
AuthorizationV1beta1Interface
{
func
(
c
*
Clientset
)
AuthorizationV1beta1
()
authorizationv1beta1
.
AuthorizationV1beta1Interface
{
return
c
.
authorizationV1beta1
return
c
.
authorizationV1beta1
...
@@ -252,12 +186,6 @@ func (c *Clientset) AutoscalingV1() autoscalingv1.AutoscalingV1Interface {
...
@@ -252,12 +186,6 @@ func (c *Clientset) AutoscalingV1() autoscalingv1.AutoscalingV1Interface {
return
c
.
autoscalingV1
return
c
.
autoscalingV1
}
}
// Deprecated: Autoscaling retrieves the default version of AutoscalingClient.
// Please explicitly pick a version.
func
(
c
*
Clientset
)
Autoscaling
()
autoscalingv1
.
AutoscalingV1Interface
{
return
c
.
autoscalingV1
}
// AutoscalingV2beta1 retrieves the AutoscalingV2beta1Client
// AutoscalingV2beta1 retrieves the AutoscalingV2beta1Client
func
(
c
*
Clientset
)
AutoscalingV2beta1
()
autoscalingv2beta1
.
AutoscalingV2beta1Interface
{
func
(
c
*
Clientset
)
AutoscalingV2beta1
()
autoscalingv2beta1
.
AutoscalingV2beta1Interface
{
return
c
.
autoscalingV2beta1
return
c
.
autoscalingV2beta1
...
@@ -273,12 +201,6 @@ func (c *Clientset) BatchV1() batchv1.BatchV1Interface {
...
@@ -273,12 +201,6 @@ func (c *Clientset) BatchV1() batchv1.BatchV1Interface {
return
c
.
batchV1
return
c
.
batchV1
}
}
// Deprecated: Batch retrieves the default version of BatchClient.
// Please explicitly pick a version.
func
(
c
*
Clientset
)
Batch
()
batchv1
.
BatchV1Interface
{
return
c
.
batchV1
}
// BatchV1beta1 retrieves the BatchV1beta1Client
// BatchV1beta1 retrieves the BatchV1beta1Client
func
(
c
*
Clientset
)
BatchV1beta1
()
batchv1beta1
.
BatchV1beta1Interface
{
func
(
c
*
Clientset
)
BatchV1beta1
()
batchv1beta1
.
BatchV1beta1Interface
{
return
c
.
batchV1beta1
return
c
.
batchV1beta1
...
@@ -294,12 +216,6 @@ func (c *Clientset) CertificatesV1beta1() certificatesv1beta1.CertificatesV1beta
...
@@ -294,12 +216,6 @@ func (c *Clientset) CertificatesV1beta1() certificatesv1beta1.CertificatesV1beta
return
c
.
certificatesV1beta1
return
c
.
certificatesV1beta1
}
}
// Deprecated: Certificates retrieves the default version of CertificatesClient.
// Please explicitly pick a version.
func
(
c
*
Clientset
)
Certificates
()
certificatesv1beta1
.
CertificatesV1beta1Interface
{
return
c
.
certificatesV1beta1
}
// CoordinationV1beta1 retrieves the CoordinationV1beta1Client
// CoordinationV1beta1 retrieves the CoordinationV1beta1Client
func
(
c
*
Clientset
)
CoordinationV1beta1
()
coordinationv1beta1
.
CoordinationV1beta1Interface
{
func
(
c
*
Clientset
)
CoordinationV1beta1
()
coordinationv1beta1
.
CoordinationV1beta1Interface
{
return
c
.
coordinationV1beta1
return
c
.
coordinationV1beta1
...
@@ -310,56 +226,26 @@ func (c *Clientset) CoordinationV1() coordinationv1.CoordinationV1Interface {
...
@@ -310,56 +226,26 @@ func (c *Clientset) CoordinationV1() coordinationv1.CoordinationV1Interface {
return
c
.
coordinationV1
return
c
.
coordinationV1
}
}
// Deprecated: Coordination retrieves the default version of CoordinationClient.
// Please explicitly pick a version.
func
(
c
*
Clientset
)
Coordination
()
coordinationv1
.
CoordinationV1Interface
{
return
c
.
coordinationV1
}
// CoreV1 retrieves the CoreV1Client
// CoreV1 retrieves the CoreV1Client
func
(
c
*
Clientset
)
CoreV1
()
corev1
.
CoreV1Interface
{
func
(
c
*
Clientset
)
CoreV1
()
corev1
.
CoreV1Interface
{
return
c
.
coreV1
return
c
.
coreV1
}
}
// Deprecated: Core retrieves the default version of CoreClient.
// Please explicitly pick a version.
func
(
c
*
Clientset
)
Core
()
corev1
.
CoreV1Interface
{
return
c
.
coreV1
}
// EventsV1beta1 retrieves the EventsV1beta1Client
// EventsV1beta1 retrieves the EventsV1beta1Client
func
(
c
*
Clientset
)
EventsV1beta1
()
eventsv1beta1
.
EventsV1beta1Interface
{
func
(
c
*
Clientset
)
EventsV1beta1
()
eventsv1beta1
.
EventsV1beta1Interface
{
return
c
.
eventsV1beta1
return
c
.
eventsV1beta1
}
}
// Deprecated: Events retrieves the default version of EventsClient.
// Please explicitly pick a version.
func
(
c
*
Clientset
)
Events
()
eventsv1beta1
.
EventsV1beta1Interface
{
return
c
.
eventsV1beta1
}
// ExtensionsV1beta1 retrieves the ExtensionsV1beta1Client
// ExtensionsV1beta1 retrieves the ExtensionsV1beta1Client
func
(
c
*
Clientset
)
ExtensionsV1beta1
()
extensionsv1beta1
.
ExtensionsV1beta1Interface
{
func
(
c
*
Clientset
)
ExtensionsV1beta1
()
extensionsv1beta1
.
ExtensionsV1beta1Interface
{
return
c
.
extensionsV1beta1
return
c
.
extensionsV1beta1
}
}
// Deprecated: Extensions retrieves the default version of ExtensionsClient.
// Please explicitly pick a version.
func
(
c
*
Clientset
)
Extensions
()
extensionsv1beta1
.
ExtensionsV1beta1Interface
{
return
c
.
extensionsV1beta1
}
// NetworkingV1 retrieves the NetworkingV1Client
// NetworkingV1 retrieves the NetworkingV1Client
func
(
c
*
Clientset
)
NetworkingV1
()
networkingv1
.
NetworkingV1Interface
{
func
(
c
*
Clientset
)
NetworkingV1
()
networkingv1
.
NetworkingV1Interface
{
return
c
.
networkingV1
return
c
.
networkingV1
}
}
// Deprecated: Networking retrieves the default version of NetworkingClient.
// Please explicitly pick a version.
func
(
c
*
Clientset
)
Networking
()
networkingv1
.
NetworkingV1Interface
{
return
c
.
networkingV1
}
// NetworkingV1beta1 retrieves the NetworkingV1beta1Client
// NetworkingV1beta1 retrieves the NetworkingV1beta1Client
func
(
c
*
Clientset
)
NetworkingV1beta1
()
networkingv1beta1
.
NetworkingV1beta1Interface
{
func
(
c
*
Clientset
)
NetworkingV1beta1
()
networkingv1beta1
.
NetworkingV1beta1Interface
{
return
c
.
networkingV1beta1
return
c
.
networkingV1beta1
...
@@ -370,23 +256,11 @@ func (c *Clientset) PolicyV1beta1() policyv1beta1.PolicyV1beta1Interface {
...
@@ -370,23 +256,11 @@ func (c *Clientset) PolicyV1beta1() policyv1beta1.PolicyV1beta1Interface {
return
c
.
policyV1beta1
return
c
.
policyV1beta1
}
}
// Deprecated: Policy retrieves the default version of PolicyClient.
// Please explicitly pick a version.
func
(
c
*
Clientset
)
Policy
()
policyv1beta1
.
PolicyV1beta1Interface
{
return
c
.
policyV1beta1
}
// RbacV1 retrieves the RbacV1Client
// RbacV1 retrieves the RbacV1Client
func
(
c
*
Clientset
)
RbacV1
()
rbacv1
.
RbacV1Interface
{
func
(
c
*
Clientset
)
RbacV1
()
rbacv1
.
RbacV1Interface
{
return
c
.
rbacV1
return
c
.
rbacV1
}
}
// Deprecated: Rbac retrieves the default version of RbacClient.
// Please explicitly pick a version.
func
(
c
*
Clientset
)
Rbac
()
rbacv1
.
RbacV1Interface
{
return
c
.
rbacV1
}
// RbacV1beta1 retrieves the RbacV1beta1Client
// RbacV1beta1 retrieves the RbacV1beta1Client
func
(
c
*
Clientset
)
RbacV1beta1
()
rbacv1beta1
.
RbacV1beta1Interface
{
func
(
c
*
Clientset
)
RbacV1beta1
()
rbacv1beta1
.
RbacV1beta1Interface
{
return
c
.
rbacV1beta1
return
c
.
rbacV1beta1
...
@@ -412,23 +286,11 @@ func (c *Clientset) SchedulingV1() schedulingv1.SchedulingV1Interface {
...
@@ -412,23 +286,11 @@ func (c *Clientset) SchedulingV1() schedulingv1.SchedulingV1Interface {
return
c
.
schedulingV1
return
c
.
schedulingV1
}
}
// Deprecated: Scheduling retrieves the default version of SchedulingClient.
// Please explicitly pick a version.
func
(
c
*
Clientset
)
Scheduling
()
schedulingv1
.
SchedulingV1Interface
{
return
c
.
schedulingV1
}
// SettingsV1alpha1 retrieves the SettingsV1alpha1Client
// SettingsV1alpha1 retrieves the SettingsV1alpha1Client
func
(
c
*
Clientset
)
SettingsV1alpha1
()
settingsv1alpha1
.
SettingsV1alpha1Interface
{
func
(
c
*
Clientset
)
SettingsV1alpha1
()
settingsv1alpha1
.
SettingsV1alpha1Interface
{
return
c
.
settingsV1alpha1
return
c
.
settingsV1alpha1
}
}
// Deprecated: Settings retrieves the default version of SettingsClient.
// Please explicitly pick a version.
func
(
c
*
Clientset
)
Settings
()
settingsv1alpha1
.
SettingsV1alpha1Interface
{
return
c
.
settingsV1alpha1
}
// StorageV1beta1 retrieves the StorageV1beta1Client
// StorageV1beta1 retrieves the StorageV1beta1Client
func
(
c
*
Clientset
)
StorageV1beta1
()
storagev1beta1
.
StorageV1beta1Interface
{
func
(
c
*
Clientset
)
StorageV1beta1
()
storagev1beta1
.
StorageV1beta1Interface
{
return
c
.
storageV1beta1
return
c
.
storageV1beta1
...
@@ -439,12 +301,6 @@ func (c *Clientset) StorageV1() storagev1.StorageV1Interface {
...
@@ -439,12 +301,6 @@ func (c *Clientset) StorageV1() storagev1.StorageV1Interface {
return
c
.
storageV1
return
c
.
storageV1
}
}
// Deprecated: Storage retrieves the default version of StorageClient.
// Please explicitly pick a version.
func
(
c
*
Clientset
)
Storage
()
storagev1
.
StorageV1Interface
{
return
c
.
storageV1
}
// StorageV1alpha1 retrieves the StorageV1alpha1Client
// StorageV1alpha1 retrieves the StorageV1alpha1Client
func
(
c
*
Clientset
)
StorageV1alpha1
()
storagev1alpha1
.
StorageV1alpha1Interface
{
func
(
c
*
Clientset
)
StorageV1alpha1
()
storagev1alpha1
.
StorageV1alpha1Interface
{
return
c
.
storageV1alpha1
return
c
.
storageV1alpha1
...
...
staging/src/k8s.io/client-go/kubernetes/fake/clientset_generated.go
View file @
be8a9b96
...
@@ -142,21 +142,11 @@ func (c *Clientset) AdmissionregistrationV1beta1() admissionregistrationv1beta1.
...
@@ -142,21 +142,11 @@ func (c *Clientset) AdmissionregistrationV1beta1() admissionregistrationv1beta1.
return
&
fakeadmissionregistrationv1beta1
.
FakeAdmissionregistrationV1beta1
{
Fake
:
&
c
.
Fake
}
return
&
fakeadmissionregistrationv1beta1
.
FakeAdmissionregistrationV1beta1
{
Fake
:
&
c
.
Fake
}
}
}
// Admissionregistration retrieves the AdmissionregistrationV1beta1Client
func
(
c
*
Clientset
)
Admissionregistration
()
admissionregistrationv1beta1
.
AdmissionregistrationV1beta1Interface
{
return
&
fakeadmissionregistrationv1beta1
.
FakeAdmissionregistrationV1beta1
{
Fake
:
&
c
.
Fake
}
}
// AppsV1 retrieves the AppsV1Client
// AppsV1 retrieves the AppsV1Client
func
(
c
*
Clientset
)
AppsV1
()
appsv1
.
AppsV1Interface
{
func
(
c
*
Clientset
)
AppsV1
()
appsv1
.
AppsV1Interface
{
return
&
fakeappsv1
.
FakeAppsV1
{
Fake
:
&
c
.
Fake
}
return
&
fakeappsv1
.
FakeAppsV1
{
Fake
:
&
c
.
Fake
}
}
}
// Apps retrieves the AppsV1Client
func
(
c
*
Clientset
)
Apps
()
appsv1
.
AppsV1Interface
{
return
&
fakeappsv1
.
FakeAppsV1
{
Fake
:
&
c
.
Fake
}
}
// AppsV1beta1 retrieves the AppsV1beta1Client
// AppsV1beta1 retrieves the AppsV1beta1Client
func
(
c
*
Clientset
)
AppsV1beta1
()
appsv1beta1
.
AppsV1beta1Interface
{
func
(
c
*
Clientset
)
AppsV1beta1
()
appsv1beta1
.
AppsV1beta1Interface
{
return
&
fakeappsv1beta1
.
FakeAppsV1beta1
{
Fake
:
&
c
.
Fake
}
return
&
fakeappsv1beta1
.
FakeAppsV1beta1
{
Fake
:
&
c
.
Fake
}
...
@@ -172,21 +162,11 @@ func (c *Clientset) AuditregistrationV1alpha1() auditregistrationv1alpha1.Auditr
...
@@ -172,21 +162,11 @@ func (c *Clientset) AuditregistrationV1alpha1() auditregistrationv1alpha1.Auditr
return
&
fakeauditregistrationv1alpha1
.
FakeAuditregistrationV1alpha1
{
Fake
:
&
c
.
Fake
}
return
&
fakeauditregistrationv1alpha1
.
FakeAuditregistrationV1alpha1
{
Fake
:
&
c
.
Fake
}
}
}
// Auditregistration retrieves the AuditregistrationV1alpha1Client
func
(
c
*
Clientset
)
Auditregistration
()
auditregistrationv1alpha1
.
AuditregistrationV1alpha1Interface
{
return
&
fakeauditregistrationv1alpha1
.
FakeAuditregistrationV1alpha1
{
Fake
:
&
c
.
Fake
}
}
// AuthenticationV1 retrieves the AuthenticationV1Client
// AuthenticationV1 retrieves the AuthenticationV1Client
func
(
c
*
Clientset
)
AuthenticationV1
()
authenticationv1
.
AuthenticationV1Interface
{
func
(
c
*
Clientset
)
AuthenticationV1
()
authenticationv1
.
AuthenticationV1Interface
{
return
&
fakeauthenticationv1
.
FakeAuthenticationV1
{
Fake
:
&
c
.
Fake
}
return
&
fakeauthenticationv1
.
FakeAuthenticationV1
{
Fake
:
&
c
.
Fake
}
}
}
// Authentication retrieves the AuthenticationV1Client
func
(
c
*
Clientset
)
Authentication
()
authenticationv1
.
AuthenticationV1Interface
{
return
&
fakeauthenticationv1
.
FakeAuthenticationV1
{
Fake
:
&
c
.
Fake
}
}
// AuthenticationV1beta1 retrieves the AuthenticationV1beta1Client
// AuthenticationV1beta1 retrieves the AuthenticationV1beta1Client
func
(
c
*
Clientset
)
AuthenticationV1beta1
()
authenticationv1beta1
.
AuthenticationV1beta1Interface
{
func
(
c
*
Clientset
)
AuthenticationV1beta1
()
authenticationv1beta1
.
AuthenticationV1beta1Interface
{
return
&
fakeauthenticationv1beta1
.
FakeAuthenticationV1beta1
{
Fake
:
&
c
.
Fake
}
return
&
fakeauthenticationv1beta1
.
FakeAuthenticationV1beta1
{
Fake
:
&
c
.
Fake
}
...
@@ -197,11 +177,6 @@ func (c *Clientset) AuthorizationV1() authorizationv1.AuthorizationV1Interface {
...
@@ -197,11 +177,6 @@ func (c *Clientset) AuthorizationV1() authorizationv1.AuthorizationV1Interface {
return
&
fakeauthorizationv1
.
FakeAuthorizationV1
{
Fake
:
&
c
.
Fake
}
return
&
fakeauthorizationv1
.
FakeAuthorizationV1
{
Fake
:
&
c
.
Fake
}
}
}
// Authorization retrieves the AuthorizationV1Client
func
(
c
*
Clientset
)
Authorization
()
authorizationv1
.
AuthorizationV1Interface
{
return
&
fakeauthorizationv1
.
FakeAuthorizationV1
{
Fake
:
&
c
.
Fake
}
}
// AuthorizationV1beta1 retrieves the AuthorizationV1beta1Client
// AuthorizationV1beta1 retrieves the AuthorizationV1beta1Client
func
(
c
*
Clientset
)
AuthorizationV1beta1
()
authorizationv1beta1
.
AuthorizationV1beta1Interface
{
func
(
c
*
Clientset
)
AuthorizationV1beta1
()
authorizationv1beta1
.
AuthorizationV1beta1Interface
{
return
&
fakeauthorizationv1beta1
.
FakeAuthorizationV1beta1
{
Fake
:
&
c
.
Fake
}
return
&
fakeauthorizationv1beta1
.
FakeAuthorizationV1beta1
{
Fake
:
&
c
.
Fake
}
...
@@ -212,11 +187,6 @@ func (c *Clientset) AutoscalingV1() autoscalingv1.AutoscalingV1Interface {
...
@@ -212,11 +187,6 @@ func (c *Clientset) AutoscalingV1() autoscalingv1.AutoscalingV1Interface {
return
&
fakeautoscalingv1
.
FakeAutoscalingV1
{
Fake
:
&
c
.
Fake
}
return
&
fakeautoscalingv1
.
FakeAutoscalingV1
{
Fake
:
&
c
.
Fake
}
}
}
// Autoscaling retrieves the AutoscalingV1Client
func
(
c
*
Clientset
)
Autoscaling
()
autoscalingv1
.
AutoscalingV1Interface
{
return
&
fakeautoscalingv1
.
FakeAutoscalingV1
{
Fake
:
&
c
.
Fake
}
}
// AutoscalingV2beta1 retrieves the AutoscalingV2beta1Client
// AutoscalingV2beta1 retrieves the AutoscalingV2beta1Client
func
(
c
*
Clientset
)
AutoscalingV2beta1
()
autoscalingv2beta1
.
AutoscalingV2beta1Interface
{
func
(
c
*
Clientset
)
AutoscalingV2beta1
()
autoscalingv2beta1
.
AutoscalingV2beta1Interface
{
return
&
fakeautoscalingv2beta1
.
FakeAutoscalingV2beta1
{
Fake
:
&
c
.
Fake
}
return
&
fakeautoscalingv2beta1
.
FakeAutoscalingV2beta1
{
Fake
:
&
c
.
Fake
}
...
@@ -232,11 +202,6 @@ func (c *Clientset) BatchV1() batchv1.BatchV1Interface {
...
@@ -232,11 +202,6 @@ func (c *Clientset) BatchV1() batchv1.BatchV1Interface {
return
&
fakebatchv1
.
FakeBatchV1
{
Fake
:
&
c
.
Fake
}
return
&
fakebatchv1
.
FakeBatchV1
{
Fake
:
&
c
.
Fake
}
}
}
// Batch retrieves the BatchV1Client
func
(
c
*
Clientset
)
Batch
()
batchv1
.
BatchV1Interface
{
return
&
fakebatchv1
.
FakeBatchV1
{
Fake
:
&
c
.
Fake
}
}
// BatchV1beta1 retrieves the BatchV1beta1Client
// BatchV1beta1 retrieves the BatchV1beta1Client
func
(
c
*
Clientset
)
BatchV1beta1
()
batchv1beta1
.
BatchV1beta1Interface
{
func
(
c
*
Clientset
)
BatchV1beta1
()
batchv1beta1
.
BatchV1beta1Interface
{
return
&
fakebatchv1beta1
.
FakeBatchV1beta1
{
Fake
:
&
c
.
Fake
}
return
&
fakebatchv1beta1
.
FakeBatchV1beta1
{
Fake
:
&
c
.
Fake
}
...
@@ -252,11 +217,6 @@ func (c *Clientset) CertificatesV1beta1() certificatesv1beta1.CertificatesV1beta
...
@@ -252,11 +217,6 @@ func (c *Clientset) CertificatesV1beta1() certificatesv1beta1.CertificatesV1beta
return
&
fakecertificatesv1beta1
.
FakeCertificatesV1beta1
{
Fake
:
&
c
.
Fake
}
return
&
fakecertificatesv1beta1
.
FakeCertificatesV1beta1
{
Fake
:
&
c
.
Fake
}
}
}
// Certificates retrieves the CertificatesV1beta1Client
func
(
c
*
Clientset
)
Certificates
()
certificatesv1beta1
.
CertificatesV1beta1Interface
{
return
&
fakecertificatesv1beta1
.
FakeCertificatesV1beta1
{
Fake
:
&
c
.
Fake
}
}
// CoordinationV1beta1 retrieves the CoordinationV1beta1Client
// CoordinationV1beta1 retrieves the CoordinationV1beta1Client
func
(
c
*
Clientset
)
CoordinationV1beta1
()
coordinationv1beta1
.
CoordinationV1beta1Interface
{
func
(
c
*
Clientset
)
CoordinationV1beta1
()
coordinationv1beta1
.
CoordinationV1beta1Interface
{
return
&
fakecoordinationv1beta1
.
FakeCoordinationV1beta1
{
Fake
:
&
c
.
Fake
}
return
&
fakecoordinationv1beta1
.
FakeCoordinationV1beta1
{
Fake
:
&
c
.
Fake
}
...
@@ -267,51 +227,26 @@ func (c *Clientset) CoordinationV1() coordinationv1.CoordinationV1Interface {
...
@@ -267,51 +227,26 @@ func (c *Clientset) CoordinationV1() coordinationv1.CoordinationV1Interface {
return
&
fakecoordinationv1
.
FakeCoordinationV1
{
Fake
:
&
c
.
Fake
}
return
&
fakecoordinationv1
.
FakeCoordinationV1
{
Fake
:
&
c
.
Fake
}
}
}
// Coordination retrieves the CoordinationV1Client
func
(
c
*
Clientset
)
Coordination
()
coordinationv1
.
CoordinationV1Interface
{
return
&
fakecoordinationv1
.
FakeCoordinationV1
{
Fake
:
&
c
.
Fake
}
}
// CoreV1 retrieves the CoreV1Client
// CoreV1 retrieves the CoreV1Client
func
(
c
*
Clientset
)
CoreV1
()
corev1
.
CoreV1Interface
{
func
(
c
*
Clientset
)
CoreV1
()
corev1
.
CoreV1Interface
{
return
&
fakecorev1
.
FakeCoreV1
{
Fake
:
&
c
.
Fake
}
return
&
fakecorev1
.
FakeCoreV1
{
Fake
:
&
c
.
Fake
}
}
}
// Core retrieves the CoreV1Client
func
(
c
*
Clientset
)
Core
()
corev1
.
CoreV1Interface
{
return
&
fakecorev1
.
FakeCoreV1
{
Fake
:
&
c
.
Fake
}
}
// EventsV1beta1 retrieves the EventsV1beta1Client
// EventsV1beta1 retrieves the EventsV1beta1Client
func
(
c
*
Clientset
)
EventsV1beta1
()
eventsv1beta1
.
EventsV1beta1Interface
{
func
(
c
*
Clientset
)
EventsV1beta1
()
eventsv1beta1
.
EventsV1beta1Interface
{
return
&
fakeeventsv1beta1
.
FakeEventsV1beta1
{
Fake
:
&
c
.
Fake
}
return
&
fakeeventsv1beta1
.
FakeEventsV1beta1
{
Fake
:
&
c
.
Fake
}
}
}
// Events retrieves the EventsV1beta1Client
func
(
c
*
Clientset
)
Events
()
eventsv1beta1
.
EventsV1beta1Interface
{
return
&
fakeeventsv1beta1
.
FakeEventsV1beta1
{
Fake
:
&
c
.
Fake
}
}
// ExtensionsV1beta1 retrieves the ExtensionsV1beta1Client
// ExtensionsV1beta1 retrieves the ExtensionsV1beta1Client
func
(
c
*
Clientset
)
ExtensionsV1beta1
()
extensionsv1beta1
.
ExtensionsV1beta1Interface
{
func
(
c
*
Clientset
)
ExtensionsV1beta1
()
extensionsv1beta1
.
ExtensionsV1beta1Interface
{
return
&
fakeextensionsv1beta1
.
FakeExtensionsV1beta1
{
Fake
:
&
c
.
Fake
}
return
&
fakeextensionsv1beta1
.
FakeExtensionsV1beta1
{
Fake
:
&
c
.
Fake
}
}
}
// Extensions retrieves the ExtensionsV1beta1Client
func
(
c
*
Clientset
)
Extensions
()
extensionsv1beta1
.
ExtensionsV1beta1Interface
{
return
&
fakeextensionsv1beta1
.
FakeExtensionsV1beta1
{
Fake
:
&
c
.
Fake
}
}
// NetworkingV1 retrieves the NetworkingV1Client
// NetworkingV1 retrieves the NetworkingV1Client
func
(
c
*
Clientset
)
NetworkingV1
()
networkingv1
.
NetworkingV1Interface
{
func
(
c
*
Clientset
)
NetworkingV1
()
networkingv1
.
NetworkingV1Interface
{
return
&
fakenetworkingv1
.
FakeNetworkingV1
{
Fake
:
&
c
.
Fake
}
return
&
fakenetworkingv1
.
FakeNetworkingV1
{
Fake
:
&
c
.
Fake
}
}
}
// Networking retrieves the NetworkingV1Client
func
(
c
*
Clientset
)
Networking
()
networkingv1
.
NetworkingV1Interface
{
return
&
fakenetworkingv1
.
FakeNetworkingV1
{
Fake
:
&
c
.
Fake
}
}
// NetworkingV1beta1 retrieves the NetworkingV1beta1Client
// NetworkingV1beta1 retrieves the NetworkingV1beta1Client
func
(
c
*
Clientset
)
NetworkingV1beta1
()
networkingv1beta1
.
NetworkingV1beta1Interface
{
func
(
c
*
Clientset
)
NetworkingV1beta1
()
networkingv1beta1
.
NetworkingV1beta1Interface
{
return
&
fakenetworkingv1beta1
.
FakeNetworkingV1beta1
{
Fake
:
&
c
.
Fake
}
return
&
fakenetworkingv1beta1
.
FakeNetworkingV1beta1
{
Fake
:
&
c
.
Fake
}
...
@@ -322,21 +257,11 @@ func (c *Clientset) PolicyV1beta1() policyv1beta1.PolicyV1beta1Interface {
...
@@ -322,21 +257,11 @@ func (c *Clientset) PolicyV1beta1() policyv1beta1.PolicyV1beta1Interface {
return
&
fakepolicyv1beta1
.
FakePolicyV1beta1
{
Fake
:
&
c
.
Fake
}
return
&
fakepolicyv1beta1
.
FakePolicyV1beta1
{
Fake
:
&
c
.
Fake
}
}
}
// Policy retrieves the PolicyV1beta1Client
func
(
c
*
Clientset
)
Policy
()
policyv1beta1
.
PolicyV1beta1Interface
{
return
&
fakepolicyv1beta1
.
FakePolicyV1beta1
{
Fake
:
&
c
.
Fake
}
}
// RbacV1 retrieves the RbacV1Client
// RbacV1 retrieves the RbacV1Client
func
(
c
*
Clientset
)
RbacV1
()
rbacv1
.
RbacV1Interface
{
func
(
c
*
Clientset
)
RbacV1
()
rbacv1
.
RbacV1Interface
{
return
&
fakerbacv1
.
FakeRbacV1
{
Fake
:
&
c
.
Fake
}
return
&
fakerbacv1
.
FakeRbacV1
{
Fake
:
&
c
.
Fake
}
}
}
// Rbac retrieves the RbacV1Client
func
(
c
*
Clientset
)
Rbac
()
rbacv1
.
RbacV1Interface
{
return
&
fakerbacv1
.
FakeRbacV1
{
Fake
:
&
c
.
Fake
}
}
// RbacV1beta1 retrieves the RbacV1beta1Client
// RbacV1beta1 retrieves the RbacV1beta1Client
func
(
c
*
Clientset
)
RbacV1beta1
()
rbacv1beta1
.
RbacV1beta1Interface
{
func
(
c
*
Clientset
)
RbacV1beta1
()
rbacv1beta1
.
RbacV1beta1Interface
{
return
&
fakerbacv1beta1
.
FakeRbacV1beta1
{
Fake
:
&
c
.
Fake
}
return
&
fakerbacv1beta1
.
FakeRbacV1beta1
{
Fake
:
&
c
.
Fake
}
...
@@ -362,21 +287,11 @@ func (c *Clientset) SchedulingV1() schedulingv1.SchedulingV1Interface {
...
@@ -362,21 +287,11 @@ func (c *Clientset) SchedulingV1() schedulingv1.SchedulingV1Interface {
return
&
fakeschedulingv1
.
FakeSchedulingV1
{
Fake
:
&
c
.
Fake
}
return
&
fakeschedulingv1
.
FakeSchedulingV1
{
Fake
:
&
c
.
Fake
}
}
}
// Scheduling retrieves the SchedulingV1Client
func
(
c
*
Clientset
)
Scheduling
()
schedulingv1
.
SchedulingV1Interface
{
return
&
fakeschedulingv1
.
FakeSchedulingV1
{
Fake
:
&
c
.
Fake
}
}
// SettingsV1alpha1 retrieves the SettingsV1alpha1Client
// SettingsV1alpha1 retrieves the SettingsV1alpha1Client
func
(
c
*
Clientset
)
SettingsV1alpha1
()
settingsv1alpha1
.
SettingsV1alpha1Interface
{
func
(
c
*
Clientset
)
SettingsV1alpha1
()
settingsv1alpha1
.
SettingsV1alpha1Interface
{
return
&
fakesettingsv1alpha1
.
FakeSettingsV1alpha1
{
Fake
:
&
c
.
Fake
}
return
&
fakesettingsv1alpha1
.
FakeSettingsV1alpha1
{
Fake
:
&
c
.
Fake
}
}
}
// Settings retrieves the SettingsV1alpha1Client
func
(
c
*
Clientset
)
Settings
()
settingsv1alpha1
.
SettingsV1alpha1Interface
{
return
&
fakesettingsv1alpha1
.
FakeSettingsV1alpha1
{
Fake
:
&
c
.
Fake
}
}
// StorageV1beta1 retrieves the StorageV1beta1Client
// StorageV1beta1 retrieves the StorageV1beta1Client
func
(
c
*
Clientset
)
StorageV1beta1
()
storagev1beta1
.
StorageV1beta1Interface
{
func
(
c
*
Clientset
)
StorageV1beta1
()
storagev1beta1
.
StorageV1beta1Interface
{
return
&
fakestoragev1beta1
.
FakeStorageV1beta1
{
Fake
:
&
c
.
Fake
}
return
&
fakestoragev1beta1
.
FakeStorageV1beta1
{
Fake
:
&
c
.
Fake
}
...
@@ -387,11 +302,6 @@ func (c *Clientset) StorageV1() storagev1.StorageV1Interface {
...
@@ -387,11 +302,6 @@ func (c *Clientset) StorageV1() storagev1.StorageV1Interface {
return
&
fakestoragev1
.
FakeStorageV1
{
Fake
:
&
c
.
Fake
}
return
&
fakestoragev1
.
FakeStorageV1
{
Fake
:
&
c
.
Fake
}
}
}
// Storage retrieves the StorageV1Client
func
(
c
*
Clientset
)
Storage
()
storagev1
.
StorageV1Interface
{
return
&
fakestoragev1
.
FakeStorageV1
{
Fake
:
&
c
.
Fake
}
}
// StorageV1alpha1 retrieves the StorageV1alpha1Client
// StorageV1alpha1 retrieves the StorageV1alpha1Client
func
(
c
*
Clientset
)
StorageV1alpha1
()
storagev1alpha1
.
StorageV1alpha1Interface
{
func
(
c
*
Clientset
)
StorageV1alpha1
()
storagev1alpha1
.
StorageV1alpha1Interface
{
return
&
fakestoragev1alpha1
.
FakeStorageV1alpha1
{
Fake
:
&
c
.
Fake
}
return
&
fakestoragev1alpha1
.
FakeStorageV1alpha1
{
Fake
:
&
c
.
Fake
}
...
...
staging/src/k8s.io/client-go/tools/watch/informerwatcher_test.go
View file @
be8a9b96
...
@@ -182,10 +182,10 @@ func TestNewInformerWatcher(t *testing.T) {
...
@@ -182,10 +182,10 @@ func TestNewInformerWatcher(t *testing.T) {
lw
:=
&
cache
.
ListWatch
{
lw
:=
&
cache
.
ListWatch
{
ListFunc
:
func
(
options
metav1
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
ListFunc
:
func
(
options
metav1
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
return
fake
.
Core
()
.
Secrets
(
""
)
.
List
(
options
)
return
fake
.
Core
V1
()
.
Secrets
(
""
)
.
List
(
options
)
},
},
WatchFunc
:
func
(
options
metav1
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
WatchFunc
:
func
(
options
metav1
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
fake
.
Core
()
.
Secrets
(
""
)
.
Watch
(
options
)
return
fake
.
Core
V1
()
.
Secrets
(
""
)
.
Watch
(
options
)
},
},
}
}
_
,
_
,
w
,
done
:=
NewIndexerInformerWatcher
(
lw
,
&
corev1
.
Secret
{})
_
,
_
,
w
,
done
:=
NewIndexerInformerWatcher
(
lw
,
&
corev1
.
Secret
{})
...
...
staging/src/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/clientset.go
View file @
be8a9b96
...
@@ -28,8 +28,6 @@ import (
...
@@ -28,8 +28,6 @@ import (
type
Interface
interface
{
type
Interface
interface
{
Discovery
()
discovery
.
DiscoveryInterface
Discovery
()
discovery
.
DiscoveryInterface
ExampleV1
()
examplev1
.
ExampleV1Interface
ExampleV1
()
examplev1
.
ExampleV1Interface
// Deprecated: please explicitly pick a version if possible.
Example
()
examplev1
.
ExampleV1Interface
}
}
// Clientset contains the clients for groups. Each group has exactly one
// Clientset contains the clients for groups. Each group has exactly one
...
@@ -44,12 +42,6 @@ func (c *Clientset) ExampleV1() examplev1.ExampleV1Interface {
...
@@ -44,12 +42,6 @@ func (c *Clientset) ExampleV1() examplev1.ExampleV1Interface {
return
c
.
exampleV1
return
c
.
exampleV1
}
}
// Deprecated: Example retrieves the default version of ExampleClient.
// Please explicitly pick a version.
func
(
c
*
Clientset
)
Example
()
examplev1
.
ExampleV1Interface
{
return
c
.
exampleV1
}
// Discovery retrieves the DiscoveryClient
// Discovery retrieves the DiscoveryClient
func
(
c
*
Clientset
)
Discovery
()
discovery
.
DiscoveryInterface
{
func
(
c
*
Clientset
)
Discovery
()
discovery
.
DiscoveryInterface
{
if
c
==
nil
{
if
c
==
nil
{
...
...
staging/src/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/fake/clientset_generated.go
View file @
be8a9b96
...
@@ -75,8 +75,3 @@ var _ clientset.Interface = &Clientset{}
...
@@ -75,8 +75,3 @@ var _ clientset.Interface = &Clientset{}
func
(
c
*
Clientset
)
ExampleV1
()
examplev1
.
ExampleV1Interface
{
func
(
c
*
Clientset
)
ExampleV1
()
examplev1
.
ExampleV1Interface
{
return
&
fakeexamplev1
.
FakeExampleV1
{
Fake
:
&
c
.
Fake
}
return
&
fakeexamplev1
.
FakeExampleV1
{
Fake
:
&
c
.
Fake
}
}
}
// Example retrieves the ExampleV1Client
func
(
c
*
Clientset
)
Example
()
examplev1
.
ExampleV1Interface
{
return
&
fakeexamplev1
.
FakeExampleV1
{
Fake
:
&
c
.
Fake
}
}
staging/src/k8s.io/code-generator/_examples/apiserver/clientset/versioned/clientset.go
View file @
be8a9b96
...
@@ -29,11 +29,7 @@ import (
...
@@ -29,11 +29,7 @@ import (
type
Interface
interface
{
type
Interface
interface
{
Discovery
()
discovery
.
DiscoveryInterface
Discovery
()
discovery
.
DiscoveryInterface
ExampleV1
()
examplev1
.
ExampleV1Interface
ExampleV1
()
examplev1
.
ExampleV1Interface
// Deprecated: please explicitly pick a version if possible.
Example
()
examplev1
.
ExampleV1Interface
SecondExampleV1
()
secondexamplev1
.
SecondExampleV1Interface
SecondExampleV1
()
secondexamplev1
.
SecondExampleV1Interface
// Deprecated: please explicitly pick a version if possible.
SecondExample
()
secondexamplev1
.
SecondExampleV1Interface
}
}
// Clientset contains the clients for groups. Each group has exactly one
// Clientset contains the clients for groups. Each group has exactly one
...
@@ -49,23 +45,11 @@ func (c *Clientset) ExampleV1() examplev1.ExampleV1Interface {
...
@@ -49,23 +45,11 @@ func (c *Clientset) ExampleV1() examplev1.ExampleV1Interface {
return
c
.
exampleV1
return
c
.
exampleV1
}
}
// Deprecated: Example retrieves the default version of ExampleClient.
// Please explicitly pick a version.
func
(
c
*
Clientset
)
Example
()
examplev1
.
ExampleV1Interface
{
return
c
.
exampleV1
}
// SecondExampleV1 retrieves the SecondExampleV1Client
// SecondExampleV1 retrieves the SecondExampleV1Client
func
(
c
*
Clientset
)
SecondExampleV1
()
secondexamplev1
.
SecondExampleV1Interface
{
func
(
c
*
Clientset
)
SecondExampleV1
()
secondexamplev1
.
SecondExampleV1Interface
{
return
c
.
secondExampleV1
return
c
.
secondExampleV1
}
}
// Deprecated: SecondExample retrieves the default version of SecondExampleClient.
// Please explicitly pick a version.
func
(
c
*
Clientset
)
SecondExample
()
secondexamplev1
.
SecondExampleV1Interface
{
return
c
.
secondExampleV1
}
// Discovery retrieves the DiscoveryClient
// Discovery retrieves the DiscoveryClient
func
(
c
*
Clientset
)
Discovery
()
discovery
.
DiscoveryInterface
{
func
(
c
*
Clientset
)
Discovery
()
discovery
.
DiscoveryInterface
{
if
c
==
nil
{
if
c
==
nil
{
...
...
staging/src/k8s.io/code-generator/_examples/apiserver/clientset/versioned/fake/clientset_generated.go
View file @
be8a9b96
...
@@ -78,17 +78,7 @@ func (c *Clientset) ExampleV1() examplev1.ExampleV1Interface {
...
@@ -78,17 +78,7 @@ func (c *Clientset) ExampleV1() examplev1.ExampleV1Interface {
return
&
fakeexamplev1
.
FakeExampleV1
{
Fake
:
&
c
.
Fake
}
return
&
fakeexamplev1
.
FakeExampleV1
{
Fake
:
&
c
.
Fake
}
}
}
// Example retrieves the ExampleV1Client
func
(
c
*
Clientset
)
Example
()
examplev1
.
ExampleV1Interface
{
return
&
fakeexamplev1
.
FakeExampleV1
{
Fake
:
&
c
.
Fake
}
}
// SecondExampleV1 retrieves the SecondExampleV1Client
// SecondExampleV1 retrieves the SecondExampleV1Client
func
(
c
*
Clientset
)
SecondExampleV1
()
secondexamplev1
.
SecondExampleV1Interface
{
func
(
c
*
Clientset
)
SecondExampleV1
()
secondexamplev1
.
SecondExampleV1Interface
{
return
&
fakesecondexamplev1
.
FakeSecondExampleV1
{
Fake
:
&
c
.
Fake
}
return
&
fakesecondexamplev1
.
FakeSecondExampleV1
{
Fake
:
&
c
.
Fake
}
}
}
// SecondExample retrieves the SecondExampleV1Client
func
(
c
*
Clientset
)
SecondExample
()
secondexamplev1
.
SecondExampleV1Interface
{
return
&
fakesecondexamplev1
.
FakeSecondExampleV1
{
Fake
:
&
c
.
Fake
}
}
staging/src/k8s.io/code-generator/_examples/crd/clientset/versioned/clientset.go
View file @
be8a9b96
...
@@ -29,11 +29,7 @@ import (
...
@@ -29,11 +29,7 @@ import (
type
Interface
interface
{
type
Interface
interface
{
Discovery
()
discovery
.
DiscoveryInterface
Discovery
()
discovery
.
DiscoveryInterface
ExampleV1
()
examplev1
.
ExampleV1Interface
ExampleV1
()
examplev1
.
ExampleV1Interface
// Deprecated: please explicitly pick a version if possible.
Example
()
examplev1
.
ExampleV1Interface
SecondExampleV1
()
secondexamplev1
.
SecondExampleV1Interface
SecondExampleV1
()
secondexamplev1
.
SecondExampleV1Interface
// Deprecated: please explicitly pick a version if possible.
SecondExample
()
secondexamplev1
.
SecondExampleV1Interface
}
}
// Clientset contains the clients for groups. Each group has exactly one
// Clientset contains the clients for groups. Each group has exactly one
...
@@ -49,23 +45,11 @@ func (c *Clientset) ExampleV1() examplev1.ExampleV1Interface {
...
@@ -49,23 +45,11 @@ func (c *Clientset) ExampleV1() examplev1.ExampleV1Interface {
return
c
.
exampleV1
return
c
.
exampleV1
}
}
// Deprecated: Example retrieves the default version of ExampleClient.
// Please explicitly pick a version.
func
(
c
*
Clientset
)
Example
()
examplev1
.
ExampleV1Interface
{
return
c
.
exampleV1
}
// SecondExampleV1 retrieves the SecondExampleV1Client
// SecondExampleV1 retrieves the SecondExampleV1Client
func
(
c
*
Clientset
)
SecondExampleV1
()
secondexamplev1
.
SecondExampleV1Interface
{
func
(
c
*
Clientset
)
SecondExampleV1
()
secondexamplev1
.
SecondExampleV1Interface
{
return
c
.
secondExampleV1
return
c
.
secondExampleV1
}
}
// Deprecated: SecondExample retrieves the default version of SecondExampleClient.
// Please explicitly pick a version.
func
(
c
*
Clientset
)
SecondExample
()
secondexamplev1
.
SecondExampleV1Interface
{
return
c
.
secondExampleV1
}
// Discovery retrieves the DiscoveryClient
// Discovery retrieves the DiscoveryClient
func
(
c
*
Clientset
)
Discovery
()
discovery
.
DiscoveryInterface
{
func
(
c
*
Clientset
)
Discovery
()
discovery
.
DiscoveryInterface
{
if
c
==
nil
{
if
c
==
nil
{
...
...
staging/src/k8s.io/code-generator/_examples/crd/clientset/versioned/fake/clientset_generated.go
View file @
be8a9b96
...
@@ -78,17 +78,7 @@ func (c *Clientset) ExampleV1() examplev1.ExampleV1Interface {
...
@@ -78,17 +78,7 @@ func (c *Clientset) ExampleV1() examplev1.ExampleV1Interface {
return
&
fakeexamplev1
.
FakeExampleV1
{
Fake
:
&
c
.
Fake
}
return
&
fakeexamplev1
.
FakeExampleV1
{
Fake
:
&
c
.
Fake
}
}
}
// Example retrieves the ExampleV1Client
func
(
c
*
Clientset
)
Example
()
examplev1
.
ExampleV1Interface
{
return
&
fakeexamplev1
.
FakeExampleV1
{
Fake
:
&
c
.
Fake
}
}
// SecondExampleV1 retrieves the SecondExampleV1Client
// SecondExampleV1 retrieves the SecondExampleV1Client
func
(
c
*
Clientset
)
SecondExampleV1
()
secondexamplev1
.
SecondExampleV1Interface
{
func
(
c
*
Clientset
)
SecondExampleV1
()
secondexamplev1
.
SecondExampleV1Interface
{
return
&
fakesecondexamplev1
.
FakeSecondExampleV1
{
Fake
:
&
c
.
Fake
}
return
&
fakesecondexamplev1
.
FakeSecondExampleV1
{
Fake
:
&
c
.
Fake
}
}
}
// SecondExample retrieves the SecondExampleV1Client
func
(
c
*
Clientset
)
SecondExample
()
secondexamplev1
.
SecondExampleV1Interface
{
return
&
fakesecondexamplev1
.
FakeSecondExampleV1
{
Fake
:
&
c
.
Fake
}
}
staging/src/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_clientset.go
View file @
be8a9b96
...
@@ -102,10 +102,6 @@ func (g *genClientset) GenerateType(c *generator.Context, t *types.Type, w io.Wr
...
@@ -102,10 +102,6 @@ func (g *genClientset) GenerateType(c *generator.Context, t *types.Type, w io.Wr
}
}
sw
.
Do
(
clientsetInterfaceImplTemplate
,
m
)
sw
.
Do
(
clientsetInterfaceImplTemplate
,
m
)
// don't generated the default method if generating internalversion clientset
if
group
.
IsDefaultVersion
&&
group
.
Version
!=
""
{
sw
.
Do
(
clientsetInterfaceDefaultVersionImpl
,
m
)
}
}
}
return
sw
.
Error
()
return
sw
.
Error
()
...
...
staging/src/k8s.io/code-generator/cmd/client-gen/generators/generator_for_clientset.go
View file @
be8a9b96
...
@@ -88,10 +88,6 @@ func (g *genClientset) GenerateType(c *generator.Context, t *types.Type, w io.Wr
...
@@ -88,10 +88,6 @@ func (g *genClientset) GenerateType(c *generator.Context, t *types.Type, w io.Wr
sw
.
Do
(
clientsetTemplate
,
m
)
sw
.
Do
(
clientsetTemplate
,
m
)
for
_
,
g
:=
range
allGroups
{
for
_
,
g
:=
range
allGroups
{
sw
.
Do
(
clientsetInterfaceImplTemplate
,
g
)
sw
.
Do
(
clientsetInterfaceImplTemplate
,
g
)
// don't generated the default method if generating internalversion clientset
if
g
.
IsDefaultVersion
&&
g
.
Version
!=
""
{
sw
.
Do
(
clientsetInterfaceDefaultVersionImpl
,
g
)
}
}
}
sw
.
Do
(
getDiscoveryTemplate
,
m
)
sw
.
Do
(
getDiscoveryTemplate
,
m
)
sw
.
Do
(
newClientsetForConfigTemplate
,
m
)
sw
.
Do
(
newClientsetForConfigTemplate
,
m
)
...
@@ -105,9 +101,7 @@ var clientsetInterface = `
...
@@ -105,9 +101,7 @@ var clientsetInterface = `
type Interface interface {
type Interface interface {
Discovery() $.DiscoveryInterface|raw$
Discovery() $.DiscoveryInterface|raw$
$range .allGroups$$.GroupGoName$$.Version$() $.PackageAlias$.$.GroupGoName$$.Version$Interface
$range .allGroups$$.GroupGoName$$.Version$() $.PackageAlias$.$.GroupGoName$$.Version$Interface
$if .IsDefaultVersion$// Deprecated: please explicitly pick a version if possible.
$end$
$.GroupGoName$() $.PackageAlias$.$.GroupGoName$$.Version$Interface
$end$$end$
}
}
`
`
...
@@ -128,14 +122,6 @@ func (c *Clientset) $.GroupGoName$$.Version$() $.PackageAlias$.$.GroupGoName$$.V
...
@@ -128,14 +122,6 @@ func (c *Clientset) $.GroupGoName$$.Version$() $.PackageAlias$.$.GroupGoName$$.V
}
}
`
`
var
clientsetInterfaceDefaultVersionImpl
=
`
// Deprecated: $.GroupGoName$ retrieves the default version of $.GroupGoName$Client.
// Please explicitly pick a version.
func (c *Clientset) $.GroupGoName$() $.PackageAlias$.$.GroupGoName$$.Version$Interface {
return c.$.LowerCaseGroupGoName$$.Version$
}
`
var
getDiscoveryTemplate
=
`
var
getDiscoveryTemplate
=
`
// Discovery retrieves the DiscoveryClient
// Discovery retrieves the DiscoveryClient
func (c *Clientset) Discovery() $.DiscoveryInterface|raw$ {
func (c *Clientset) Discovery() $.DiscoveryInterface|raw$ {
...
...
staging/src/k8s.io/code-generator/cmd/client-gen/types/helpers.go
View file @
be8a9b96
...
@@ -73,7 +73,7 @@ func (a sortableSliceOfVersions) Less(i, j int) bool {
...
@@ -73,7 +73,7 @@ func (a sortableSliceOfVersions) Less(i, j int) bool {
}
}
// Determine the default version among versions. If a user calls a group client
// Determine the default version among versions. If a user calls a group client
// without specifying the version (e.g., c.Core(), instead of c.CoreV1()), the
// without specifying the version (e.g., c.Core
V1
(), instead of c.CoreV1()), the
// default version will be returned.
// default version will be returned.
func
defaultVersion
(
versions
[]
PackageVersion
)
Version
{
func
defaultVersion
(
versions
[]
PackageVersion
)
Version
{
var
versionStrings
[]
string
var
versionStrings
[]
string
...
@@ -88,14 +88,12 @@ func defaultVersion(versions []PackageVersion) Version {
...
@@ -88,14 +88,12 @@ func defaultVersion(versions []PackageVersion) Version {
func
ToGroupVersionInfo
(
groups
[]
GroupVersions
,
groupGoNames
map
[
GroupVersion
]
string
)
[]
GroupVersionInfo
{
func
ToGroupVersionInfo
(
groups
[]
GroupVersions
,
groupGoNames
map
[
GroupVersion
]
string
)
[]
GroupVersionInfo
{
var
groupVersionPackages
[]
GroupVersionInfo
var
groupVersionPackages
[]
GroupVersionInfo
for
_
,
group
:=
range
groups
{
for
_
,
group
:=
range
groups
{
defaultVersion
:=
defaultVersion
(
group
.
Versions
)
for
_
,
version
:=
range
group
.
Versions
{
for
_
,
version
:=
range
group
.
Versions
{
groupGoName
:=
groupGoNames
[
GroupVersion
{
Group
:
group
.
Group
,
Version
:
version
.
Version
}]
groupGoName
:=
groupGoNames
[
GroupVersion
{
Group
:
group
.
Group
,
Version
:
version
.
Version
}]
groupVersionPackages
=
append
(
groupVersionPackages
,
GroupVersionInfo
{
groupVersionPackages
=
append
(
groupVersionPackages
,
GroupVersionInfo
{
Group
:
Group
(
namer
.
IC
(
group
.
Group
.
NonEmpty
())),
Group
:
Group
(
namer
.
IC
(
group
.
Group
.
NonEmpty
())),
Version
:
Version
(
namer
.
IC
(
version
.
Version
.
String
())),
Version
:
Version
(
namer
.
IC
(
version
.
Version
.
String
())),
PackageAlias
:
strings
.
ToLower
(
groupGoName
+
version
.
Version
.
NonEmpty
()),
PackageAlias
:
strings
.
ToLower
(
groupGoName
+
version
.
Version
.
NonEmpty
()),
IsDefaultVersion
:
version
.
Version
==
defaultVersion
&&
version
.
Version
!=
""
,
GroupGoName
:
groupGoName
,
GroupGoName
:
groupGoName
,
LowerCaseGroupGoName
:
namer
.
IL
(
groupGoName
),
LowerCaseGroupGoName
:
namer
.
IL
(
groupGoName
),
})
})
...
...
staging/src/k8s.io/code-generator/cmd/client-gen/types/types.go
View file @
be8a9b96
...
@@ -62,11 +62,8 @@ type GroupVersions struct {
...
@@ -62,11 +62,8 @@ type GroupVersions struct {
// GroupVersionInfo contains all the info around a group version.
// GroupVersionInfo contains all the info around a group version.
type
GroupVersionInfo
struct
{
type
GroupVersionInfo
struct
{
Group
Group
Group
Group
Version
Version
Version
Version
// If a user calls a group client without specifying the version (e.g.,
// c.Core(), instead of c.CoreV1()), the default version will be returned.
IsDefaultVersion
bool
PackageAlias
string
PackageAlias
string
GroupGoName
string
GroupGoName
string
LowerCaseGroupGoName
string
LowerCaseGroupGoName
string
...
...
staging/src/k8s.io/csi-api/pkg/client/clientset/versioned/clientset.go
View file @
be8a9b96
...
@@ -28,8 +28,6 @@ import (
...
@@ -28,8 +28,6 @@ import (
type
Interface
interface
{
type
Interface
interface
{
Discovery
()
discovery
.
DiscoveryInterface
Discovery
()
discovery
.
DiscoveryInterface
CsiV1alpha1
()
csiv1alpha1
.
CsiV1alpha1Interface
CsiV1alpha1
()
csiv1alpha1
.
CsiV1alpha1Interface
// Deprecated: please explicitly pick a version if possible.
Csi
()
csiv1alpha1
.
CsiV1alpha1Interface
}
}
// Clientset contains the clients for groups. Each group has exactly one
// Clientset contains the clients for groups. Each group has exactly one
...
@@ -44,12 +42,6 @@ func (c *Clientset) CsiV1alpha1() csiv1alpha1.CsiV1alpha1Interface {
...
@@ -44,12 +42,6 @@ func (c *Clientset) CsiV1alpha1() csiv1alpha1.CsiV1alpha1Interface {
return
c
.
csiV1alpha1
return
c
.
csiV1alpha1
}
}
// Deprecated: Csi retrieves the default version of CsiClient.
// Please explicitly pick a version.
func
(
c
*
Clientset
)
Csi
()
csiv1alpha1
.
CsiV1alpha1Interface
{
return
c
.
csiV1alpha1
}
// Discovery retrieves the DiscoveryClient
// Discovery retrieves the DiscoveryClient
func
(
c
*
Clientset
)
Discovery
()
discovery
.
DiscoveryInterface
{
func
(
c
*
Clientset
)
Discovery
()
discovery
.
DiscoveryInterface
{
if
c
==
nil
{
if
c
==
nil
{
...
...
staging/src/k8s.io/csi-api/pkg/client/clientset/versioned/fake/clientset_generated.go
View file @
be8a9b96
...
@@ -75,8 +75,3 @@ var _ clientset.Interface = &Clientset{}
...
@@ -75,8 +75,3 @@ var _ clientset.Interface = &Clientset{}
func
(
c
*
Clientset
)
CsiV1alpha1
()
csiv1alpha1
.
CsiV1alpha1Interface
{
func
(
c
*
Clientset
)
CsiV1alpha1
()
csiv1alpha1
.
CsiV1alpha1Interface
{
return
&
fakecsiv1alpha1
.
FakeCsiV1alpha1
{
Fake
:
&
c
.
Fake
}
return
&
fakecsiv1alpha1
.
FakeCsiV1alpha1
{
Fake
:
&
c
.
Fake
}
}
}
// Csi retrieves the CsiV1alpha1Client
func
(
c
*
Clientset
)
Csi
()
csiv1alpha1
.
CsiV1alpha1Interface
{
return
&
fakecsiv1alpha1
.
FakeCsiV1alpha1
{
Fake
:
&
c
.
Fake
}
}
staging/src/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/clientset.go
View file @
be8a9b96
...
@@ -30,8 +30,6 @@ type Interface interface {
...
@@ -30,8 +30,6 @@ type Interface interface {
Discovery
()
discovery
.
DiscoveryInterface
Discovery
()
discovery
.
DiscoveryInterface
ApiregistrationV1beta1
()
apiregistrationv1beta1
.
ApiregistrationV1beta1Interface
ApiregistrationV1beta1
()
apiregistrationv1beta1
.
ApiregistrationV1beta1Interface
ApiregistrationV1
()
apiregistrationv1
.
ApiregistrationV1Interface
ApiregistrationV1
()
apiregistrationv1
.
ApiregistrationV1Interface
// Deprecated: please explicitly pick a version if possible.
Apiregistration
()
apiregistrationv1
.
ApiregistrationV1Interface
}
}
// Clientset contains the clients for groups. Each group has exactly one
// Clientset contains the clients for groups. Each group has exactly one
...
@@ -52,12 +50,6 @@ func (c *Clientset) ApiregistrationV1() apiregistrationv1.ApiregistrationV1Inter
...
@@ -52,12 +50,6 @@ func (c *Clientset) ApiregistrationV1() apiregistrationv1.ApiregistrationV1Inter
return
c
.
apiregistrationV1
return
c
.
apiregistrationV1
}
}
// Deprecated: Apiregistration retrieves the default version of ApiregistrationClient.
// Please explicitly pick a version.
func
(
c
*
Clientset
)
Apiregistration
()
apiregistrationv1
.
ApiregistrationV1Interface
{
return
c
.
apiregistrationV1
}
// Discovery retrieves the DiscoveryClient
// Discovery retrieves the DiscoveryClient
func
(
c
*
Clientset
)
Discovery
()
discovery
.
DiscoveryInterface
{
func
(
c
*
Clientset
)
Discovery
()
discovery
.
DiscoveryInterface
{
if
c
==
nil
{
if
c
==
nil
{
...
...
staging/src/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/fake/clientset_generated.go
View file @
be8a9b96
...
@@ -82,8 +82,3 @@ func (c *Clientset) ApiregistrationV1beta1() apiregistrationv1beta1.Apiregistrat
...
@@ -82,8 +82,3 @@ func (c *Clientset) ApiregistrationV1beta1() apiregistrationv1beta1.Apiregistrat
func
(
c
*
Clientset
)
ApiregistrationV1
()
apiregistrationv1
.
ApiregistrationV1Interface
{
func
(
c
*
Clientset
)
ApiregistrationV1
()
apiregistrationv1
.
ApiregistrationV1Interface
{
return
&
fakeapiregistrationv1
.
FakeApiregistrationV1
{
Fake
:
&
c
.
Fake
}
return
&
fakeapiregistrationv1
.
FakeApiregistrationV1
{
Fake
:
&
c
.
Fake
}
}
}
// Apiregistration retrieves the ApiregistrationV1Client
func
(
c
*
Clientset
)
Apiregistration
()
apiregistrationv1
.
ApiregistrationV1Interface
{
return
&
fakeapiregistrationv1
.
FakeApiregistrationV1
{
Fake
:
&
c
.
Fake
}
}
staging/src/k8s.io/metrics/pkg/client/clientset/versioned/clientset.go
View file @
be8a9b96
...
@@ -30,8 +30,6 @@ type Interface interface {
...
@@ -30,8 +30,6 @@ type Interface interface {
Discovery
()
discovery
.
DiscoveryInterface
Discovery
()
discovery
.
DiscoveryInterface
MetricsV1alpha1
()
metricsv1alpha1
.
MetricsV1alpha1Interface
MetricsV1alpha1
()
metricsv1alpha1
.
MetricsV1alpha1Interface
MetricsV1beta1
()
metricsv1beta1
.
MetricsV1beta1Interface
MetricsV1beta1
()
metricsv1beta1
.
MetricsV1beta1Interface
// Deprecated: please explicitly pick a version if possible.
Metrics
()
metricsv1beta1
.
MetricsV1beta1Interface
}
}
// Clientset contains the clients for groups. Each group has exactly one
// Clientset contains the clients for groups. Each group has exactly one
...
@@ -52,12 +50,6 @@ func (c *Clientset) MetricsV1beta1() metricsv1beta1.MetricsV1beta1Interface {
...
@@ -52,12 +50,6 @@ func (c *Clientset) MetricsV1beta1() metricsv1beta1.MetricsV1beta1Interface {
return
c
.
metricsV1beta1
return
c
.
metricsV1beta1
}
}
// Deprecated: Metrics retrieves the default version of MetricsClient.
// Please explicitly pick a version.
func
(
c
*
Clientset
)
Metrics
()
metricsv1beta1
.
MetricsV1beta1Interface
{
return
c
.
metricsV1beta1
}
// Discovery retrieves the DiscoveryClient
// Discovery retrieves the DiscoveryClient
func
(
c
*
Clientset
)
Discovery
()
discovery
.
DiscoveryInterface
{
func
(
c
*
Clientset
)
Discovery
()
discovery
.
DiscoveryInterface
{
if
c
==
nil
{
if
c
==
nil
{
...
...
staging/src/k8s.io/metrics/pkg/client/clientset/versioned/fake/clientset_generated.go
View file @
be8a9b96
...
@@ -82,8 +82,3 @@ func (c *Clientset) MetricsV1alpha1() metricsv1alpha1.MetricsV1alpha1Interface {
...
@@ -82,8 +82,3 @@ func (c *Clientset) MetricsV1alpha1() metricsv1alpha1.MetricsV1alpha1Interface {
func
(
c
*
Clientset
)
MetricsV1beta1
()
metricsv1beta1
.
MetricsV1beta1Interface
{
func
(
c
*
Clientset
)
MetricsV1beta1
()
metricsv1beta1
.
MetricsV1beta1Interface
{
return
&
fakemetricsv1beta1
.
FakeMetricsV1beta1
{
Fake
:
&
c
.
Fake
}
return
&
fakemetricsv1beta1
.
FakeMetricsV1beta1
{
Fake
:
&
c
.
Fake
}
}
}
// Metrics retrieves the MetricsV1beta1Client
func
(
c
*
Clientset
)
Metrics
()
metricsv1beta1
.
MetricsV1beta1Interface
{
return
&
fakemetricsv1beta1
.
FakeMetricsV1beta1
{
Fake
:
&
c
.
Fake
}
}
staging/src/k8s.io/node-api/pkg/client/clientset/versioned/clientset.go
View file @
be8a9b96
...
@@ -28,8 +28,6 @@ import (
...
@@ -28,8 +28,6 @@ import (
type
Interface
interface
{
type
Interface
interface
{
Discovery
()
discovery
.
DiscoveryInterface
Discovery
()
discovery
.
DiscoveryInterface
NodeV1alpha1
()
nodev1alpha1
.
NodeV1alpha1Interface
NodeV1alpha1
()
nodev1alpha1
.
NodeV1alpha1Interface
// Deprecated: please explicitly pick a version if possible.
Node
()
nodev1alpha1
.
NodeV1alpha1Interface
}
}
// Clientset contains the clients for groups. Each group has exactly one
// Clientset contains the clients for groups. Each group has exactly one
...
@@ -44,12 +42,6 @@ func (c *Clientset) NodeV1alpha1() nodev1alpha1.NodeV1alpha1Interface {
...
@@ -44,12 +42,6 @@ func (c *Clientset) NodeV1alpha1() nodev1alpha1.NodeV1alpha1Interface {
return
c
.
nodeV1alpha1
return
c
.
nodeV1alpha1
}
}
// Deprecated: Node retrieves the default version of NodeClient.
// Please explicitly pick a version.
func
(
c
*
Clientset
)
Node
()
nodev1alpha1
.
NodeV1alpha1Interface
{
return
c
.
nodeV1alpha1
}
// Discovery retrieves the DiscoveryClient
// Discovery retrieves the DiscoveryClient
func
(
c
*
Clientset
)
Discovery
()
discovery
.
DiscoveryInterface
{
func
(
c
*
Clientset
)
Discovery
()
discovery
.
DiscoveryInterface
{
if
c
==
nil
{
if
c
==
nil
{
...
...
staging/src/k8s.io/node-api/pkg/client/clientset/versioned/fake/clientset_generated.go
View file @
be8a9b96
...
@@ -75,8 +75,3 @@ var _ clientset.Interface = &Clientset{}
...
@@ -75,8 +75,3 @@ var _ clientset.Interface = &Clientset{}
func
(
c
*
Clientset
)
NodeV1alpha1
()
nodev1alpha1
.
NodeV1alpha1Interface
{
func
(
c
*
Clientset
)
NodeV1alpha1
()
nodev1alpha1
.
NodeV1alpha1Interface
{
return
&
fakenodev1alpha1
.
FakeNodeV1alpha1
{
Fake
:
&
c
.
Fake
}
return
&
fakenodev1alpha1
.
FakeNodeV1alpha1
{
Fake
:
&
c
.
Fake
}
}
}
// Node retrieves the NodeV1alpha1Client
func
(
c
*
Clientset
)
Node
()
nodev1alpha1
.
NodeV1alpha1Interface
{
return
&
fakenodev1alpha1
.
FakeNodeV1alpha1
{
Fake
:
&
c
.
Fake
}
}
staging/src/k8s.io/sample-apiserver/pkg/generated/clientset/versioned/clientset.go
View file @
be8a9b96
...
@@ -30,8 +30,6 @@ type Interface interface {
...
@@ -30,8 +30,6 @@ type Interface interface {
Discovery
()
discovery
.
DiscoveryInterface
Discovery
()
discovery
.
DiscoveryInterface
WardleV1alpha1
()
wardlev1alpha1
.
WardleV1alpha1Interface
WardleV1alpha1
()
wardlev1alpha1
.
WardleV1alpha1Interface
WardleV1beta1
()
wardlev1beta1
.
WardleV1beta1Interface
WardleV1beta1
()
wardlev1beta1
.
WardleV1beta1Interface
// Deprecated: please explicitly pick a version if possible.
Wardle
()
wardlev1beta1
.
WardleV1beta1Interface
}
}
// Clientset contains the clients for groups. Each group has exactly one
// Clientset contains the clients for groups. Each group has exactly one
...
@@ -52,12 +50,6 @@ func (c *Clientset) WardleV1beta1() wardlev1beta1.WardleV1beta1Interface {
...
@@ -52,12 +50,6 @@ func (c *Clientset) WardleV1beta1() wardlev1beta1.WardleV1beta1Interface {
return
c
.
wardleV1beta1
return
c
.
wardleV1beta1
}
}
// Deprecated: Wardle retrieves the default version of WardleClient.
// Please explicitly pick a version.
func
(
c
*
Clientset
)
Wardle
()
wardlev1beta1
.
WardleV1beta1Interface
{
return
c
.
wardleV1beta1
}
// Discovery retrieves the DiscoveryClient
// Discovery retrieves the DiscoveryClient
func
(
c
*
Clientset
)
Discovery
()
discovery
.
DiscoveryInterface
{
func
(
c
*
Clientset
)
Discovery
()
discovery
.
DiscoveryInterface
{
if
c
==
nil
{
if
c
==
nil
{
...
...
staging/src/k8s.io/sample-apiserver/pkg/generated/clientset/versioned/fake/clientset_generated.go
View file @
be8a9b96
...
@@ -82,8 +82,3 @@ func (c *Clientset) WardleV1alpha1() wardlev1alpha1.WardleV1alpha1Interface {
...
@@ -82,8 +82,3 @@ func (c *Clientset) WardleV1alpha1() wardlev1alpha1.WardleV1alpha1Interface {
func
(
c
*
Clientset
)
WardleV1beta1
()
wardlev1beta1
.
WardleV1beta1Interface
{
func
(
c
*
Clientset
)
WardleV1beta1
()
wardlev1beta1
.
WardleV1beta1Interface
{
return
&
fakewardlev1beta1
.
FakeWardleV1beta1
{
Fake
:
&
c
.
Fake
}
return
&
fakewardlev1beta1
.
FakeWardleV1beta1
{
Fake
:
&
c
.
Fake
}
}
}
// Wardle retrieves the WardleV1beta1Client
func
(
c
*
Clientset
)
Wardle
()
wardlev1beta1
.
WardleV1beta1Interface
{
return
&
fakewardlev1beta1
.
FakeWardleV1beta1
{
Fake
:
&
c
.
Fake
}
}
staging/src/k8s.io/sample-controller/pkg/generated/clientset/versioned/clientset.go
View file @
be8a9b96
...
@@ -28,8 +28,6 @@ import (
...
@@ -28,8 +28,6 @@ import (
type
Interface
interface
{
type
Interface
interface
{
Discovery
()
discovery
.
DiscoveryInterface
Discovery
()
discovery
.
DiscoveryInterface
SamplecontrollerV1alpha1
()
samplecontrollerv1alpha1
.
SamplecontrollerV1alpha1Interface
SamplecontrollerV1alpha1
()
samplecontrollerv1alpha1
.
SamplecontrollerV1alpha1Interface
// Deprecated: please explicitly pick a version if possible.
Samplecontroller
()
samplecontrollerv1alpha1
.
SamplecontrollerV1alpha1Interface
}
}
// Clientset contains the clients for groups. Each group has exactly one
// Clientset contains the clients for groups. Each group has exactly one
...
@@ -44,12 +42,6 @@ func (c *Clientset) SamplecontrollerV1alpha1() samplecontrollerv1alpha1.Sampleco
...
@@ -44,12 +42,6 @@ func (c *Clientset) SamplecontrollerV1alpha1() samplecontrollerv1alpha1.Sampleco
return
c
.
samplecontrollerV1alpha1
return
c
.
samplecontrollerV1alpha1
}
}
// Deprecated: Samplecontroller retrieves the default version of SamplecontrollerClient.
// Please explicitly pick a version.
func
(
c
*
Clientset
)
Samplecontroller
()
samplecontrollerv1alpha1
.
SamplecontrollerV1alpha1Interface
{
return
c
.
samplecontrollerV1alpha1
}
// Discovery retrieves the DiscoveryClient
// Discovery retrieves the DiscoveryClient
func
(
c
*
Clientset
)
Discovery
()
discovery
.
DiscoveryInterface
{
func
(
c
*
Clientset
)
Discovery
()
discovery
.
DiscoveryInterface
{
if
c
==
nil
{
if
c
==
nil
{
...
...
staging/src/k8s.io/sample-controller/pkg/generated/clientset/versioned/fake/clientset_generated.go
View file @
be8a9b96
...
@@ -75,8 +75,3 @@ var _ clientset.Interface = &Clientset{}
...
@@ -75,8 +75,3 @@ var _ clientset.Interface = &Clientset{}
func
(
c
*
Clientset
)
SamplecontrollerV1alpha1
()
samplecontrollerv1alpha1
.
SamplecontrollerV1alpha1Interface
{
func
(
c
*
Clientset
)
SamplecontrollerV1alpha1
()
samplecontrollerv1alpha1
.
SamplecontrollerV1alpha1Interface
{
return
&
fakesamplecontrollerv1alpha1
.
FakeSamplecontrollerV1alpha1
{
Fake
:
&
c
.
Fake
}
return
&
fakesamplecontrollerv1alpha1
.
FakeSamplecontrollerV1alpha1
{
Fake
:
&
c
.
Fake
}
}
}
// Samplecontroller retrieves the SamplecontrollerV1alpha1Client
func
(
c
*
Clientset
)
Samplecontroller
()
samplecontrollerv1alpha1
.
SamplecontrollerV1alpha1Interface
{
return
&
fakesamplecontrollerv1alpha1
.
FakeSamplecontrollerV1alpha1
{
Fake
:
&
c
.
Fake
}
}
test/e2e/framework/podlogs/podlogs.go
View file @
be8a9b96
...
@@ -27,7 +27,6 @@ import (
...
@@ -27,7 +27,6 @@ import (
"bytes"
"bytes"
"context"
"context"
"fmt"
"fmt"
"github.com/pkg/errors"
"io"
"io"
"os"
"os"
"path"
"path"
...
@@ -35,6 +34,8 @@ import (
...
@@ -35,6 +34,8 @@ import (
"strings"
"strings"
"sync"
"sync"
"github.com/pkg/errors"
"k8s.io/api/core/v1"
"k8s.io/api/core/v1"
meta
"k8s.io/apimachinery/pkg/apis/meta/v1"
meta
"k8s.io/apimachinery/pkg/apis/meta/v1"
clientset
"k8s.io/client-go/kubernetes"
clientset
"k8s.io/client-go/kubernetes"
...
@@ -46,7 +47,7 @@ import (
...
@@ -46,7 +47,7 @@ import (
// rpc error: code = Unknown desc = Error: No such container: 41a...
// rpc error: code = Unknown desc = Error: No such container: 41a...
// when the pod gets deleted while streaming.
// when the pod gets deleted while streaming.
func
LogsForPod
(
ctx
context
.
Context
,
cs
clientset
.
Interface
,
ns
,
pod
string
,
opts
*
v1
.
PodLogOptions
)
(
io
.
ReadCloser
,
error
)
{
func
LogsForPod
(
ctx
context
.
Context
,
cs
clientset
.
Interface
,
ns
,
pod
string
,
opts
*
v1
.
PodLogOptions
)
(
io
.
ReadCloser
,
error
)
{
req
:=
cs
.
Core
()
.
Pods
(
ns
)
.
GetLogs
(
pod
,
opts
)
req
:=
cs
.
Core
V1
()
.
Pods
(
ns
)
.
GetLogs
(
pod
,
opts
)
return
req
.
Context
(
ctx
)
.
Stream
()
return
req
.
Context
(
ctx
)
.
Stream
()
}
}
...
@@ -78,7 +79,7 @@ var expectedErrors = regexp.MustCompile(`container .* in pod .* is (terminated|w
...
@@ -78,7 +79,7 @@ var expectedErrors = regexp.MustCompile(`container .* in pod .* is (terminated|w
// running pods, but that then would have the disadvantage that
// running pods, but that then would have the disadvantage that
// already deleted pods aren't covered.
// already deleted pods aren't covered.
func
CopyAllLogs
(
ctx
context
.
Context
,
cs
clientset
.
Interface
,
ns
string
,
to
LogOutput
)
error
{
func
CopyAllLogs
(
ctx
context
.
Context
,
cs
clientset
.
Interface
,
ns
string
,
to
LogOutput
)
error
{
watcher
,
err
:=
cs
.
Core
()
.
Pods
(
ns
)
.
Watch
(
meta
.
ListOptions
{})
watcher
,
err
:=
cs
.
Core
V1
()
.
Pods
(
ns
)
.
Watch
(
meta
.
ListOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
return
errors
.
Wrap
(
err
,
"cannot create Pod event watcher"
)
return
errors
.
Wrap
(
err
,
"cannot create Pod event watcher"
)
}
}
...
@@ -90,7 +91,7 @@ func CopyAllLogs(ctx context.Context, cs clientset.Interface, ns string, to LogO
...
@@ -90,7 +91,7 @@ func CopyAllLogs(ctx context.Context, cs clientset.Interface, ns string, to LogO
m
.
Lock
()
m
.
Lock
()
defer
m
.
Unlock
()
defer
m
.
Unlock
()
pods
,
err
:=
cs
.
Core
()
.
Pods
(
ns
)
.
List
(
meta
.
ListOptions
{})
pods
,
err
:=
cs
.
Core
V1
()
.
Pods
(
ns
)
.
List
(
meta
.
ListOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
if
to
.
StatusWriter
!=
nil
{
if
to
.
StatusWriter
!=
nil
{
fmt
.
Fprintf
(
to
.
StatusWriter
,
"ERROR: get pod list in %s: %s
\n
"
,
ns
,
err
)
fmt
.
Fprintf
(
to
.
StatusWriter
,
"ERROR: get pod list in %s: %s
\n
"
,
ns
,
err
)
...
@@ -213,7 +214,7 @@ func CopyAllLogs(ctx context.Context, cs clientset.Interface, ns string, to LogO
...
@@ -213,7 +214,7 @@ func CopyAllLogs(ctx context.Context, cs clientset.Interface, ns string, to LogO
// WatchPods prints pod status events for a certain namespace or all namespaces
// WatchPods prints pod status events for a certain namespace or all namespaces
// when namespace name is empty.
// when namespace name is empty.
func
WatchPods
(
ctx
context
.
Context
,
cs
clientset
.
Interface
,
ns
string
,
to
io
.
Writer
)
error
{
func
WatchPods
(
ctx
context
.
Context
,
cs
clientset
.
Interface
,
ns
string
,
to
io
.
Writer
)
error
{
watcher
,
err
:=
cs
.
Core
()
.
Pods
(
ns
)
.
Watch
(
meta
.
ListOptions
{})
watcher
,
err
:=
cs
.
Core
V1
()
.
Pods
(
ns
)
.
Watch
(
meta
.
ListOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
return
errors
.
Wrap
(
err
,
"cannot create Pod event watcher"
)
return
errors
.
Wrap
(
err
,
"cannot create Pod event watcher"
)
}
}
...
...
test/integration/defaulttolerationseconds/defaulttolerationseconds_test.go
View file @
be8a9b96
...
@@ -57,7 +57,7 @@ func TestAdmission(t *testing.T) {
...
@@ -57,7 +57,7 @@ func TestAdmission(t *testing.T) {
},
},
}
}
updatedPod
,
err
:=
client
.
Core
()
.
Pods
(
pod
.
Namespace
)
.
Create
(
&
pod
)
updatedPod
,
err
:=
client
.
Core
V1
()
.
Pods
(
pod
.
Namespace
)
.
Create
(
&
pod
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatalf
(
"error creating pod: %v"
,
err
)
t
.
Fatalf
(
"error creating pod: %v"
,
err
)
}
}
...
...
test/integration/evictions/evictions_test.go
View file @
be8a9b96
...
@@ -19,6 +19,7 @@ package evictions
...
@@ -19,6 +19,7 @@ package evictions
import
(
import
(
"fmt"
"fmt"
"net/http/httptest"
"net/http/httptest"
"reflect"
"sync"
"sync"
"sync/atomic"
"sync/atomic"
"testing"
"testing"
...
@@ -37,7 +38,6 @@ import (
...
@@ -37,7 +38,6 @@ import (
"k8s.io/client-go/tools/cache"
"k8s.io/client-go/tools/cache"
"k8s.io/kubernetes/pkg/controller/disruption"
"k8s.io/kubernetes/pkg/controller/disruption"
"k8s.io/kubernetes/test/integration/framework"
"k8s.io/kubernetes/test/integration/framework"
"reflect"
)
)
const
(
const
(
...
@@ -89,7 +89,7 @@ func TestConcurrentEvictionRequests(t *testing.T) {
...
@@ -89,7 +89,7 @@ func TestConcurrentEvictionRequests(t *testing.T) {
waitToObservePods
(
t
,
informers
.
Core
()
.
V1
()
.
Pods
()
.
Informer
(),
numOfEvictions
,
v1
.
PodRunning
)
waitToObservePods
(
t
,
informers
.
Core
()
.
V1
()
.
Pods
()
.
Informer
(),
numOfEvictions
,
v1
.
PodRunning
)
pdb
:=
newPDB
()
pdb
:=
newPDB
()
if
_
,
err
:=
clientSet
.
Policy
()
.
PodDisruptionBudgets
(
ns
.
Name
)
.
Create
(
pdb
);
err
!=
nil
{
if
_
,
err
:=
clientSet
.
Policy
V1beta1
()
.
PodDisruptionBudgets
(
ns
.
Name
)
.
Create
(
pdb
);
err
!=
nil
{
t
.
Errorf
(
"Failed to create PodDisruptionBudget: %v"
,
err
)
t
.
Errorf
(
"Failed to create PodDisruptionBudget: %v"
,
err
)
}
}
...
@@ -107,7 +107,7 @@ func TestConcurrentEvictionRequests(t *testing.T) {
...
@@ -107,7 +107,7 @@ func TestConcurrentEvictionRequests(t *testing.T) {
eviction
:=
newEviction
(
ns
.
Name
,
podName
,
deleteOption
)
eviction
:=
newEviction
(
ns
.
Name
,
podName
,
deleteOption
)
err
:=
wait
.
PollImmediate
(
5
*
time
.
Second
,
60
*
time
.
Second
,
func
()
(
bool
,
error
)
{
err
:=
wait
.
PollImmediate
(
5
*
time
.
Second
,
60
*
time
.
Second
,
func
()
(
bool
,
error
)
{
e
:=
clientSet
.
Policy
()
.
Evictions
(
ns
.
Name
)
.
Evict
(
eviction
)
e
:=
clientSet
.
Policy
V1beta1
()
.
Evictions
(
ns
.
Name
)
.
Evict
(
eviction
)
switch
{
switch
{
case
errors
.
IsTooManyRequests
(
e
)
:
case
errors
.
IsTooManyRequests
(
e
)
:
return
false
,
nil
return
false
,
nil
...
@@ -151,7 +151,7 @@ func TestConcurrentEvictionRequests(t *testing.T) {
...
@@ -151,7 +151,7 @@ func TestConcurrentEvictionRequests(t *testing.T) {
close
(
errCh
)
close
(
errCh
)
var
errList
[]
error
var
errList
[]
error
if
err
:=
clientSet
.
Policy
()
.
PodDisruptionBudgets
(
ns
.
Name
)
.
Delete
(
pdb
.
Name
,
deleteOption
);
err
!=
nil
{
if
err
:=
clientSet
.
Policy
V1beta1
()
.
PodDisruptionBudgets
(
ns
.
Name
)
.
Delete
(
pdb
.
Name
,
deleteOption
);
err
!=
nil
{
errList
=
append
(
errList
,
fmt
.
Errorf
(
"Failed to delete PodDisruptionBudget: %v"
,
err
))
errList
=
append
(
errList
,
fmt
.
Errorf
(
"Failed to delete PodDisruptionBudget: %v"
,
err
))
}
}
for
err
:=
range
errCh
{
for
err
:=
range
errCh
{
...
@@ -202,20 +202,20 @@ func TestTerminalPodEviction(t *testing.T) {
...
@@ -202,20 +202,20 @@ func TestTerminalPodEviction(t *testing.T) {
waitToObservePods
(
t
,
informers
.
Core
()
.
V1
()
.
Pods
()
.
Informer
(),
1
,
v1
.
PodSucceeded
)
waitToObservePods
(
t
,
informers
.
Core
()
.
V1
()
.
Pods
()
.
Informer
(),
1
,
v1
.
PodSucceeded
)
pdb
:=
newPDB
()
pdb
:=
newPDB
()
if
_
,
err
:=
clientSet
.
Policy
()
.
PodDisruptionBudgets
(
ns
.
Name
)
.
Create
(
pdb
);
err
!=
nil
{
if
_
,
err
:=
clientSet
.
Policy
V1beta1
()
.
PodDisruptionBudgets
(
ns
.
Name
)
.
Create
(
pdb
);
err
!=
nil
{
t
.
Errorf
(
"Failed to create PodDisruptionBudget: %v"
,
err
)
t
.
Errorf
(
"Failed to create PodDisruptionBudget: %v"
,
err
)
}
}
waitPDBStable
(
t
,
clientSet
,
1
,
ns
.
Name
,
pdb
.
Name
)
waitPDBStable
(
t
,
clientSet
,
1
,
ns
.
Name
,
pdb
.
Name
)
pdbList
,
err
:=
clientSet
.
Policy
()
.
PodDisruptionBudgets
(
ns
.
Name
)
.
List
(
metav1
.
ListOptions
{})
pdbList
,
err
:=
clientSet
.
Policy
V1beta1
()
.
PodDisruptionBudgets
(
ns
.
Name
)
.
List
(
metav1
.
ListOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatalf
(
"Error while listing pod disruption budget"
)
t
.
Fatalf
(
"Error while listing pod disruption budget"
)
}
}
oldPdb
:=
pdbList
.
Items
[
0
]
oldPdb
:=
pdbList
.
Items
[
0
]
eviction
:=
newEviction
(
ns
.
Name
,
pod
.
Name
,
deleteOption
)
eviction
:=
newEviction
(
ns
.
Name
,
pod
.
Name
,
deleteOption
)
err
=
wait
.
PollImmediate
(
5
*
time
.
Second
,
60
*
time
.
Second
,
func
()
(
bool
,
error
)
{
err
=
wait
.
PollImmediate
(
5
*
time
.
Second
,
60
*
time
.
Second
,
func
()
(
bool
,
error
)
{
e
:=
clientSet
.
Policy
()
.
Evictions
(
ns
.
Name
)
.
Evict
(
eviction
)
e
:=
clientSet
.
Policy
V1beta1
()
.
Evictions
(
ns
.
Name
)
.
Evict
(
eviction
)
switch
{
switch
{
case
errors
.
IsTooManyRequests
(
e
)
:
case
errors
.
IsTooManyRequests
(
e
)
:
return
false
,
nil
return
false
,
nil
...
@@ -230,7 +230,7 @@ func TestTerminalPodEviction(t *testing.T) {
...
@@ -230,7 +230,7 @@ func TestTerminalPodEviction(t *testing.T) {
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatalf
(
"Eviction of pod failed %v"
,
err
)
t
.
Fatalf
(
"Eviction of pod failed %v"
,
err
)
}
}
pdbList
,
err
=
clientSet
.
Policy
()
.
PodDisruptionBudgets
(
ns
.
Name
)
.
List
(
metav1
.
ListOptions
{})
pdbList
,
err
=
clientSet
.
Policy
V1beta1
()
.
PodDisruptionBudgets
(
ns
.
Name
)
.
List
(
metav1
.
ListOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatalf
(
"Error while listing pod disruption budget"
)
t
.
Fatalf
(
"Error while listing pod disruption budget"
)
}
}
...
@@ -240,7 +240,7 @@ func TestTerminalPodEviction(t *testing.T) {
...
@@ -240,7 +240,7 @@ func TestTerminalPodEviction(t *testing.T) {
t
.
Fatalf
(
"Expected the pdb generation to be of same value %v but got %v"
,
newPdb
.
Status
.
ObservedGeneration
,
oldPdb
.
Status
.
ObservedGeneration
)
t
.
Fatalf
(
"Expected the pdb generation to be of same value %v but got %v"
,
newPdb
.
Status
.
ObservedGeneration
,
oldPdb
.
Status
.
ObservedGeneration
)
}
}
if
err
:=
clientSet
.
Policy
()
.
PodDisruptionBudgets
(
ns
.
Name
)
.
Delete
(
pdb
.
Name
,
deleteOption
);
err
!=
nil
{
if
err
:=
clientSet
.
Policy
V1beta1
()
.
PodDisruptionBudgets
(
ns
.
Name
)
.
Delete
(
pdb
.
Name
,
deleteOption
);
err
!=
nil
{
t
.
Fatalf
(
"Failed to delete pod disruption budget"
)
t
.
Fatalf
(
"Failed to delete pod disruption budget"
)
}
}
}
}
...
@@ -364,7 +364,7 @@ func waitToObservePods(t *testing.T, podInformer cache.SharedIndexInformer, podN
...
@@ -364,7 +364,7 @@ func waitToObservePods(t *testing.T, podInformer cache.SharedIndexInformer, podN
func
waitPDBStable
(
t
*
testing
.
T
,
clientSet
clientset
.
Interface
,
podNum
int32
,
ns
,
pdbName
string
)
{
func
waitPDBStable
(
t
*
testing
.
T
,
clientSet
clientset
.
Interface
,
podNum
int32
,
ns
,
pdbName
string
)
{
if
err
:=
wait
.
PollImmediate
(
2
*
time
.
Second
,
60
*
time
.
Second
,
func
()
(
bool
,
error
)
{
if
err
:=
wait
.
PollImmediate
(
2
*
time
.
Second
,
60
*
time
.
Second
,
func
()
(
bool
,
error
)
{
pdb
,
err
:=
clientSet
.
Policy
()
.
PodDisruptionBudgets
(
ns
)
.
Get
(
pdbName
,
metav1
.
GetOptions
{})
pdb
,
err
:=
clientSet
.
Policy
V1beta1
()
.
PodDisruptionBudgets
(
ns
)
.
Get
(
pdbName
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
return
false
,
err
return
false
,
err
}
}
...
...
test/integration/metrics/metrics_test.go
View file @
be8a9b96
...
@@ -111,7 +111,7 @@ func TestApiserverMetrics(t *testing.T) {
...
@@ -111,7 +111,7 @@ func TestApiserverMetrics(t *testing.T) {
// Make a request to the apiserver to ensure there's at least one data point
// 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.
// for the metrics we're expecting -- otherwise, they won't be exported.
client
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
&
schema
.
GroupVersion
{
Group
:
""
,
Version
:
"v1"
}}})
client
:=
clientset
.
NewForConfigOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
&
schema
.
GroupVersion
{
Group
:
""
,
Version
:
"v1"
}}})
if
_
,
err
:=
client
.
Core
()
.
Pods
(
metav1
.
NamespaceDefault
)
.
List
(
metav1
.
ListOptions
{});
err
!=
nil
{
if
_
,
err
:=
client
.
Core
V1
()
.
Pods
(
metav1
.
NamespaceDefault
)
.
List
(
metav1
.
ListOptions
{});
err
!=
nil
{
t
.
Fatalf
(
"unexpected error getting pods: %v"
,
err
)
t
.
Fatalf
(
"unexpected error getting pods: %v"
,
err
)
}
}
...
...
test/integration/objectmeta/objectmeta_test.go
View file @
be8a9b96
...
@@ -41,12 +41,12 @@ func TestIgnoreClusterName(t *testing.T) {
...
@@ -41,12 +41,12 @@ func TestIgnoreClusterName(t *testing.T) {
ClusterName
:
"cluster-name-to-ignore"
,
ClusterName
:
"cluster-name-to-ignore"
,
},
},
}
}
nsNew
,
err
:=
client
.
Core
()
.
Namespaces
()
.
Create
(
&
ns
)
nsNew
,
err
:=
client
.
Core
V1
()
.
Namespaces
()
.
Create
(
&
ns
)
assert
.
Nil
(
t
,
err
)
assert
.
Nil
(
t
,
err
)
assert
.
Equal
(
t
,
ns
.
Name
,
nsNew
.
Name
)
assert
.
Equal
(
t
,
ns
.
Name
,
nsNew
.
Name
)
assert
.
Empty
(
t
,
nsNew
.
ClusterName
)
assert
.
Empty
(
t
,
nsNew
.
ClusterName
)
nsNew
,
err
=
client
.
Core
()
.
Namespaces
()
.
Update
(
&
ns
)
nsNew
,
err
=
client
.
Core
V1
()
.
Namespaces
()
.
Update
(
&
ns
)
assert
.
Nil
(
t
,
err
)
assert
.
Nil
(
t
,
err
)
assert
.
Equal
(
t
,
ns
.
Name
,
nsNew
.
Name
)
assert
.
Equal
(
t
,
ns
.
Name
,
nsNew
.
Name
)
assert
.
Empty
(
t
,
nsNew
.
ClusterName
)
assert
.
Empty
(
t
,
nsNew
.
ClusterName
)
...
...
test/integration/pods/pods_test.go
View file @
be8a9b96
...
@@ -129,13 +129,13 @@ func TestPodUpdateActiveDeadlineSeconds(t *testing.T) {
...
@@ -129,13 +129,13 @@ func TestPodUpdateActiveDeadlineSeconds(t *testing.T) {
pod
.
Spec
.
ActiveDeadlineSeconds
=
tc
.
original
pod
.
Spec
.
ActiveDeadlineSeconds
=
tc
.
original
pod
.
ObjectMeta
.
Name
=
fmt
.
Sprintf
(
"activedeadlineseconds-test-%v"
,
i
)
pod
.
ObjectMeta
.
Name
=
fmt
.
Sprintf
(
"activedeadlineseconds-test-%v"
,
i
)
if
_
,
err
:=
client
.
Core
()
.
Pods
(
ns
.
Name
)
.
Create
(
pod
);
err
!=
nil
{
if
_
,
err
:=
client
.
Core
V1
()
.
Pods
(
ns
.
Name
)
.
Create
(
pod
);
err
!=
nil
{
t
.
Errorf
(
"Failed to create pod: %v"
,
err
)
t
.
Errorf
(
"Failed to create pod: %v"
,
err
)
}
}
pod
.
Spec
.
ActiveDeadlineSeconds
=
tc
.
update
pod
.
Spec
.
ActiveDeadlineSeconds
=
tc
.
update
_
,
err
:=
client
.
Core
()
.
Pods
(
ns
.
Name
)
.
Update
(
pod
)
_
,
err
:=
client
.
Core
V1
()
.
Pods
(
ns
.
Name
)
.
Update
(
pod
)
if
tc
.
valid
&&
err
!=
nil
{
if
tc
.
valid
&&
err
!=
nil
{
t
.
Errorf
(
"%v: failed to update pod: %v"
,
tc
.
name
,
err
)
t
.
Errorf
(
"%v: failed to update pod: %v"
,
tc
.
name
,
err
)
}
else
if
!
tc
.
valid
&&
err
==
nil
{
}
else
if
!
tc
.
valid
&&
err
==
nil
{
...
@@ -173,7 +173,7 @@ func TestPodReadOnlyFilesystem(t *testing.T) {
...
@@ -173,7 +173,7 @@ func TestPodReadOnlyFilesystem(t *testing.T) {
},
},
}
}
if
_
,
err
:=
client
.
Core
()
.
Pods
(
ns
.
Name
)
.
Create
(
pod
);
err
!=
nil
{
if
_
,
err
:=
client
.
Core
V1
()
.
Pods
(
ns
.
Name
)
.
Create
(
pod
);
err
!=
nil
{
t
.
Errorf
(
"Failed to create pod: %v"
,
err
)
t
.
Errorf
(
"Failed to create pod: %v"
,
err
)
}
}
...
...
test/integration/quota/quota_test.go
View file @
be8a9b96
...
@@ -103,7 +103,7 @@ func TestQuota(t *testing.T) {
...
@@ -103,7 +103,7 @@ func TestQuota(t *testing.T) {
qc
:=
quotainstall
.
NewQuotaConfigurationForControllers
(
listerFuncForResource
)
qc
:=
quotainstall
.
NewQuotaConfigurationForControllers
(
listerFuncForResource
)
informersStarted
:=
make
(
chan
struct
{})
informersStarted
:=
make
(
chan
struct
{})
resourceQuotaControllerOptions
:=
&
resourcequotacontroller
.
ResourceQuotaControllerOptions
{
resourceQuotaControllerOptions
:=
&
resourcequotacontroller
.
ResourceQuotaControllerOptions
{
QuotaClient
:
clientset
.
Core
(),
QuotaClient
:
clientset
.
Core
V1
(),
ResourceQuotaInformer
:
informers
.
Core
()
.
V1
()
.
ResourceQuotas
(),
ResourceQuotaInformer
:
informers
.
Core
()
.
V1
()
.
ResourceQuotas
(),
ResyncPeriod
:
controller
.
NoResyncPeriodFunc
,
ResyncPeriod
:
controller
.
NoResyncPeriodFunc
,
InformerFactory
:
informers
,
InformerFactory
:
informers
,
...
@@ -151,12 +151,12 @@ func TestQuota(t *testing.T) {
...
@@ -151,12 +151,12 @@ func TestQuota(t *testing.T) {
}
}
func
waitForQuota
(
t
*
testing
.
T
,
quota
*
v1
.
ResourceQuota
,
clientset
*
clientset
.
Clientset
)
{
func
waitForQuota
(
t
*
testing
.
T
,
quota
*
v1
.
ResourceQuota
,
clientset
*
clientset
.
Clientset
)
{
w
,
err
:=
clientset
.
Core
()
.
ResourceQuotas
(
quota
.
Namespace
)
.
Watch
(
metav1
.
SingleObject
(
metav1
.
ObjectMeta
{
Name
:
quota
.
Name
}))
w
,
err
:=
clientset
.
Core
V1
()
.
ResourceQuotas
(
quota
.
Namespace
)
.
Watch
(
metav1
.
SingleObject
(
metav1
.
ObjectMeta
{
Name
:
quota
.
Name
}))
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatalf
(
"unexpected error: %v"
,
err
)
t
.
Fatalf
(
"unexpected error: %v"
,
err
)
}
}
if
_
,
err
:=
clientset
.
Core
()
.
ResourceQuotas
(
quota
.
Namespace
)
.
Create
(
quota
);
err
!=
nil
{
if
_
,
err
:=
clientset
.
Core
V1
()
.
ResourceQuotas
(
quota
.
Namespace
)
.
Create
(
quota
);
err
!=
nil
{
t
.
Fatalf
(
"unexpected error: %v"
,
err
)
t
.
Fatalf
(
"unexpected error: %v"
,
err
)
}
}
...
@@ -210,12 +210,12 @@ func scale(t *testing.T, namespace string, clientset *clientset.Clientset) {
...
@@ -210,12 +210,12 @@ func scale(t *testing.T, namespace string, clientset *clientset.Clientset) {
},
},
}
}
w
,
err
:=
clientset
.
Core
()
.
ReplicationControllers
(
namespace
)
.
Watch
(
metav1
.
SingleObject
(
metav1
.
ObjectMeta
{
Name
:
rc
.
Name
}))
w
,
err
:=
clientset
.
Core
V1
()
.
ReplicationControllers
(
namespace
)
.
Watch
(
metav1
.
SingleObject
(
metav1
.
ObjectMeta
{
Name
:
rc
.
Name
}))
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatalf
(
"unexpected error: %v"
,
err
)
t
.
Fatalf
(
"unexpected error: %v"
,
err
)
}
}
if
_
,
err
:=
clientset
.
Core
()
.
ReplicationControllers
(
namespace
)
.
Create
(
rc
);
err
!=
nil
{
if
_
,
err
:=
clientset
.
Core
V1
()
.
ReplicationControllers
(
namespace
)
.
Create
(
rc
);
err
!=
nil
{
t
.
Fatalf
(
"unexpected error: %v"
,
err
)
t
.
Fatalf
(
"unexpected error: %v"
,
err
)
}
}
...
@@ -239,7 +239,7 @@ func scale(t *testing.T, namespace string, clientset *clientset.Clientset) {
...
@@ -239,7 +239,7 @@ func scale(t *testing.T, namespace string, clientset *clientset.Clientset) {
return
false
,
nil
return
false
,
nil
})
})
if
err
!=
nil
{
if
err
!=
nil
{
pods
,
_
:=
clientset
.
Core
()
.
Pods
(
namespace
)
.
List
(
metav1
.
ListOptions
{
LabelSelector
:
labels
.
Everything
()
.
String
(),
FieldSelector
:
fields
.
Everything
()
.
String
()})
pods
,
_
:=
clientset
.
Core
V1
()
.
Pods
(
namespace
)
.
List
(
metav1
.
ListOptions
{
LabelSelector
:
labels
.
Everything
()
.
String
(),
FieldSelector
:
fields
.
Everything
()
.
String
()})
t
.
Fatalf
(
"unexpected error: %v, ended with %v pods"
,
err
,
len
(
pods
.
Items
))
t
.
Fatalf
(
"unexpected error: %v, ended with %v pods"
,
err
,
len
(
pods
.
Items
))
}
}
}
}
...
@@ -301,7 +301,7 @@ func TestQuotaLimitedResourceDenial(t *testing.T) {
...
@@ -301,7 +301,7 @@ func TestQuotaLimitedResourceDenial(t *testing.T) {
qc
:=
quotainstall
.
NewQuotaConfigurationForControllers
(
listerFuncForResource
)
qc
:=
quotainstall
.
NewQuotaConfigurationForControllers
(
listerFuncForResource
)
informersStarted
:=
make
(
chan
struct
{})
informersStarted
:=
make
(
chan
struct
{})
resourceQuotaControllerOptions
:=
&
resourcequotacontroller
.
ResourceQuotaControllerOptions
{
resourceQuotaControllerOptions
:=
&
resourcequotacontroller
.
ResourceQuotaControllerOptions
{
QuotaClient
:
clientset
.
Core
(),
QuotaClient
:
clientset
.
Core
V1
(),
ResourceQuotaInformer
:
informers
.
Core
()
.
V1
()
.
ResourceQuotas
(),
ResourceQuotaInformer
:
informers
.
Core
()
.
V1
()
.
ResourceQuotas
(),
ResyncPeriod
:
controller
.
NoResyncPeriodFunc
,
ResyncPeriod
:
controller
.
NoResyncPeriodFunc
,
InformerFactory
:
informers
,
InformerFactory
:
informers
,
...
@@ -339,7 +339,7 @@ func TestQuotaLimitedResourceDenial(t *testing.T) {
...
@@ -339,7 +339,7 @@ func TestQuotaLimitedResourceDenial(t *testing.T) {
},
},
},
},
}
}
if
_
,
err
:=
clientset
.
Core
()
.
Pods
(
ns
.
Name
)
.
Create
(
pod
);
err
==
nil
{
if
_
,
err
:=
clientset
.
Core
V1
()
.
Pods
(
ns
.
Name
)
.
Create
(
pod
);
err
==
nil
{
t
.
Fatalf
(
"expected error for insufficient quota"
)
t
.
Fatalf
(
"expected error for insufficient quota"
)
}
}
...
@@ -362,7 +362,7 @@ func TestQuotaLimitedResourceDenial(t *testing.T) {
...
@@ -362,7 +362,7 @@ func TestQuotaLimitedResourceDenial(t *testing.T) {
// attempt to create a new pod once the quota is propagated
// attempt to create a new pod once the quota is propagated
err
=
wait
.
PollImmediate
(
5
*
time
.
Second
,
time
.
Minute
,
func
()
(
bool
,
error
)
{
err
=
wait
.
PollImmediate
(
5
*
time
.
Second
,
time
.
Minute
,
func
()
(
bool
,
error
)
{
// retry until we succeed (to allow time for all changes to propagate)
// retry until we succeed (to allow time for all changes to propagate)
if
_
,
err
:=
clientset
.
Core
()
.
Pods
(
ns
.
Name
)
.
Create
(
pod
);
err
==
nil
{
if
_
,
err
:=
clientset
.
Core
V1
()
.
Pods
(
ns
.
Name
)
.
Create
(
pod
);
err
==
nil
{
return
true
,
nil
return
true
,
nil
}
}
return
false
,
nil
return
false
,
nil
...
...
test/integration/serviceaccount/service_account_test.go
View file @
be8a9b96
...
@@ -72,7 +72,7 @@ func TestServiceAccountAutoCreate(t *testing.T) {
...
@@ -72,7 +72,7 @@ func TestServiceAccountAutoCreate(t *testing.T) {
ns
:=
"test-service-account-creation"
ns
:=
"test-service-account-creation"
// Create namespace
// Create namespace
_
,
err
=
c
.
Core
()
.
Namespaces
()
.
Create
(
&
v1
.
Namespace
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
ns
}})
_
,
err
=
c
.
Core
V1
()
.
Namespaces
()
.
Create
(
&
v1
.
Namespace
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
ns
}})
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatalf
(
"could not create namespace: %v"
,
err
)
t
.
Fatalf
(
"could not create namespace: %v"
,
err
)
}
}
...
@@ -84,7 +84,7 @@ func TestServiceAccountAutoCreate(t *testing.T) {
...
@@ -84,7 +84,7 @@ func TestServiceAccountAutoCreate(t *testing.T) {
}
}
// Delete service account
// Delete service account
err
=
c
.
Core
()
.
ServiceAccounts
(
ns
)
.
Delete
(
defaultUser
.
Name
,
nil
)
err
=
c
.
Core
V1
()
.
ServiceAccounts
(
ns
)
.
Delete
(
defaultUser
.
Name
,
nil
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatalf
(
"Could not delete default serviceaccount: %v"
,
err
)
t
.
Fatalf
(
"Could not delete default serviceaccount: %v"
,
err
)
}
}
...
@@ -110,13 +110,13 @@ func TestServiceAccountTokenAutoCreate(t *testing.T) {
...
@@ -110,13 +110,13 @@ func TestServiceAccountTokenAutoCreate(t *testing.T) {
name
:=
"my-service-account"
name
:=
"my-service-account"
// Create namespace
// Create namespace
_
,
err
=
c
.
Core
()
.
Namespaces
()
.
Create
(
&
v1
.
Namespace
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
ns
}})
_
,
err
=
c
.
Core
V1
()
.
Namespaces
()
.
Create
(
&
v1
.
Namespace
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
ns
}})
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatalf
(
"could not create namespace: %v"
,
err
)
t
.
Fatalf
(
"could not create namespace: %v"
,
err
)
}
}
// Create service account
// Create service account
serviceAccount
,
err
:=
c
.
Core
()
.
ServiceAccounts
(
ns
)
.
Create
(
&
v1
.
ServiceAccount
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
name
}})
serviceAccount
,
err
:=
c
.
Core
V1
()
.
ServiceAccounts
(
ns
)
.
Create
(
&
v1
.
ServiceAccount
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
name
}})
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatalf
(
"Service Account not created: %v"
,
err
)
t
.
Fatalf
(
"Service Account not created: %v"
,
err
)
}
}
...
@@ -128,7 +128,7 @@ func TestServiceAccountTokenAutoCreate(t *testing.T) {
...
@@ -128,7 +128,7 @@ func TestServiceAccountTokenAutoCreate(t *testing.T) {
}
}
// Delete token
// Delete token
err
=
c
.
Core
()
.
Secrets
(
ns
)
.
Delete
(
token1Name
,
nil
)
err
=
c
.
Core
V1
()
.
Secrets
(
ns
)
.
Delete
(
token1Name
,
nil
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatalf
(
"Could not delete token: %v"
,
err
)
t
.
Fatalf
(
"Could not delete token: %v"
,
err
)
}
}
...
@@ -146,12 +146,12 @@ func TestServiceAccountTokenAutoCreate(t *testing.T) {
...
@@ -146,12 +146,12 @@ func TestServiceAccountTokenAutoCreate(t *testing.T) {
}
}
// Trigger creation of a new referenced token
// Trigger creation of a new referenced token
serviceAccount
,
err
=
c
.
Core
()
.
ServiceAccounts
(
ns
)
.
Get
(
name
,
metav1
.
GetOptions
{})
serviceAccount
,
err
=
c
.
Core
V1
()
.
ServiceAccounts
(
ns
)
.
Get
(
name
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatal
(
err
)
t
.
Fatal
(
err
)
}
}
serviceAccount
.
Secrets
=
[]
v1
.
ObjectReference
{}
serviceAccount
.
Secrets
=
[]
v1
.
ObjectReference
{}
_
,
err
=
c
.
Core
()
.
ServiceAccounts
(
ns
)
.
Update
(
serviceAccount
)
_
,
err
=
c
.
Core
V1
()
.
ServiceAccounts
(
ns
)
.
Update
(
serviceAccount
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatal
(
err
)
t
.
Fatal
(
err
)
}
}
...
@@ -169,7 +169,7 @@ func TestServiceAccountTokenAutoCreate(t *testing.T) {
...
@@ -169,7 +169,7 @@ func TestServiceAccountTokenAutoCreate(t *testing.T) {
}
}
// Delete service account
// Delete service account
err
=
c
.
Core
()
.
ServiceAccounts
(
ns
)
.
Delete
(
name
,
nil
)
err
=
c
.
Core
V1
()
.
ServiceAccounts
(
ns
)
.
Delete
(
name
,
nil
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatal
(
err
)
t
.
Fatal
(
err
)
}
}
...
@@ -178,7 +178,7 @@ func TestServiceAccountTokenAutoCreate(t *testing.T) {
...
@@ -178,7 +178,7 @@ func TestServiceAccountTokenAutoCreate(t *testing.T) {
tokensToCleanup
:=
sets
.
NewString
(
token1Name
,
token2Name
,
token3Name
)
tokensToCleanup
:=
sets
.
NewString
(
token1Name
,
token2Name
,
token3Name
)
err
=
wait
.
Poll
(
time
.
Second
,
10
*
time
.
Second
,
func
()
(
bool
,
error
)
{
err
=
wait
.
Poll
(
time
.
Second
,
10
*
time
.
Second
,
func
()
(
bool
,
error
)
{
// Get all secrets in the namespace
// Get all secrets in the namespace
secrets
,
err
:=
c
.
Core
()
.
Secrets
(
ns
)
.
List
(
metav1
.
ListOptions
{})
secrets
,
err
:=
c
.
Core
V1
()
.
Secrets
(
ns
)
.
List
(
metav1
.
ListOptions
{})
// Retrieval errors should fail
// Retrieval errors should fail
if
err
!=
nil
{
if
err
!=
nil
{
return
false
,
err
return
false
,
err
...
@@ -207,7 +207,7 @@ func TestServiceAccountTokenAutoMount(t *testing.T) {
...
@@ -207,7 +207,7 @@ func TestServiceAccountTokenAutoMount(t *testing.T) {
ns
:=
"auto-mount-ns"
ns
:=
"auto-mount-ns"
// Create "my" namespace
// Create "my" namespace
_
,
err
=
c
.
Core
()
.
Namespaces
()
.
Create
(
&
v1
.
Namespace
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
ns
}})
_
,
err
=
c
.
Core
V1
()
.
Namespaces
()
.
Create
(
&
v1
.
Namespace
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
ns
}})
if
err
!=
nil
&&
!
errors
.
IsAlreadyExists
(
err
)
{
if
err
!=
nil
&&
!
errors
.
IsAlreadyExists
(
err
)
{
t
.
Fatalf
(
"could not create namespace: %v"
,
err
)
t
.
Fatalf
(
"could not create namespace: %v"
,
err
)
}
}
...
@@ -261,7 +261,7 @@ func TestServiceAccountTokenAutoMount(t *testing.T) {
...
@@ -261,7 +261,7 @@ func TestServiceAccountTokenAutoMount(t *testing.T) {
}
}
expectedContainer2VolumeMounts
:=
protoPod
.
Spec
.
Containers
[
1
]
.
VolumeMounts
expectedContainer2VolumeMounts
:=
protoPod
.
Spec
.
Containers
[
1
]
.
VolumeMounts
createdPod
,
err
:=
c
.
Core
()
.
Pods
(
ns
)
.
Create
(
&
protoPod
)
createdPod
,
err
:=
c
.
Core
V1
()
.
Pods
(
ns
)
.
Create
(
&
protoPod
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatal
(
err
)
t
.
Fatal
(
err
)
}
}
...
@@ -290,19 +290,19 @@ func TestServiceAccountTokenAuthentication(t *testing.T) {
...
@@ -290,19 +290,19 @@ func TestServiceAccountTokenAuthentication(t *testing.T) {
otherns
:=
"other-ns"
otherns
:=
"other-ns"
// Create "my" namespace
// Create "my" namespace
_
,
err
=
c
.
Core
()
.
Namespaces
()
.
Create
(
&
v1
.
Namespace
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
myns
}})
_
,
err
=
c
.
Core
V1
()
.
Namespaces
()
.
Create
(
&
v1
.
Namespace
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
myns
}})
if
err
!=
nil
&&
!
errors
.
IsAlreadyExists
(
err
)
{
if
err
!=
nil
&&
!
errors
.
IsAlreadyExists
(
err
)
{
t
.
Fatalf
(
"could not create namespace: %v"
,
err
)
t
.
Fatalf
(
"could not create namespace: %v"
,
err
)
}
}
// Create "other" namespace
// Create "other" namespace
_
,
err
=
c
.
Core
()
.
Namespaces
()
.
Create
(
&
v1
.
Namespace
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
otherns
}})
_
,
err
=
c
.
Core
V1
()
.
Namespaces
()
.
Create
(
&
v1
.
Namespace
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
otherns
}})
if
err
!=
nil
&&
!
errors
.
IsAlreadyExists
(
err
)
{
if
err
!=
nil
&&
!
errors
.
IsAlreadyExists
(
err
)
{
t
.
Fatalf
(
"could not create namespace: %v"
,
err
)
t
.
Fatalf
(
"could not create namespace: %v"
,
err
)
}
}
// Create "ro" user in myns
// Create "ro" user in myns
_
,
err
=
c
.
Core
()
.
ServiceAccounts
(
myns
)
.
Create
(
&
v1
.
ServiceAccount
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
readOnlyServiceAccountName
}})
_
,
err
=
c
.
Core
V1
()
.
ServiceAccounts
(
myns
)
.
Create
(
&
v1
.
ServiceAccount
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
readOnlyServiceAccountName
}})
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatalf
(
"Service Account not created: %v"
,
err
)
t
.
Fatalf
(
"Service Account not created: %v"
,
err
)
}
}
...
@@ -315,13 +315,13 @@ func TestServiceAccountTokenAuthentication(t *testing.T) {
...
@@ -315,13 +315,13 @@ func TestServiceAccountTokenAuthentication(t *testing.T) {
roClient
:=
clientset
.
NewForConfigOrDie
(
&
roClientConfig
)
roClient
:=
clientset
.
NewForConfigOrDie
(
&
roClientConfig
)
doServiceAccountAPIRequests
(
t
,
roClient
,
myns
,
true
,
true
,
false
)
doServiceAccountAPIRequests
(
t
,
roClient
,
myns
,
true
,
true
,
false
)
doServiceAccountAPIRequests
(
t
,
roClient
,
otherns
,
true
,
false
,
false
)
doServiceAccountAPIRequests
(
t
,
roClient
,
otherns
,
true
,
false
,
false
)
err
=
c
.
Core
()
.
Secrets
(
myns
)
.
Delete
(
roTokenName
,
nil
)
err
=
c
.
Core
V1
()
.
Secrets
(
myns
)
.
Delete
(
roTokenName
,
nil
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatalf
(
"could not delete token: %v"
,
err
)
t
.
Fatalf
(
"could not delete token: %v"
,
err
)
}
}
// wait for delete to be observed and reacted to via watch
// wait for delete to be observed and reacted to via watch
wait
.
PollImmediate
(
100
*
time
.
Millisecond
,
30
*
time
.
Second
,
func
()
(
bool
,
error
)
{
wait
.
PollImmediate
(
100
*
time
.
Millisecond
,
30
*
time
.
Second
,
func
()
(
bool
,
error
)
{
sa
,
err
:=
c
.
Core
()
.
ServiceAccounts
(
myns
)
.
Get
(
readOnlyServiceAccountName
,
metav1
.
GetOptions
{})
sa
,
err
:=
c
.
Core
V1
()
.
ServiceAccounts
(
myns
)
.
Get
(
readOnlyServiceAccountName
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
return
false
,
err
return
false
,
err
}
}
...
@@ -335,7 +335,7 @@ func TestServiceAccountTokenAuthentication(t *testing.T) {
...
@@ -335,7 +335,7 @@ func TestServiceAccountTokenAuthentication(t *testing.T) {
doServiceAccountAPIRequests
(
t
,
roClient
,
myns
,
false
,
false
,
false
)
doServiceAccountAPIRequests
(
t
,
roClient
,
myns
,
false
,
false
,
false
)
// Create "rw" user in myns
// Create "rw" user in myns
_
,
err
=
c
.
Core
()
.
ServiceAccounts
(
myns
)
.
Create
(
&
v1
.
ServiceAccount
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
readWriteServiceAccountName
}})
_
,
err
=
c
.
Core
V1
()
.
ServiceAccounts
(
myns
)
.
Create
(
&
v1
.
ServiceAccount
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
readWriteServiceAccountName
}})
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatalf
(
"Service Account not created: %v"
,
err
)
t
.
Fatalf
(
"Service Account not created: %v"
,
err
)
}
}
...
@@ -489,13 +489,13 @@ func startServiceAccountTestServer(t *testing.T) (*clientset.Clientset, restclie
...
@@ -489,13 +489,13 @@ func startServiceAccountTestServer(t *testing.T) (*clientset.Clientset, restclie
func
getServiceAccount
(
c
*
clientset
.
Clientset
,
ns
string
,
name
string
,
shouldWait
bool
)
(
*
v1
.
ServiceAccount
,
error
)
{
func
getServiceAccount
(
c
*
clientset
.
Clientset
,
ns
string
,
name
string
,
shouldWait
bool
)
(
*
v1
.
ServiceAccount
,
error
)
{
if
!
shouldWait
{
if
!
shouldWait
{
return
c
.
Core
()
.
ServiceAccounts
(
ns
)
.
Get
(
name
,
metav1
.
GetOptions
{})
return
c
.
Core
V1
()
.
ServiceAccounts
(
ns
)
.
Get
(
name
,
metav1
.
GetOptions
{})
}
}
var
user
*
v1
.
ServiceAccount
var
user
*
v1
.
ServiceAccount
var
err
error
var
err
error
err
=
wait
.
Poll
(
time
.
Second
,
10
*
time
.
Second
,
func
()
(
bool
,
error
)
{
err
=
wait
.
Poll
(
time
.
Second
,
10
*
time
.
Second
,
func
()
(
bool
,
error
)
{
user
,
err
=
c
.
Core
()
.
ServiceAccounts
(
ns
)
.
Get
(
name
,
metav1
.
GetOptions
{})
user
,
err
=
c
.
Core
V1
()
.
ServiceAccounts
(
ns
)
.
Get
(
name
,
metav1
.
GetOptions
{})
if
errors
.
IsNotFound
(
err
)
{
if
errors
.
IsNotFound
(
err
)
{
return
false
,
nil
return
false
,
nil
}
}
...
@@ -512,7 +512,7 @@ func getReferencedServiceAccountToken(c *clientset.Clientset, ns string, name st
...
@@ -512,7 +512,7 @@ func getReferencedServiceAccountToken(c *clientset.Clientset, ns string, name st
token
:=
""
token
:=
""
findToken
:=
func
()
(
bool
,
error
)
{
findToken
:=
func
()
(
bool
,
error
)
{
user
,
err
:=
c
.
Core
()
.
ServiceAccounts
(
ns
)
.
Get
(
name
,
metav1
.
GetOptions
{})
user
,
err
:=
c
.
Core
V1
()
.
ServiceAccounts
(
ns
)
.
Get
(
name
,
metav1
.
GetOptions
{})
if
errors
.
IsNotFound
(
err
)
{
if
errors
.
IsNotFound
(
err
)
{
return
false
,
nil
return
false
,
nil
}
}
...
@@ -521,7 +521,7 @@ func getReferencedServiceAccountToken(c *clientset.Clientset, ns string, name st
...
@@ -521,7 +521,7 @@ func getReferencedServiceAccountToken(c *clientset.Clientset, ns string, name st
}
}
for
_
,
ref
:=
range
user
.
Secrets
{
for
_
,
ref
:=
range
user
.
Secrets
{
secret
,
err
:=
c
.
Core
()
.
Secrets
(
ns
)
.
Get
(
ref
.
Name
,
metav1
.
GetOptions
{})
secret
,
err
:=
c
.
Core
V1
()
.
Secrets
(
ns
)
.
Get
(
ref
.
Name
,
metav1
.
GetOptions
{})
if
errors
.
IsNotFound
(
err
)
{
if
errors
.
IsNotFound
(
err
)
{
continue
continue
}
}
...
@@ -571,17 +571,17 @@ func doServiceAccountAPIRequests(t *testing.T, c *clientset.Clientset, ns string
...
@@ -571,17 +571,17 @@ func doServiceAccountAPIRequests(t *testing.T, c *clientset.Clientset, ns string
readOps
:=
[]
testOperation
{
readOps
:=
[]
testOperation
{
func
()
error
{
func
()
error
{
_
,
err
:=
c
.
Core
()
.
Secrets
(
ns
)
.
List
(
metav1
.
ListOptions
{})
_
,
err
:=
c
.
Core
V1
()
.
Secrets
(
ns
)
.
List
(
metav1
.
ListOptions
{})
return
err
return
err
},
},
func
()
error
{
func
()
error
{
_
,
err
:=
c
.
Core
()
.
Pods
(
ns
)
.
List
(
metav1
.
ListOptions
{})
_
,
err
:=
c
.
Core
V1
()
.
Pods
(
ns
)
.
List
(
metav1
.
ListOptions
{})
return
err
return
err
},
},
}
}
writeOps
:=
[]
testOperation
{
writeOps
:=
[]
testOperation
{
func
()
error
{
_
,
err
:=
c
.
Core
()
.
Secrets
(
ns
)
.
Create
(
testSecret
);
return
err
},
func
()
error
{
_
,
err
:=
c
.
Core
V1
()
.
Secrets
(
ns
)
.
Create
(
testSecret
);
return
err
},
func
()
error
{
return
c
.
Core
()
.
Secrets
(
ns
)
.
Delete
(
testSecret
.
Name
,
nil
)
},
func
()
error
{
return
c
.
Core
V1
()
.
Secrets
(
ns
)
.
Delete
(
testSecret
.
Name
,
nil
)
},
}
}
for
_
,
op
:=
range
readOps
{
for
_
,
op
:=
range
readOps
{
...
...
test/integration/statefulset/statefulset_test.go
View file @
be8a9b96
...
@@ -85,7 +85,7 @@ func TestDeletingAndFailedPods(t *testing.T) {
...
@@ -85,7 +85,7 @@ func TestDeletingAndFailedPods(t *testing.T) {
waitSTSStable
(
t
,
c
,
sts
)
waitSTSStable
(
t
,
c
,
sts
)
// Verify STS creates 2 pods
// Verify STS creates 2 pods
podClient
:=
c
.
Core
()
.
Pods
(
ns
.
Name
)
podClient
:=
c
.
Core
V1
()
.
Pods
(
ns
.
Name
)
pods
:=
getPods
(
t
,
podClient
,
labelMap
)
pods
:=
getPods
(
t
,
podClient
,
labelMap
)
if
len
(
pods
.
Items
)
!=
2
{
if
len
(
pods
.
Items
)
!=
2
{
t
.
Fatalf
(
"len(pods) = %d, want 2"
,
len
(
pods
.
Items
))
t
.
Fatalf
(
"len(pods) = %d, want 2"
,
len
(
pods
.
Items
))
...
@@ -97,7 +97,7 @@ func TestDeletingAndFailedPods(t *testing.T) {
...
@@ -97,7 +97,7 @@ func TestDeletingAndFailedPods(t *testing.T) {
updatePod
(
t
,
podClient
,
deletingPod
.
Name
,
func
(
pod
*
v1
.
Pod
)
{
updatePod
(
t
,
podClient
,
deletingPod
.
Name
,
func
(
pod
*
v1
.
Pod
)
{
pod
.
Finalizers
=
[]
string
{
"fake.example.com/blockDeletion"
}
pod
.
Finalizers
=
[]
string
{
"fake.example.com/blockDeletion"
}
})
})
if
err
:=
c
.
Core
()
.
Pods
(
ns
.
Name
)
.
Delete
(
deletingPod
.
Name
,
&
metav1
.
DeleteOptions
{});
err
!=
nil
{
if
err
:=
c
.
Core
V1
()
.
Pods
(
ns
.
Name
)
.
Delete
(
deletingPod
.
Name
,
&
metav1
.
DeleteOptions
{});
err
!=
nil
{
t
.
Fatalf
(
"error deleting pod %s: %v"
,
deletingPod
.
Name
,
err
)
t
.
Fatalf
(
"error deleting pod %s: %v"
,
deletingPod
.
Name
,
err
)
}
}
...
...
test/integration/statefulset/util.go
View file @
be8a9b96
...
@@ -199,7 +199,7 @@ func runControllerAndInformers(sc *statefulset.StatefulSetController, informers
...
@@ -199,7 +199,7 @@ func runControllerAndInformers(sc *statefulset.StatefulSetController, informers
}
}
func
createHeadlessService
(
t
*
testing
.
T
,
clientSet
clientset
.
Interface
,
headlessService
*
v1
.
Service
)
{
func
createHeadlessService
(
t
*
testing
.
T
,
clientSet
clientset
.
Interface
,
headlessService
*
v1
.
Service
)
{
_
,
err
:=
clientSet
.
Core
()
.
Services
(
headlessService
.
Namespace
)
.
Create
(
headlessService
)
_
,
err
:=
clientSet
.
Core
V1
()
.
Services
(
headlessService
.
Namespace
)
.
Create
(
headlessService
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatalf
(
"failed creating headless service: %v"
,
err
)
t
.
Fatalf
(
"failed creating headless service: %v"
,
err
)
}
}
...
@@ -216,7 +216,7 @@ func createSTSsPods(t *testing.T, clientSet clientset.Interface, stss []*appsv1.
...
@@ -216,7 +216,7 @@ func createSTSsPods(t *testing.T, clientSet clientset.Interface, stss []*appsv1.
createdSTSs
=
append
(
createdSTSs
,
createdSTS
)
createdSTSs
=
append
(
createdSTSs
,
createdSTS
)
}
}
for
_
,
pod
:=
range
pods
{
for
_
,
pod
:=
range
pods
{
createdPod
,
err
:=
clientSet
.
Core
()
.
Pods
(
pod
.
Namespace
)
.
Create
(
pod
)
createdPod
,
err
:=
clientSet
.
Core
V1
()
.
Pods
(
pod
.
Namespace
)
.
Create
(
pod
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatalf
(
"failed to create pod %s: %v"
,
pod
.
Name
,
err
)
t
.
Fatalf
(
"failed to create pod %s: %v"
,
pod
.
Name
,
err
)
}
}
...
...
test/integration/ttlcontroller/ttlcontroller_test.go
View file @
be8a9b96
...
@@ -59,7 +59,7 @@ func createNodes(t *testing.T, client *clientset.Clientset, startIndex, endIndex
...
@@ -59,7 +59,7 @@ func createNodes(t *testing.T, client *clientset.Clientset, startIndex, endIndex
Name
:
fmt
.
Sprintf
(
"node-%d"
,
idx
),
Name
:
fmt
.
Sprintf
(
"node-%d"
,
idx
),
},
},
}
}
if
_
,
err
:=
client
.
Core
()
.
Nodes
()
.
Create
(
node
);
err
!=
nil
{
if
_
,
err
:=
client
.
Core
V1
()
.
Nodes
()
.
Create
(
node
);
err
!=
nil
{
t
.
Fatalf
(
"Failed to create node: %v"
,
err
)
t
.
Fatalf
(
"Failed to create node: %v"
,
err
)
}
}
}(
i
)
}(
i
)
...
@@ -74,7 +74,7 @@ func deleteNodes(t *testing.T, client *clientset.Clientset, startIndex, endIndex
...
@@ -74,7 +74,7 @@ func deleteNodes(t *testing.T, client *clientset.Clientset, startIndex, endIndex
go
func
(
idx
int
)
{
go
func
(
idx
int
)
{
defer
wg
.
Done
()
defer
wg
.
Done
()
name
:=
fmt
.
Sprintf
(
"node-%d"
,
idx
)
name
:=
fmt
.
Sprintf
(
"node-%d"
,
idx
)
if
err
:=
client
.
Core
()
.
Nodes
()
.
Delete
(
name
,
&
metav1
.
DeleteOptions
{});
err
!=
nil
{
if
err
:=
client
.
Core
V1
()
.
Nodes
()
.
Delete
(
name
,
&
metav1
.
DeleteOptions
{});
err
!=
nil
{
t
.
Fatalf
(
"Failed to delete node: %v"
,
err
)
t
.
Fatalf
(
"Failed to delete node: %v"
,
err
)
}
}
}(
i
)
}(
i
)
...
...
test/integration/volume/attach_detach_test.go
View file @
be8a9b96
...
@@ -162,13 +162,13 @@ func TestPodDeletionWithDswp(t *testing.T) {
...
@@ -162,13 +162,13 @@ func TestPodDeletionWithDswp(t *testing.T) {
pod
:=
fakePodWithVol
(
namespaceName
)
pod
:=
fakePodWithVol
(
namespaceName
)
podStopCh
:=
make
(
chan
struct
{})
podStopCh
:=
make
(
chan
struct
{})
if
_
,
err
:=
testClient
.
Core
()
.
Nodes
()
.
Create
(
node
);
err
!=
nil
{
if
_
,
err
:=
testClient
.
Core
V1
()
.
Nodes
()
.
Create
(
node
);
err
!=
nil
{
t
.
Fatalf
(
"Failed to created node : %v"
,
err
)
t
.
Fatalf
(
"Failed to created node : %v"
,
err
)
}
}
go
informers
.
Core
()
.
V1
()
.
Nodes
()
.
Informer
()
.
Run
(
podStopCh
)
go
informers
.
Core
()
.
V1
()
.
Nodes
()
.
Informer
()
.
Run
(
podStopCh
)
if
_
,
err
:=
testClient
.
Core
()
.
Pods
(
ns
.
Name
)
.
Create
(
pod
);
err
!=
nil
{
if
_
,
err
:=
testClient
.
Core
V1
()
.
Pods
(
ns
.
Name
)
.
Create
(
pod
);
err
!=
nil
{
t
.
Errorf
(
"Failed to create pod : %v"
,
err
)
t
.
Errorf
(
"Failed to create pod : %v"
,
err
)
}
}
...
@@ -229,13 +229,13 @@ func TestPodUpdateWithWithADC(t *testing.T) {
...
@@ -229,13 +229,13 @@ func TestPodUpdateWithWithADC(t *testing.T) {
pod
:=
fakePodWithVol
(
namespaceName
)
pod
:=
fakePodWithVol
(
namespaceName
)
podStopCh
:=
make
(
chan
struct
{})
podStopCh
:=
make
(
chan
struct
{})
if
_
,
err
:=
testClient
.
Core
()
.
Nodes
()
.
Create
(
node
);
err
!=
nil
{
if
_
,
err
:=
testClient
.
Core
V1
()
.
Nodes
()
.
Create
(
node
);
err
!=
nil
{
t
.
Fatalf
(
"Failed to created node : %v"
,
err
)
t
.
Fatalf
(
"Failed to created node : %v"
,
err
)
}
}
go
informers
.
Core
()
.
V1
()
.
Nodes
()
.
Informer
()
.
Run
(
podStopCh
)
go
informers
.
Core
()
.
V1
()
.
Nodes
()
.
Informer
()
.
Run
(
podStopCh
)
if
_
,
err
:=
testClient
.
Core
()
.
Pods
(
ns
.
Name
)
.
Create
(
pod
);
err
!=
nil
{
if
_
,
err
:=
testClient
.
Core
V1
()
.
Pods
(
ns
.
Name
)
.
Create
(
pod
);
err
!=
nil
{
t
.
Errorf
(
"Failed to create pod : %v"
,
err
)
t
.
Errorf
(
"Failed to create pod : %v"
,
err
)
}
}
...
@@ -264,7 +264,7 @@ func TestPodUpdateWithWithADC(t *testing.T) {
...
@@ -264,7 +264,7 @@ func TestPodUpdateWithWithADC(t *testing.T) {
pod
.
Status
.
Phase
=
v1
.
PodSucceeded
pod
.
Status
.
Phase
=
v1
.
PodSucceeded
if
_
,
err
:=
testClient
.
Core
()
.
Pods
(
ns
.
Name
)
.
UpdateStatus
(
pod
);
err
!=
nil
{
if
_
,
err
:=
testClient
.
Core
V1
()
.
Pods
(
ns
.
Name
)
.
UpdateStatus
(
pod
);
err
!=
nil
{
t
.
Errorf
(
"Failed to update pod : %v"
,
err
)
t
.
Errorf
(
"Failed to update pod : %v"
,
err
)
}
}
...
@@ -297,13 +297,13 @@ func TestPodUpdateWithKeepTerminatedPodVolumes(t *testing.T) {
...
@@ -297,13 +297,13 @@ func TestPodUpdateWithKeepTerminatedPodVolumes(t *testing.T) {
pod
:=
fakePodWithVol
(
namespaceName
)
pod
:=
fakePodWithVol
(
namespaceName
)
podStopCh
:=
make
(
chan
struct
{})
podStopCh
:=
make
(
chan
struct
{})
if
_
,
err
:=
testClient
.
Core
()
.
Nodes
()
.
Create
(
node
);
err
!=
nil
{
if
_
,
err
:=
testClient
.
Core
V1
()
.
Nodes
()
.
Create
(
node
);
err
!=
nil
{
t
.
Fatalf
(
"Failed to created node : %v"
,
err
)
t
.
Fatalf
(
"Failed to created node : %v"
,
err
)
}
}
go
informers
.
Core
()
.
V1
()
.
Nodes
()
.
Informer
()
.
Run
(
podStopCh
)
go
informers
.
Core
()
.
V1
()
.
Nodes
()
.
Informer
()
.
Run
(
podStopCh
)
if
_
,
err
:=
testClient
.
Core
()
.
Pods
(
ns
.
Name
)
.
Create
(
pod
);
err
!=
nil
{
if
_
,
err
:=
testClient
.
Core
V1
()
.
Pods
(
ns
.
Name
)
.
Create
(
pod
);
err
!=
nil
{
t
.
Errorf
(
"Failed to create pod : %v"
,
err
)
t
.
Errorf
(
"Failed to create pod : %v"
,
err
)
}
}
...
@@ -332,7 +332,7 @@ func TestPodUpdateWithKeepTerminatedPodVolumes(t *testing.T) {
...
@@ -332,7 +332,7 @@ func TestPodUpdateWithKeepTerminatedPodVolumes(t *testing.T) {
pod
.
Status
.
Phase
=
v1
.
PodSucceeded
pod
.
Status
.
Phase
=
v1
.
PodSucceeded
if
_
,
err
:=
testClient
.
Core
()
.
Pods
(
ns
.
Name
)
.
UpdateStatus
(
pod
);
err
!=
nil
{
if
_
,
err
:=
testClient
.
Core
V1
()
.
Pods
(
ns
.
Name
)
.
UpdateStatus
(
pod
);
err
!=
nil
{
t
.
Errorf
(
"Failed to update pod : %v"
,
err
)
t
.
Errorf
(
"Failed to update pod : %v"
,
err
)
}
}
...
@@ -474,13 +474,13 @@ func TestPodAddedByDswp(t *testing.T) {
...
@@ -474,13 +474,13 @@ func TestPodAddedByDswp(t *testing.T) {
pod
:=
fakePodWithVol
(
namespaceName
)
pod
:=
fakePodWithVol
(
namespaceName
)
podStopCh
:=
make
(
chan
struct
{})
podStopCh
:=
make
(
chan
struct
{})
if
_
,
err
:=
testClient
.
Core
()
.
Nodes
()
.
Create
(
node
);
err
!=
nil
{
if
_
,
err
:=
testClient
.
Core
V1
()
.
Nodes
()
.
Create
(
node
);
err
!=
nil
{
t
.
Fatalf
(
"Failed to created node : %v"
,
err
)
t
.
Fatalf
(
"Failed to created node : %v"
,
err
)
}
}
go
informers
.
Core
()
.
V1
()
.
Nodes
()
.
Informer
()
.
Run
(
podStopCh
)
go
informers
.
Core
()
.
V1
()
.
Nodes
()
.
Informer
()
.
Run
(
podStopCh
)
if
_
,
err
:=
testClient
.
Core
()
.
Pods
(
ns
.
Name
)
.
Create
(
pod
);
err
!=
nil
{
if
_
,
err
:=
testClient
.
Core
V1
()
.
Pods
(
ns
.
Name
)
.
Create
(
pod
);
err
!=
nil
{
t
.
Errorf
(
"Failed to create pod : %v"
,
err
)
t
.
Errorf
(
"Failed to create pod : %v"
,
err
)
}
}
...
@@ -549,7 +549,7 @@ func TestPVCBoundWithADC(t *testing.T) {
...
@@ -549,7 +549,7 @@ func TestPVCBoundWithADC(t *testing.T) {
},
},
},
},
}
}
if
_
,
err
:=
testClient
.
Core
()
.
Nodes
()
.
Create
(
node
);
err
!=
nil
{
if
_
,
err
:=
testClient
.
Core
V1
()
.
Nodes
()
.
Create
(
node
);
err
!=
nil
{
t
.
Fatalf
(
"Failed to created node : %v"
,
err
)
t
.
Fatalf
(
"Failed to created node : %v"
,
err
)
}
}
...
@@ -557,10 +557,10 @@ func TestPVCBoundWithADC(t *testing.T) {
...
@@ -557,10 +557,10 @@ func TestPVCBoundWithADC(t *testing.T) {
pvcs
:=
[]
*
v1
.
PersistentVolumeClaim
{}
pvcs
:=
[]
*
v1
.
PersistentVolumeClaim
{}
for
i
:=
0
;
i
<
3
;
i
++
{
for
i
:=
0
;
i
<
3
;
i
++
{
pod
,
pvc
:=
fakePodWithPVC
(
fmt
.
Sprintf
(
"fakepod-pvcnotbound-%d"
,
i
),
fmt
.
Sprintf
(
"fakepvc-%d"
,
i
),
namespaceName
)
pod
,
pvc
:=
fakePodWithPVC
(
fmt
.
Sprintf
(
"fakepod-pvcnotbound-%d"
,
i
),
fmt
.
Sprintf
(
"fakepvc-%d"
,
i
),
namespaceName
)
if
_
,
err
:=
testClient
.
Core
()
.
Pods
(
pod
.
Namespace
)
.
Create
(
pod
);
err
!=
nil
{
if
_
,
err
:=
testClient
.
Core
V1
()
.
Pods
(
pod
.
Namespace
)
.
Create
(
pod
);
err
!=
nil
{
t
.
Errorf
(
"Failed to create pod : %v"
,
err
)
t
.
Errorf
(
"Failed to create pod : %v"
,
err
)
}
}
if
_
,
err
:=
testClient
.
Core
()
.
PersistentVolumeClaims
(
pvc
.
Namespace
)
.
Create
(
pvc
);
err
!=
nil
{
if
_
,
err
:=
testClient
.
Core
V1
()
.
PersistentVolumeClaims
(
pvc
.
Namespace
)
.
Create
(
pvc
);
err
!=
nil
{
t
.
Errorf
(
"Failed to create pvc : %v"
,
err
)
t
.
Errorf
(
"Failed to create pvc : %v"
,
err
)
}
}
pvcs
=
append
(
pvcs
,
pvc
)
pvcs
=
append
(
pvcs
,
pvc
)
...
@@ -568,7 +568,7 @@ func TestPVCBoundWithADC(t *testing.T) {
...
@@ -568,7 +568,7 @@ func TestPVCBoundWithADC(t *testing.T) {
// pod with no pvc
// pod with no pvc
podNew
:=
fakePodWithVol
(
namespaceName
)
podNew
:=
fakePodWithVol
(
namespaceName
)
podNew
.
SetName
(
"fakepod"
)
podNew
.
SetName
(
"fakepod"
)
if
_
,
err
:=
testClient
.
Core
()
.
Pods
(
podNew
.
Namespace
)
.
Create
(
podNew
);
err
!=
nil
{
if
_
,
err
:=
testClient
.
Core
V1
()
.
Pods
(
podNew
.
Namespace
)
.
Create
(
podNew
);
err
!=
nil
{
t
.
Errorf
(
"Failed to create pod : %v"
,
err
)
t
.
Errorf
(
"Failed to create pod : %v"
,
err
)
}
}
...
@@ -608,7 +608,7 @@ func createPVForPVC(t *testing.T, testClient *clientset.Clientset, pvc *v1.Persi
...
@@ -608,7 +608,7 @@ func createPVForPVC(t *testing.T, testClient *clientset.Clientset, pvc *v1.Persi
StorageClassName
:
*
pvc
.
Spec
.
StorageClassName
,
StorageClassName
:
*
pvc
.
Spec
.
StorageClassName
,
},
},
}
}
if
_
,
err
:=
testClient
.
Core
()
.
PersistentVolumes
()
.
Create
(
pv
);
err
!=
nil
{
if
_
,
err
:=
testClient
.
Core
V1
()
.
PersistentVolumes
()
.
Create
(
pv
);
err
!=
nil
{
t
.
Errorf
(
"Failed to create pv : %v"
,
err
)
t
.
Errorf
(
"Failed to create pv : %v"
,
err
)
}
}
}
}
test/integration/volume/persistent_volumes_test.go
View file @
be8a9b96
...
@@ -116,7 +116,7 @@ func TestPersistentVolumeRecycler(t *testing.T) {
...
@@ -116,7 +116,7 @@ func TestPersistentVolumeRecycler(t *testing.T) {
// NOTE: This test cannot run in parallel, because it is creating and deleting
// NOTE: This test cannot run in parallel, because it is creating and deleting
// non-namespaced objects (PersistenceVolumes).
// non-namespaced objects (PersistenceVolumes).
defer
testClient
.
Core
()
.
PersistentVolumes
()
.
DeleteCollection
(
nil
,
metav1
.
ListOptions
{})
defer
testClient
.
Core
V1
()
.
PersistentVolumes
()
.
DeleteCollection
(
nil
,
metav1
.
ListOptions
{})
stopCh
:=
make
(
chan
struct
{})
stopCh
:=
make
(
chan
struct
{})
informers
.
Start
(
stopCh
)
informers
.
Start
(
stopCh
)
...
@@ -171,7 +171,7 @@ func TestPersistentVolumeDeleter(t *testing.T) {
...
@@ -171,7 +171,7 @@ func TestPersistentVolumeDeleter(t *testing.T) {
// NOTE: This test cannot run in parallel, because it is creating and deleting
// NOTE: This test cannot run in parallel, because it is creating and deleting
// non-namespaced objects (PersistenceVolumes).
// non-namespaced objects (PersistenceVolumes).
defer
testClient
.
Core
()
.
PersistentVolumes
()
.
DeleteCollection
(
nil
,
metav1
.
ListOptions
{})
defer
testClient
.
Core
V1
()
.
PersistentVolumes
()
.
DeleteCollection
(
nil
,
metav1
.
ListOptions
{})
stopCh
:=
make
(
chan
struct
{})
stopCh
:=
make
(
chan
struct
{})
informers
.
Start
(
stopCh
)
informers
.
Start
(
stopCh
)
...
@@ -231,7 +231,7 @@ func TestPersistentVolumeBindRace(t *testing.T) {
...
@@ -231,7 +231,7 @@ func TestPersistentVolumeBindRace(t *testing.T) {
// NOTE: This test cannot run in parallel, because it is creating and deleting
// NOTE: This test cannot run in parallel, because it is creating and deleting
// non-namespaced objects (PersistenceVolumes).
// non-namespaced objects (PersistenceVolumes).
defer
testClient
.
Core
()
.
PersistentVolumes
()
.
DeleteCollection
(
nil
,
metav1
.
ListOptions
{})
defer
testClient
.
Core
V1
()
.
PersistentVolumes
()
.
DeleteCollection
(
nil
,
metav1
.
ListOptions
{})
stopCh
:=
make
(
chan
struct
{})
stopCh
:=
make
(
chan
struct
{})
informers
.
Start
(
stopCh
)
informers
.
Start
(
stopCh
)
...
@@ -301,7 +301,7 @@ func TestPersistentVolumeClaimLabelSelector(t *testing.T) {
...
@@ -301,7 +301,7 @@ func TestPersistentVolumeClaimLabelSelector(t *testing.T) {
// NOTE: This test cannot run in parallel, because it is creating and deleting
// NOTE: This test cannot run in parallel, because it is creating and deleting
// non-namespaced objects (PersistenceVolumes).
// non-namespaced objects (PersistenceVolumes).
defer
testClient
.
Core
()
.
PersistentVolumes
()
.
DeleteCollection
(
nil
,
metav1
.
ListOptions
{})
defer
testClient
.
Core
V1
()
.
PersistentVolumes
()
.
DeleteCollection
(
nil
,
metav1
.
ListOptions
{})
stopCh
:=
make
(
chan
struct
{})
stopCh
:=
make
(
chan
struct
{})
informers
.
Start
(
stopCh
)
informers
.
Start
(
stopCh
)
...
@@ -382,7 +382,7 @@ func TestPersistentVolumeClaimLabelSelectorMatchExpressions(t *testing.T) {
...
@@ -382,7 +382,7 @@ func TestPersistentVolumeClaimLabelSelectorMatchExpressions(t *testing.T) {
// NOTE: This test cannot run in parallel, because it is creating and deleting
// NOTE: This test cannot run in parallel, because it is creating and deleting
// non-namespaced objects (PersistenceVolumes).
// non-namespaced objects (PersistenceVolumes).
defer
testClient
.
Core
()
.
PersistentVolumes
()
.
DeleteCollection
(
nil
,
metav1
.
ListOptions
{})
defer
testClient
.
Core
V1
()
.
PersistentVolumes
()
.
DeleteCollection
(
nil
,
metav1
.
ListOptions
{})
stopCh
:=
make
(
chan
struct
{})
stopCh
:=
make
(
chan
struct
{})
informers
.
Start
(
stopCh
)
informers
.
Start
(
stopCh
)
...
@@ -482,7 +482,7 @@ func TestPersistentVolumeMultiPVs(t *testing.T) {
...
@@ -482,7 +482,7 @@ func TestPersistentVolumeMultiPVs(t *testing.T) {
// NOTE: This test cannot run in parallel, because it is creating and deleting
// NOTE: This test cannot run in parallel, because it is creating and deleting
// non-namespaced objects (PersistenceVolumes).
// non-namespaced objects (PersistenceVolumes).
defer
testClient
.
Core
()
.
PersistentVolumes
()
.
DeleteCollection
(
nil
,
metav1
.
ListOptions
{})
defer
testClient
.
Core
V1
()
.
PersistentVolumes
()
.
DeleteCollection
(
nil
,
metav1
.
ListOptions
{})
stopCh
:=
make
(
chan
struct
{})
stopCh
:=
make
(
chan
struct
{})
informers
.
Start
(
stopCh
)
informers
.
Start
(
stopCh
)
...
@@ -572,7 +572,7 @@ func TestPersistentVolumeMultiPVsPVCs(t *testing.T) {
...
@@ -572,7 +572,7 @@ func TestPersistentVolumeMultiPVsPVCs(t *testing.T) {
// NOTE: This test cannot run in parallel, because it is creating and deleting
// NOTE: This test cannot run in parallel, because it is creating and deleting
// non-namespaced objects (PersistenceVolumes).
// non-namespaced objects (PersistenceVolumes).
defer
testClient
.
Core
()
.
PersistentVolumes
()
.
DeleteCollection
(
nil
,
metav1
.
ListOptions
{})
defer
testClient
.
Core
V1
()
.
PersistentVolumes
()
.
DeleteCollection
(
nil
,
metav1
.
ListOptions
{})
controllerStopCh
:=
make
(
chan
struct
{})
controllerStopCh
:=
make
(
chan
struct
{})
informers
.
Start
(
controllerStopCh
)
informers
.
Start
(
controllerStopCh
)
...
@@ -862,7 +862,7 @@ func TestPersistentVolumeProvisionMultiPVCs(t *testing.T) {
...
@@ -862,7 +862,7 @@ func TestPersistentVolumeProvisionMultiPVCs(t *testing.T) {
// NOTE: This test cannot run in parallel, because it is creating and deleting
// NOTE: This test cannot run in parallel, because it is creating and deleting
// non-namespaced objects (PersistenceVolumes and StorageClasses).
// non-namespaced objects (PersistenceVolumes and StorageClasses).
defer
testClient
.
Core
()
.
PersistentVolumes
()
.
DeleteCollection
(
nil
,
metav1
.
ListOptions
{})
defer
testClient
.
Core
V1
()
.
PersistentVolumes
()
.
DeleteCollection
(
nil
,
metav1
.
ListOptions
{})
defer
testClient
.
StorageV1
()
.
StorageClasses
()
.
DeleteCollection
(
nil
,
metav1
.
ListOptions
{})
defer
testClient
.
StorageV1
()
.
StorageClasses
()
.
DeleteCollection
(
nil
,
metav1
.
ListOptions
{})
storageClass
:=
storage
.
StorageClass
{
storageClass
:=
storage
.
StorageClass
{
...
@@ -957,7 +957,7 @@ func TestPersistentVolumeMultiPVsDiffAccessModes(t *testing.T) {
...
@@ -957,7 +957,7 @@ func TestPersistentVolumeMultiPVsDiffAccessModes(t *testing.T) {
// NOTE: This test cannot run in parallel, because it is creating and deleting
// NOTE: This test cannot run in parallel, because it is creating and deleting
// non-namespaced objects (PersistenceVolumes).
// non-namespaced objects (PersistenceVolumes).
defer
testClient
.
Core
()
.
PersistentVolumes
()
.
DeleteCollection
(
nil
,
metav1
.
ListOptions
{})
defer
testClient
.
Core
V1
()
.
PersistentVolumes
()
.
DeleteCollection
(
nil
,
metav1
.
ListOptions
{})
stopCh
:=
make
(
chan
struct
{})
stopCh
:=
make
(
chan
struct
{})
informers
.
Start
(
stopCh
)
informers
.
Start
(
stopCh
)
...
@@ -1025,7 +1025,7 @@ func TestPersistentVolumeMultiPVsDiffAccessModes(t *testing.T) {
...
@@ -1025,7 +1025,7 @@ func TestPersistentVolumeMultiPVsDiffAccessModes(t *testing.T) {
func
waitForPersistentVolumePhase
(
client
*
clientset
.
Clientset
,
pvName
string
,
w
watch
.
Interface
,
phase
v1
.
PersistentVolumePhase
)
{
func
waitForPersistentVolumePhase
(
client
*
clientset
.
Clientset
,
pvName
string
,
w
watch
.
Interface
,
phase
v1
.
PersistentVolumePhase
)
{
// Check if the volume is already in requested phase
// Check if the volume is already in requested phase
volume
,
err
:=
client
.
Core
()
.
PersistentVolumes
()
.
Get
(
pvName
,
metav1
.
GetOptions
{})
volume
,
err
:=
client
.
Core
V1
()
.
PersistentVolumes
()
.
Get
(
pvName
,
metav1
.
GetOptions
{})
if
err
==
nil
&&
volume
.
Status
.
Phase
==
phase
{
if
err
==
nil
&&
volume
.
Status
.
Phase
==
phase
{
return
return
}
}
...
@@ -1046,7 +1046,7 @@ func waitForPersistentVolumePhase(client *clientset.Clientset, pvName string, w
...
@@ -1046,7 +1046,7 @@ func waitForPersistentVolumePhase(client *clientset.Clientset, pvName string, w
func
waitForPersistentVolumeClaimPhase
(
client
*
clientset
.
Clientset
,
claimName
,
namespace
string
,
w
watch
.
Interface
,
phase
v1
.
PersistentVolumeClaimPhase
)
{
func
waitForPersistentVolumeClaimPhase
(
client
*
clientset
.
Clientset
,
claimName
,
namespace
string
,
w
watch
.
Interface
,
phase
v1
.
PersistentVolumeClaimPhase
)
{
// Check if the claim is already in requested phase
// Check if the claim is already in requested phase
claim
,
err
:=
client
.
Core
()
.
PersistentVolumeClaims
(
namespace
)
.
Get
(
claimName
,
metav1
.
GetOptions
{})
claim
,
err
:=
client
.
Core
V1
()
.
PersistentVolumeClaims
(
namespace
)
.
Get
(
claimName
,
metav1
.
GetOptions
{})
if
err
==
nil
&&
claim
.
Status
.
Phase
==
phase
{
if
err
==
nil
&&
claim
.
Status
.
Phase
==
phase
{
return
return
}
}
...
...
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