mirror of https://github.com/k3s-io/k3s
commit
ca6de16df7
|
@ -23,7 +23,7 @@ if [[ "${DOCKER_HUB_USER+set}" != "set" ]] ; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export KUBE_ROOT=$(dirname $0)/../..
|
export KUBE_REPO_ROOT=${KUBE_REPO_ROOT-$(dirname $0)/../..}
|
||||||
export KUBECTL=${KUBE_REPO_ROOT}/cluster/kubectl.sh
|
export KUBECTL=${KUBE_REPO_ROOT}/cluster/kubectl.sh
|
||||||
|
|
||||||
set -x
|
set -x
|
||||||
|
|
|
@ -34,7 +34,7 @@ function validate() {
|
||||||
# Container turn up on a clean cluster can take a while for the docker image pull.
|
# Container turn up on a clean cluster can take a while for the docker image pull.
|
||||||
local num_running=0
|
local num_running=0
|
||||||
local i=0
|
local i=0
|
||||||
while [[ ${num_running} -ne ${num_replicas} && ${i} -ne 100]]; do
|
while [[ ${num_running} -ne ${num_replicas} && ${i} -ne 100 ]]; do
|
||||||
((i++)) || true
|
((i++)) || true
|
||||||
echo "Waiting for all containers in pod to come up. Currently: ${num_running}/${num_replicas}"
|
echo "Waiting for all containers in pod to come up. Currently: ${num_running}/${num_replicas}"
|
||||||
sleep 2
|
sleep 2
|
||||||
|
@ -62,7 +62,7 @@ function validate() {
|
||||||
# This template is unit-tested in kubec{tl|fg}, so if you change it, update the unit test.
|
# This template is unit-tested in kubec{tl|fg}, so if you change it, update the unit test.
|
||||||
#
|
#
|
||||||
# You can read about the syntax here: http://golang.org/pkg/text/template/
|
# You can read about the syntax here: http://golang.org/pkg/text/template/
|
||||||
template_string="{{and (exists . \"currentState\" \"info\" \"${CONTROLLER_NAME}\" \"state\" \"running\") (exists . \"currentState\" \"info\" \"net\" \"state\" \"running\")}}"
|
template_string="{{and (exists . \"currentState\" \"info\" \"${CONTROLLER_NAME}\" \"state\" \"running\") (exists . \"currentState\" \"info\" \"POD\" \"state\" \"running\")}}"
|
||||||
current_status=$($KUBECTL get pods "$id" -o template --template="${template_string}") || {
|
current_status=$($KUBECTL get pods "$id" -o template --template="${template_string}") || {
|
||||||
if [[ $current_status =~ "pod \"${id}\" not found" ]]; then
|
if [[ $current_status =~ "pod \"${id}\" not found" ]]; then
|
||||||
echo " $id no longer exists"
|
echo " $id no longer exists"
|
||||||
|
@ -106,9 +106,6 @@ function validate() {
|
||||||
|
|
||||||
export DOCKER_HUB_USER=jlowdermilk
|
export DOCKER_HUB_USER=jlowdermilk
|
||||||
|
|
||||||
# Launch a container
|
|
||||||
${KUBE_ROOT}/examples/update-demo/2-create-replication-controller.sh
|
|
||||||
|
|
||||||
function teardown() {
|
function teardown() {
|
||||||
echo "Cleaning up test artifacts"
|
echo "Cleaning up test artifacts"
|
||||||
${KUBE_ROOT}/examples/update-demo/5-down.sh
|
${KUBE_ROOT}/examples/update-demo/5-down.sh
|
||||||
|
@ -116,6 +113,9 @@ function teardown() {
|
||||||
|
|
||||||
trap "teardown" EXIT
|
trap "teardown" EXIT
|
||||||
|
|
||||||
|
# Launch a container
|
||||||
|
${KUBE_ROOT}/examples/update-demo/2-create-replication-controller.sh
|
||||||
|
|
||||||
validate 2 nautilus
|
validate 2 nautilus
|
||||||
|
|
||||||
${KUBE_ROOT}/examples/update-demo/3-scale.sh 1
|
${KUBE_ROOT}/examples/update-demo/3-scale.sh 1
|
||||||
|
|
Loading…
Reference in New Issue