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
44b2c862
Commit
44b2c862
authored
Aug 26, 2016
by
Matt Liggett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rewrite disruption e2e test to use versioned client.
parent
1919fe3a
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
13 deletions
+13
-13
update-codegen.sh
hack/update-codegen.sh
+1
-1
types.go
pkg/apis/policy/v1alpha1/types.go
+0
-1
import_known_versions.go
.../clientset_generated/release_1_4/import_known_versions.go
+1
-0
disruption.go
test/e2e/disruption.go
+11
-11
No files found.
hack/update-codegen.sh
View file @
44b2c862
...
@@ -39,7 +39,7 @@ setgen=$(kube::util::find-binary "set-gen")
...
@@ -39,7 +39,7 @@ setgen=$(kube::util::find-binary "set-gen")
# update- and verify- scripts.
# update- and verify- scripts.
${
clientgen
}
"
$@
"
${
clientgen
}
"
$@
"
${
clientgen
}
-t
"
$@
"
${
clientgen
}
-t
"
$@
"
${
clientgen
}
--clientset-name
=
"release_1_4"
--input
=
"api/v1,authorization/v1beta1,autoscaling/v1,batch/v1,extensions/v1beta1"
${
clientgen
}
--clientset-name
=
"release_1_4"
--input
=
"api/v1,authorization/v1beta1,autoscaling/v1,batch/v1,extensions/v1beta1
,policy/v1alpha1
"
# Clientgen for federation clientset.
# Clientgen for federation clientset.
${
clientgen
}
--clientset-name
=
federation_internalclientset
--clientset-path
=
k8s.io/kubernetes/federation/client/clientset_generated
--input
=
"../../federation/apis/federation/"
,
"api/"
,
"extensions/"
--included-types-overrides
=
"api/Service,api/Namespace,extensions/ReplicaSet,api/Secret,extensions/Ingress,api/Event"
"
$@
"
${
clientgen
}
--clientset-name
=
federation_internalclientset
--clientset-path
=
k8s.io/kubernetes/federation/client/clientset_generated
--input
=
"../../federation/apis/federation/"
,
"api/"
,
"extensions/"
--included-types-overrides
=
"api/Service,api/Namespace,extensions/ReplicaSet,api/Secret,extensions/Ingress,api/Event"
"
$@
"
${
clientgen
}
--clientset-name
=
federation_release_1_4
--clientset-path
=
k8s.io/kubernetes/federation/client/clientset_generated
--input
=
"../../federation/apis/federation/v1beta1"
,
"api/v1"
,
"extensions/v1beta1"
--included-types-overrides
=
"api/v1/Service,api/v1/Namespace,extensions/v1beta1/ReplicaSet,api/v1/Secret,extensions/v1beta1/Ingress,api/v1/Event"
"
$@
"
${
clientgen
}
--clientset-name
=
federation_release_1_4
--clientset-path
=
k8s.io/kubernetes/federation/client/clientset_generated
--input
=
"../../federation/apis/federation/v1beta1"
,
"api/v1"
,
"extensions/v1beta1"
--included-types-overrides
=
"api/v1/Service,api/v1/Namespace,extensions/v1beta1/ReplicaSet,api/v1/Secret,extensions/v1beta1/Ingress,api/v1/Event"
"
$@
"
...
...
pkg/apis/policy/v1alpha1/types.go
View file @
44b2c862
...
@@ -50,7 +50,6 @@ type PodDisruptionBudgetStatus struct {
...
@@ -50,7 +50,6 @@ type PodDisruptionBudgetStatus struct {
}
}
// +genclient=true
// +genclient=true
// +noMethods=true
// PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods
// PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods
type
PodDisruptionBudget
struct
{
type
PodDisruptionBudget
struct
{
...
...
pkg/client/clientset_generated/release_1_4/import_known_versions.go
View file @
44b2c862
...
@@ -26,6 +26,7 @@ import (
...
@@ -26,6 +26,7 @@ import (
_
"k8s.io/kubernetes/pkg/apis/autoscaling/install"
_
"k8s.io/kubernetes/pkg/apis/autoscaling/install"
_
"k8s.io/kubernetes/pkg/apis/batch/install"
_
"k8s.io/kubernetes/pkg/apis/batch/install"
_
"k8s.io/kubernetes/pkg/apis/extensions/install"
_
"k8s.io/kubernetes/pkg/apis/extensions/install"
_
"k8s.io/kubernetes/pkg/apis/policy/install"
)
)
func
init
()
{
func
init
()
{
...
...
test/e2e/disruption.go
View file @
44b2c862
...
@@ -22,11 +22,11 @@ import (
...
@@ -22,11 +22,11 @@ import (
.
"github.com/onsi/ginkgo"
.
"github.com/onsi/ginkgo"
.
"github.com/onsi/gomega"
.
"github.com/onsi/gomega"
"k8s.io/kubernetes/pkg/api
"
release_1_4
"k8s.io/client-go/1.4/kubernetes
"
"k8s.io/
kubernetes
/pkg/api/unversioned"
"k8s.io/
client-go/1.4
/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/apis/policy
"
api
"k8s.io/client-go/1.4/pkg/api/v1
"
client
"k8s.io/kubernetes/pkg/client/unversioned
"
policy
"k8s.io/client-go/1.4/pkg/apis/policy/v1alpha1
"
"k8s.io/
kubernetes
/pkg/util/intstr"
"k8s.io/
client-go/1.4
/pkg/util/intstr"
"k8s.io/kubernetes/pkg/util/wait"
"k8s.io/kubernetes/pkg/util/wait"
"k8s.io/kubernetes/test/e2e/framework"
"k8s.io/kubernetes/test/e2e/framework"
)
)
...
@@ -34,10 +34,10 @@ import (
...
@@ -34,10 +34,10 @@ import (
var
_
=
framework
.
KubeDescribe
(
"DisruptionController [Feature:PodDisruptionbudget]"
,
func
()
{
var
_
=
framework
.
KubeDescribe
(
"DisruptionController [Feature:PodDisruptionbudget]"
,
func
()
{
f
:=
framework
.
NewDefaultFramework
(
"disruption"
)
f
:=
framework
.
NewDefaultFramework
(
"disruption"
)
var
ns
string
var
ns
string
var
c
*
client
.
Clien
t
var
c
s
*
release_1_4
.
Clientse
t
BeforeEach
(
func
()
{
BeforeEach
(
func
()
{
c
=
f
.
Client
c
s
=
f
.
Staging
Client
ns
=
f
.
Namespace
.
Name
ns
=
f
.
Namespace
.
Name
})
})
...
@@ -52,7 +52,7 @@ var _ = framework.KubeDescribe("DisruptionController [Feature:PodDisruptionbudge
...
@@ -52,7 +52,7 @@ var _ = framework.KubeDescribe("DisruptionController [Feature:PodDisruptionbudge
MinAvailable
:
intstr
.
FromString
(
"1%"
),
MinAvailable
:
intstr
.
FromString
(
"1%"
),
},
},
}
}
_
,
err
:=
c
.
Policy
()
.
PodDisruptionBudgets
(
ns
)
.
Create
(
&
pdb
)
_
,
err
:=
c
s
.
Policy
()
.
PodDisruptionBudgets
(
ns
)
.
Create
(
&
pdb
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
})
})
...
@@ -67,7 +67,7 @@ var _ = framework.KubeDescribe("DisruptionController [Feature:PodDisruptionbudge
...
@@ -67,7 +67,7 @@ var _ = framework.KubeDescribe("DisruptionController [Feature:PodDisruptionbudge
MinAvailable
:
intstr
.
FromInt
(
2
),
MinAvailable
:
intstr
.
FromInt
(
2
),
},
},
}
}
_
,
err
:=
c
.
Policy
()
.
PodDisruptionBudgets
(
ns
)
.
Create
(
&
pdb
)
_
,
err
:=
c
s
.
Policy
()
.
PodDisruptionBudgets
(
ns
)
.
Create
(
&
pdb
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
for
i
:=
0
;
i
<
2
;
i
++
{
for
i
:=
0
;
i
<
2
;
i
++
{
pod
:=
&
api
.
Pod
{
pod
:=
&
api
.
Pod
{
...
@@ -87,11 +87,11 @@ var _ = framework.KubeDescribe("DisruptionController [Feature:PodDisruptionbudge
...
@@ -87,11 +87,11 @@ var _ = framework.KubeDescribe("DisruptionController [Feature:PodDisruptionbudge
},
},
}
}
_
,
err
:=
c
.
Pods
(
ns
)
.
Create
(
pod
)
_
,
err
:=
c
s
.
Pods
(
ns
)
.
Create
(
pod
)
framework
.
ExpectNoError
(
err
,
"Creating pod %q in namespace %q"
,
pod
.
Name
,
ns
)
framework
.
ExpectNoError
(
err
,
"Creating pod %q in namespace %q"
,
pod
.
Name
,
ns
)
}
}
err
=
wait
.
PollImmediate
(
framework
.
Poll
,
60
*
time
.
Second
,
func
()
(
bool
,
error
)
{
err
=
wait
.
PollImmediate
(
framework
.
Poll
,
60
*
time
.
Second
,
func
()
(
bool
,
error
)
{
pdb
,
err
:=
c
.
Policy
()
.
PodDisruptionBudgets
(
ns
)
.
Get
(
"foo"
)
pdb
,
err
:=
c
s
.
Policy
()
.
PodDisruptionBudgets
(
ns
)
.
Get
(
"foo"
)
if
err
!=
nil
{
if
err
!=
nil
{
return
false
,
err
return
false
,
err
}
}
...
...
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