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
c5c70dfc
Commit
c5c70dfc
authored
Jan 12, 2015
by
Zach Loafman
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3417 from brendandburns/e2e
Don't just sleep and hope when deleting the pd pod.
parents
82afbab3
bdcb0c53
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
24 deletions
+26
-24
pd.sh
hack/e2e-suite/pd.sh
+26
-24
No files found.
hack/e2e-suite/pd.sh
View file @
c5c70dfc
...
...
@@ -33,12 +33,34 @@ fi
disk_name
=
"e2e-
$(
date
+%H-%M-%s
)
"
config
=
"/tmp/
${
disk_name
}
.yaml"
function
delete_pd_pod
()
{
# Delete the pod this should unmount the PD
${
KUBECFG
}
delete pods/testpd
for
i
in
$(
seq
1 24
)
;
do
echo
"Waiting for pod to be deleted."
sleep
5
all_running
=
0
for
id
in
$pod_id_list
;
do
current_status
=
$(
$KUBECFG
-template
'{{.currentState.status}}'
get pods/
$id
)
||
true
if
[[
"
$current_status
"
==
"Running"
]]
;
then
all_running
=
1
break
fi
done
if
[[
"
${
all_running
}
"
==
0
]]
;
then
break
fi
done
if
[[
"
${
all_running
}
"
==
1
]]
;
then
echo
"Pods did not delete in time"
exit
1
fi
}
function
teardown
()
{
echo
"Cleaning up test artifacts"
${
KUBECFG
}
delete pods/testp
d
delete_pd_po
d
rm
-rf
${
config
}
echo
"Waiting for disk to become unmounted"
sleep
20
gcloud compute disks delete
--quiet
--zone
=
"
${
ZONE
}
"
"
${
disk_name
}
"
}
...
...
@@ -82,27 +104,7 @@ if [[ "${all_running}" == 0 ]]; then
exit
1
fi
# Delete the pod this should unmount the PD
${
KUBECFG
}
delete pods/testpd
for
i
in
$(
seq
1 24
)
;
do
echo
"Waiting for pod to be deleted."
sleep
5
all_running
=
0
for
id
in
$pod_id_list
;
do
current_status
=
$(
$KUBECFG
-template
'{{.currentState.status}}'
get pods/
$id
)
||
true
if
[[
"
$current_status
"
==
"Running"
]]
;
then
all_running
=
1
break
fi
done
if
[[
"
${
all_running
}
"
==
0
]]
;
then
break
fi
done
if
[[
"
${
all_running
}
"
==
1
]]
;
then
echo
"Pods did not delete in time"
exit
1
fi
delete_pd_pod
# Recreate the pod, this should re-mount the PD
${
KUBECFG
}
-c
${
config
}
create pods
...
...
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