Skip to content

Commit

Permalink
Make CRD creation sequential
Browse files Browse the repository at this point in the history
Signed-off-by: Grant Griffiths <[email protected]>
  • Loading branch information
ggriffiths committed Oct 25, 2019
1 parent 6ea9b03 commit dd5bf59
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions deploy/kubernetes-1.17/deploy-hostpath.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,19 +106,22 @@ update_image () {

# VolumeSnapshot CRDs are installed by cluster addon manager, which may
# not be available at this point. Run this as a background process.
function wait-for-apiserver-and-update-volumesnapshot {
function create-crds-and-wait-for-apiserver {
# Wait until volumesnapshot CRDs are in place.
kubectl apply -f ${BASE_DIR}/snapshotter/crd/snapshot.storage.k8s.io_volumesnapshotclasses.yaml
until kubectl get volumesnapshotclasses.snapshot.storage.k8s.io
do
sleep 10
done

until kubectl get volumesnapshotcontents.snapshot.storage.k8s.io
kubectl apply -f ${BASE_DIR}/snapshotter/crd/snapshot.storage.k8s.io_volumesnapshots.yaml
until kubectl get volumesnapshots.snapshot.storage.k8s.io
do
sleep 10
done

until kubectl get volumesnapshots.snapshot.storage.k8s.io
kubectl apply -f ${BASE_DIR}/snapshotter/crd/snapshot.storage.k8s.io_volumesnapshotcontents.yaml
until kubectl get volumesnapshotcontents.snapshot.storage.k8s.io
do
sleep 10
done
Expand All @@ -135,7 +138,7 @@ kubectl apply -f ${BASE_DIR}/snapshotter/crd

# wait until CRDs are ready
echo "waiting for CRDs to be ready"
wait-for-apiserver-and-update-volumesnapshot
create-crds-and-wait-for-apiserver

# rbac rules
echo "applying RBAC rules"
Expand Down

0 comments on commit dd5bf59

Please sign in to comment.