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
018a914e
Commit
018a914e
authored
Apr 13, 2017
by
Jeff Vance
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use sudo in mv ssh cmd
parent
9c730b57
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
9 deletions
+1
-9
kubelet.go
test/e2e/kubelet.go
+1
-9
No files found.
test/e2e/kubelet.go
View file @
018a914e
...
@@ -135,13 +135,11 @@ func updateNodeLabels(c clientset.Interface, nodeNames sets.String, toAdd, toRem
...
@@ -135,13 +135,11 @@ func updateNodeLabels(c clientset.Interface, nodeNames sets.String, toAdd, toRem
// Note: startVolumeServer() waits for the nfs-server pod to be Running and sleeps some
// Note: startVolumeServer() waits for the nfs-server pod to be Running and sleeps some
// so that the nfs server can start up.
// so that the nfs server can start up.
func
createNfsServerPod
(
c
clientset
.
Interface
,
config
framework
.
VolumeTestConfig
)
(
*
v1
.
Pod
,
string
)
{
func
createNfsServerPod
(
c
clientset
.
Interface
,
config
framework
.
VolumeTestConfig
)
(
*
v1
.
Pod
,
string
)
{
pod
:=
framework
.
StartVolumeServer
(
c
,
config
)
pod
:=
framework
.
StartVolumeServer
(
c
,
config
)
Expect
(
pod
)
.
NotTo
(
BeNil
())
Expect
(
pod
)
.
NotTo
(
BeNil
())
ip
:=
pod
.
Status
.
PodIP
ip
:=
pod
.
Status
.
PodIP
Expect
(
len
(
ip
))
.
NotTo
(
BeZero
())
Expect
(
len
(
ip
))
.
NotTo
(
BeZero
())
framework
.
Logf
(
"NFS server IP address: %v"
,
ip
)
framework
.
Logf
(
"NFS server IP address: %v"
,
ip
)
return
pod
,
ip
return
pod
,
ip
}
}
...
@@ -149,7 +147,6 @@ func createNfsServerPod(c clientset.Interface, config framework.VolumeTestConfig
...
@@ -149,7 +147,6 @@ func createNfsServerPod(c clientset.Interface, config framework.VolumeTestConfig
// pod's (only) container. This command changes the number of nfs server threads from
// pod's (only) container. This command changes the number of nfs server threads from
// (presumably) zero back to 1, and therefore allows nfs to open connections again.
// (presumably) zero back to 1, and therefore allows nfs to open connections again.
func
restartNfsServer
(
serverPod
*
v1
.
Pod
)
{
func
restartNfsServer
(
serverPod
*
v1
.
Pod
)
{
const
startcmd
=
"/usr/sbin/rpc.nfsd 1"
const
startcmd
=
"/usr/sbin/rpc.nfsd 1"
ns
:=
fmt
.
Sprintf
(
"--namespace=%v"
,
serverPod
.
Namespace
)
ns
:=
fmt
.
Sprintf
(
"--namespace=%v"
,
serverPod
.
Namespace
)
framework
.
RunKubectlOrDie
(
"exec"
,
ns
,
serverPod
.
Name
,
"--"
,
"/bin/sh"
,
"-c"
,
startcmd
)
framework
.
RunKubectlOrDie
(
"exec"
,
ns
,
serverPod
.
Name
,
"--"
,
"/bin/sh"
,
"-c"
,
startcmd
)
...
@@ -159,7 +156,6 @@ func restartNfsServer(serverPod *v1.Pod) {
...
@@ -159,7 +156,6 @@ func restartNfsServer(serverPod *v1.Pod) {
// pod's (only) container. This command changes the number of nfs server threads to 0,
// pod's (only) container. This command changes the number of nfs server threads to 0,
// thus closing all open nfs connections.
// thus closing all open nfs connections.
func
stopNfsServer
(
serverPod
*
v1
.
Pod
)
{
func
stopNfsServer
(
serverPod
*
v1
.
Pod
)
{
const
stopcmd
=
"/usr/sbin/rpc.nfsd 0"
const
stopcmd
=
"/usr/sbin/rpc.nfsd 0"
ns
:=
fmt
.
Sprintf
(
"--namespace=%v"
,
serverPod
.
Namespace
)
ns
:=
fmt
.
Sprintf
(
"--namespace=%v"
,
serverPod
.
Namespace
)
framework
.
RunKubectlOrDie
(
"exec"
,
ns
,
serverPod
.
Name
,
"--"
,
"/bin/sh"
,
"-c"
,
stopcmd
)
framework
.
RunKubectlOrDie
(
"exec"
,
ns
,
serverPod
.
Name
,
"--"
,
"/bin/sh"
,
"-c"
,
stopcmd
)
...
@@ -169,7 +165,6 @@ func stopNfsServer(serverPod *v1.Pod) {
...
@@ -169,7 +165,6 @@ func stopNfsServer(serverPod *v1.Pod) {
// will execute the passed in shell cmd. Waits for the pod to start.
// will execute the passed in shell cmd. Waits for the pod to start.
// Note: the nfs plugin is defined inline, no PV or PVC.
// Note: the nfs plugin is defined inline, no PV or PVC.
func
createPodUsingNfs
(
f
*
framework
.
Framework
,
c
clientset
.
Interface
,
ns
,
nfsIP
,
cmd
string
)
*
v1
.
Pod
{
func
createPodUsingNfs
(
f
*
framework
.
Framework
,
c
clientset
.
Interface
,
ns
,
nfsIP
,
cmd
string
)
*
v1
.
Pod
{
By
(
"create pod using nfs volume"
)
By
(
"create pod using nfs volume"
)
isPrivileged
:=
true
isPrivileged
:=
true
...
@@ -224,16 +219,14 @@ func createPodUsingNfs(f *framework.Framework, c clientset.Interface, ns, nfsIP,
...
@@ -224,16 +219,14 @@ func createPodUsingNfs(f *framework.Framework, c clientset.Interface, ns, nfsIP,
rtnPod
,
err
=
c
.
CoreV1
()
.
Pods
(
ns
)
.
Get
(
rtnPod
.
Name
,
metav1
.
GetOptions
{})
// return fresh pod
rtnPod
,
err
=
c
.
CoreV1
()
.
Pods
(
ns
)
.
Get
(
rtnPod
.
Name
,
metav1
.
GetOptions
{})
// return fresh pod
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
return
rtnPod
return
rtnPod
}
}
// move the passed-in pod's UID directory to /tmp.
// move the passed-in pod's UID directory to /tmp.
func
movePodUidDir
(
c
clientset
.
Interface
,
pod
*
v1
.
Pod
)
{
func
movePodUidDir
(
c
clientset
.
Interface
,
pod
*
v1
.
Pod
)
{
dest
:=
"/tmp"
dest
:=
"/tmp"
podDir
:=
filepath
.
Join
(
"/var/lib/kubelet/pods"
,
string
(
pod
.
UID
))
podDir
:=
filepath
.
Join
(
"/var/lib/kubelet/pods"
,
string
(
pod
.
UID
))
cmd
:=
fmt
.
Sprintf
(
"mv %v %v"
,
podDir
,
dest
)
cmd
:=
fmt
.
Sprintf
(
"
sudo
mv %v %v"
,
podDir
,
dest
)
// use ip rather than hostname in GCE
// use ip rather than hostname in GCE
nodeIP
,
err
:=
framework
.
GetHostExternalAddress
(
c
,
pod
)
nodeIP
,
err
:=
framework
.
GetHostExternalAddress
(
c
,
pod
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
...
@@ -252,7 +245,6 @@ func movePodUidDir(c clientset.Interface, pod *v1.Pod) {
...
@@ -252,7 +245,6 @@ func movePodUidDir(c clientset.Interface, pod *v1.Pod) {
// the node is not cleaned up, and thus cmds like `ls <uid-dir>` should succeed. We wait for the
// the node is not cleaned up, and thus cmds like `ls <uid-dir>` should succeed. We wait for the
// kubelet to be cleaned up, afterwhich an error is reported.
// kubelet to be cleaned up, afterwhich an error is reported.
func
checkPodCleanup
(
c
clientset
.
Interface
,
pod
*
v1
.
Pod
,
expectClean
bool
)
{
func
checkPodCleanup
(
c
clientset
.
Interface
,
pod
*
v1
.
Pod
,
expectClean
bool
)
{
timeout
:=
5
*
time
.
Minute
timeout
:=
5
*
time
.
Minute
poll
:=
20
*
time
.
Second
poll
:=
20
*
time
.
Second
podDir
:=
filepath
.
Join
(
"/var/lib/kubelet/pods"
,
string
(
pod
.
UID
))
podDir
:=
filepath
.
Join
(
"/var/lib/kubelet/pods"
,
string
(
pod
.
UID
))
...
...
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