Skip to content

Commit

Permalink
Retry the kube-system RBAC cluserrolebinding fix
Browse files Browse the repository at this point in the history
This should prevent intermittent E2E test failures in case Minikube API server is
not yet ready to accept configuration changes.

Inspired by: kubernetes/minikube#1904
  • Loading branch information
wallrj committed Nov 9, 2017
1 parent 64e4c3e commit 12abe93
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions hack/install-e2e-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,21 @@ fi
# See:
# * https://github.com/kubernetes/minikube/issues/1734
# * https://github.com/kubernetes/minikube/issues/1722
kubectl create clusterrolebinding cluster-admin:kube-system \
--clusterrole=cluster-admin \
--serviceaccount=kube-system:default
# * https://github.com/kubernetes/minikube/pull/1904
function elevate_kube_system_privileges() {
if kubectl get clusterrolebinding minikube-rbac; then
return 0
fi
if kubectl create clusterrolebinding minikube-rbac \
--clusterrole=cluster-admin \
--serviceaccount=kube-system:default; then
return 0
fi
return 1
}

if ! retry elevate_kube_system_privileges; then
minikube logs
echo "ERROR: Timeout waiting for Minikube to accept RBAC fixes"
exit 1
fi

0 comments on commit 12abe93

Please sign in to comment.