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
83c1ef48
Commit
83c1ef48
authored
Feb 01, 2017
by
Michail Kargakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: move deployment helper in testing framework
parent
96cfe7b9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
0 deletions
+30
-0
deployment.go
test/e2e/deployment.go
+0
-0
util.go
test/e2e/framework/util.go
+30
-0
No files found.
test/e2e/deployment.go
View file @
83c1ef48
This diff is collapsed.
Click to expand it.
test/e2e/framework/util.go
View file @
83c1ef48
...
@@ -3075,6 +3075,36 @@ func WaitForReadyReplicaSet(c clientset.Interface, ns, name string) error {
...
@@ -3075,6 +3075,36 @@ func WaitForReadyReplicaSet(c clientset.Interface, ns, name string) error {
return
err
return
err
}
}
func
NewDeployment
(
deploymentName
string
,
replicas
int32
,
podLabels
map
[
string
]
string
,
imageName
,
image
string
,
strategyType
extensions
.
DeploymentStrategyType
)
*
extensions
.
Deployment
{
zero
:=
int64
(
0
)
return
&
extensions
.
Deployment
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
deploymentName
,
},
Spec
:
extensions
.
DeploymentSpec
{
Replicas
:
func
(
i
int32
)
*
int32
{
return
&
i
}(
replicas
),
Selector
:
&
metav1
.
LabelSelector
{
MatchLabels
:
podLabels
},
Strategy
:
extensions
.
DeploymentStrategy
{
Type
:
strategyType
,
},
Template
:
v1
.
PodTemplateSpec
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Labels
:
podLabels
,
},
Spec
:
v1
.
PodSpec
{
TerminationGracePeriodSeconds
:
&
zero
,
Containers
:
[]
v1
.
Container
{
{
Name
:
imageName
,
Image
:
image
,
},
},
},
},
},
}
}
// Waits for the deployment status to become valid (i.e. max unavailable and max surge aren't violated anymore).
// Waits for the deployment status to become valid (i.e. max unavailable and max surge aren't violated anymore).
// Note that the status should stay valid at all times unless shortly after a scaling event or the deployment is just created.
// Note that the status should stay valid at all times unless shortly after a scaling event or the deployment is just created.
// To verify that the deployment status is valid and wait for the rollout to finish, use WaitForDeploymentStatus instead.
// To verify that the deployment status is valid and wait for the rollout to finish, use WaitForDeploymentStatus instead.
...
...
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