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
7707aac2
Commit
7707aac2
authored
Jan 26, 2017
by
Jeff Vance
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor pv code for readability
parent
1bbd9dfa
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
33 deletions
+7
-33
BUILD
test/e2e/BUILD
+1
-0
kubelet.go
test/e2e/kubelet.go
+4
-31
persistent_volumes-disruptive.go
test/e2e/persistent_volumes-disruptive.go
+2
-2
persistent_volumes.go
test/e2e/persistent_volumes.go
+0
-0
pvutil.go
test/e2e/pvutil.go
+0
-0
No files found.
test/e2e/BUILD
View file @
7707aac2
...
@@ -74,6 +74,7 @@ go_library(
...
@@ -74,6 +74,7 @@ go_library(
"portforward.go",
"portforward.go",
"pre_stop.go",
"pre_stop.go",
"proxy.go",
"proxy.go",
"pvutil.go",
"rc.go",
"rc.go",
"reboot.go",
"reboot.go",
"replica_set.go",
"replica_set.go",
...
...
test/e2e/kubelet.go
View file @
7707aac2
...
@@ -22,7 +22,6 @@ import (
...
@@ -22,7 +22,6 @@ import (
"strings"
"strings"
"time"
"time"
apierrs
"k8s.io/apimachinery/pkg/api/errors"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/apimachinery/pkg/util/uuid"
"k8s.io/apimachinery/pkg/util/uuid"
...
@@ -209,32 +208,6 @@ func createPodUsingNfs(f *framework.Framework, c clientset.Interface, ns, nfsIP,
...
@@ -209,32 +208,6 @@ func createPodUsingNfs(f *framework.Framework, c clientset.Interface, ns, nfsIP,
return
rtnPod
return
rtnPod
}
}
// Deletes the passed-in pod and waits for the pod to be terminated. Resilient to the pod
// not existing.
func
deletePodwithWait
(
f
*
framework
.
Framework
,
c
clientset
.
Interface
,
pod
*
v1
.
Pod
)
{
if
pod
==
nil
{
return
}
framework
.
Logf
(
"Deleting pod %v"
,
pod
.
Name
)
err
:=
c
.
Core
()
.
Pods
(
pod
.
Namespace
)
.
Delete
(
pod
.
Name
,
nil
)
if
err
!=
nil
{
if
apierrs
.
IsNotFound
(
err
)
{
return
// assume pod was deleted already
}
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
}
// wait for pod to terminate. Expect apierr NotFound
err
=
f
.
WaitForPodTerminated
(
pod
.
Name
,
""
)
Expect
(
err
)
.
To
(
HaveOccurred
())
if
!
apierrs
.
IsNotFound
(
err
)
{
framework
.
Logf
(
"Error! Expected IsNotFound error deleting pod %q, instead got: %v"
,
pod
.
Name
,
err
)
Expect
(
apierrs
.
IsNotFound
(
err
))
.
To
(
BeTrue
())
}
framework
.
Logf
(
"Pod %v successfully deleted"
,
pod
.
Name
)
}
// Checks for a lingering nfs mount and/or uid directory on the pod's host. The host IP is used
// Checks for a lingering nfs mount and/or uid directory on the pod's host. The host IP is used
// so that this test runs in GCE, where it appears that SSH cannot resolve the hostname.
// so that this test runs in GCE, where it appears that SSH cannot resolve the hostname.
// If expectClean is true then we expect the node to be cleaned up and thus commands like
// If expectClean is true then we expect the node to be cleaned up and thus commands like
...
@@ -442,8 +415,8 @@ var _ = framework.KubeDescribe("kubelet", func() {
...
@@ -442,8 +415,8 @@ var _ = framework.KubeDescribe("kubelet", func() {
})
})
AfterEach
(
func
()
{
AfterEach
(
func
()
{
deletePod
w
ithWait
(
f
,
c
,
pod
)
deletePod
W
ithWait
(
f
,
c
,
pod
)
deletePod
w
ithWait
(
f
,
c
,
nfsServerPod
)
deletePod
W
ithWait
(
f
,
c
,
nfsServerPod
)
})
})
// execute It blocks from above table of tests
// execute It blocks from above table of tests
...
@@ -454,11 +427,11 @@ var _ = framework.KubeDescribe("kubelet", func() {
...
@@ -454,11 +427,11 @@ var _ = framework.KubeDescribe("kubelet", func() {
pod
=
createPodUsingNfs
(
f
,
c
,
ns
,
nfsIP
,
t
.
podCmd
)
pod
=
createPodUsingNfs
(
f
,
c
,
ns
,
nfsIP
,
t
.
podCmd
)
By
(
"Delete the NFS server pod"
)
By
(
"Delete the NFS server pod"
)
deletePod
w
ithWait
(
f
,
c
,
nfsServerPod
)
deletePod
W
ithWait
(
f
,
c
,
nfsServerPod
)
nfsServerPod
=
nil
nfsServerPod
=
nil
By
(
"Delete the pod mounted to the NFS volume"
)
By
(
"Delete the pod mounted to the NFS volume"
)
deletePod
w
ithWait
(
f
,
c
,
pod
)
deletePod
W
ithWait
(
f
,
c
,
pod
)
// pod object is now stale, but is intentionally not nil
// pod object is now stale, but is intentionally not nil
By
(
"Check if host running deleted pod has been cleaned up -- expect not"
)
By
(
"Check if host running deleted pod has been cleaned up -- expect not"
)
...
...
test/e2e/persistent_volumes-disruptive.go
View file @
7707aac2
...
@@ -189,7 +189,7 @@ func testVolumeUnmountsFromDeletedPod(c clientset.Interface, f *framework.Framew
...
@@ -189,7 +189,7 @@ func testVolumeUnmountsFromDeletedPod(c clientset.Interface, f *framework.Framew
By
(
"Restarting the kubelet."
)
By
(
"Restarting the kubelet."
)
kubeletCommand
(
kStop
,
c
,
clientPod
)
kubeletCommand
(
kStop
,
c
,
clientPod
)
deletePod
(
f
,
c
,
clientPod
.
Namespace
,
clientPod
)
deletePod
WithWait
(
f
,
c
,
clientPod
)
kubeletCommand
(
kStart
,
c
,
clientPod
)
kubeletCommand
(
kStart
,
c
,
clientPod
)
By
(
"Expecting the volume mount not to be found."
)
By
(
"Expecting the volume mount not to be found."
)
...
@@ -222,7 +222,7 @@ func initTestCase(f *framework.Framework, c clientset.Interface, pvConfig persis
...
@@ -222,7 +222,7 @@ func initTestCase(f *framework.Framework, c clientset.Interface, pvConfig persis
// tearDownTestCase destroy resources created by initTestCase.
// tearDownTestCase destroy resources created by initTestCase.
func
tearDownTestCase
(
c
clientset
.
Interface
,
f
*
framework
.
Framework
,
ns
string
,
pod
*
v1
.
Pod
,
pvc
*
v1
.
PersistentVolumeClaim
,
pv
*
v1
.
PersistentVolume
)
{
func
tearDownTestCase
(
c
clientset
.
Interface
,
f
*
framework
.
Framework
,
ns
string
,
pod
*
v1
.
Pod
,
pvc
*
v1
.
PersistentVolumeClaim
,
pv
*
v1
.
PersistentVolume
)
{
deletePod
(
f
,
c
,
ns
,
pod
)
deletePod
WithWait
(
f
,
c
,
pod
)
deletePersistentVolumeClaim
(
c
,
pvc
.
Name
,
ns
)
deletePersistentVolumeClaim
(
c
,
pvc
.
Name
,
ns
)
deletePersistentVolume
(
c
,
pv
.
Name
)
deletePersistentVolume
(
c
,
pv
.
Name
)
}
}
...
...
test/e2e/persistent_volumes.go
View file @
7707aac2
This diff is collapsed.
Click to expand it.
test/e2e/pvutil.go
0 → 100644
View file @
7707aac2
This diff is collapsed.
Click to expand it.
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