Skip to content

Commit

Permalink
Merge pull request #145 from TommyLike/bug/fix_ci_issue
Browse files Browse the repository at this point in the history
Return immediately when failed to generate admission secret
  • Loading branch information
volcano-sh-bot authored May 8, 2019
2 parents b85b04d + 1f7e5cc commit c3a5263
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
12 changes: 9 additions & 3 deletions hack/run-e2e-kind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,20 @@ function install-volcano {

echo "Install volcano plugin into cluster...."
helm plugin install --kubeconfig ${KUBECONFIG} installer/chart/volcano/plugins/gen-admission-secret
helm gen-admission-secret --service integration-admission-service --namespace kube-system

#If failed to generate secret for admission service, return immediately
helm gen-admission-secret --service ${CLUSTER_NAME}-admission-service --namespace kube-system
if [[ $? != 0 ]]; then
echo "Failed to install secret for admission service, usually we need a retry."
exit 1
fi

echo "Install volcano chart"
helm install installer/chart/volcano --namespace kube-system --name integration --kubeconfig ${KUBECONFIG} --set basic.image_tag_version=${TAG}
helm install installer/chart/volcano --namespace kube-system --name ${CLUSTER_NAME} --kubeconfig ${KUBECONFIG} --set basic.image_tag_version=${TAG} --wait
}

function uninstall-volcano {
helm delete integration --purge --kubeconfig ${KUBECONFIG}
helm delete ${CLUSTER_NAME} --purge --kubeconfig ${KUBECONFIG}
}

function generate-log {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,15 @@ done
# approve and fetch the signed certificate
kubectl certificate approve ${csrName}
# verify certificate has been signed
for x in $(seq 15); do
for x in $(seq 20); do
serverCert=$(kubectl get csr ${csrName} -o jsonpath='{.status.certificate}')
if [[ ${serverCert} != '' ]]; then
break
fi
sleep 1
done
if [[ ${serverCert} == '' ]]; then
echo "ERROR: After approving csr ${csrName}, the signed certificate did not appear on the resource. Giving up after 15 attempts." >&2
echo "ERROR: After approving csr ${csrName}, the signed certificate did not appear on the resource. Giving up after 20 attempts." >&2
exit 1
fi
echo ${serverCert} | openssl base64 -d -A -out ${tmpdir}/server-cert.pem
Expand Down

0 comments on commit c3a5263

Please sign in to comment.