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
2db115ce
Unverified
Commit
2db115ce
authored
May 29, 2018
by
Maciej Szulik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wait for the job to be removed
parent
c5f46f9e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
jobs_util.go
test/e2e/framework/jobs_util.go
+11
-0
kubectl.go
test/e2e/kubectl/kubectl.go
+4
-1
No files found.
test/e2e/framework/jobs_util.go
View file @
2db115ce
...
@@ -210,6 +210,17 @@ func WaitForJobFailure(c clientset.Interface, ns, jobName string, timeout time.D
...
@@ -210,6 +210,17 @@ func WaitForJobFailure(c clientset.Interface, ns, jobName string, timeout time.D
})
})
}
}
// WaitForJobGone uses c to wait for up to timeout for the Job named jobName in namespace ns to be removed.
func
WaitForJobGone
(
c
clientset
.
Interface
,
ns
,
jobName
string
,
timeout
time
.
Duration
)
error
{
return
wait
.
Poll
(
Poll
,
timeout
,
func
()
(
bool
,
error
)
{
_
,
err
:=
c
.
BatchV1
()
.
Jobs
(
ns
)
.
Get
(
jobName
,
metav1
.
GetOptions
{})
if
errors
.
IsNotFound
(
err
)
{
return
true
,
nil
}
return
false
,
err
})
}
// CheckForAllJobPodsRunning uses c to check in the Job named jobName in ns is running. If the returned error is not
// CheckForAllJobPodsRunning uses c to check in the Job named jobName in ns is running. If the returned error is not
// nil the returned bool is true if the Job is running.
// nil the returned bool is true if the Job is running.
func
CheckForAllJobPodsRunning
(
c
clientset
.
Interface
,
ns
,
jobName
string
,
parallelism
int32
)
(
bool
,
error
)
{
func
CheckForAllJobPodsRunning
(
c
clientset
.
Interface
,
ns
,
jobName
string
,
parallelism
int32
)
(
bool
,
error
)
{
...
...
test/e2e/kubectl/kubectl.go
View file @
2db115ce
...
@@ -1444,8 +1444,11 @@ metadata:
...
@@ -1444,8 +1444,11 @@ metadata:
Expect
(
runOutput
)
.
To
(
ContainSubstring
(
"abcd1234"
))
Expect
(
runOutput
)
.
To
(
ContainSubstring
(
"abcd1234"
))
Expect
(
runOutput
)
.
To
(
ContainSubstring
(
"stdin closed"
))
Expect
(
runOutput
)
.
To
(
ContainSubstring
(
"stdin closed"
))
err
:=
framework
.
WaitForJobGone
(
c
,
ns
,
jobName
,
wait
.
ForeverTestTimeout
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
By
(
"verifying the job "
+
jobName
+
" was deleted"
)
By
(
"verifying the job "
+
jobName
+
" was deleted"
)
_
,
err
:
=
c
.
BatchV1
()
.
Jobs
(
ns
)
.
Get
(
jobName
,
metav1
.
GetOptions
{})
_
,
err
=
c
.
BatchV1
()
.
Jobs
(
ns
)
.
Get
(
jobName
,
metav1
.
GetOptions
{})
Expect
(
err
)
.
To
(
HaveOccurred
())
Expect
(
err
)
.
To
(
HaveOccurred
())
Expect
(
apierrs
.
IsNotFound
(
err
))
.
To
(
BeTrue
())
Expect
(
apierrs
.
IsNotFound
(
err
))
.
To
(
BeTrue
())
})
})
...
...
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