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 authored and munnerz committed Nov 13, 2017
1 parent 26e8057 commit 111982a
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 @@ -27,6 +27,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 111982a

Please sign in to comment.