Skip to content

Commit

Permalink
Add snapshotter CRDs after cluster setup
Browse files Browse the repository at this point in the history
Signed-off-by: Grant Griffiths <grant@portworx.com>
  • Loading branch information
ggriffiths committed Nov 12, 2019
1 parent 4fcafec commit 8c3b745
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions prow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,29 @@ install_hostpath () {
fi
}

# Installs all nessesary snapshotter CRDs
install_snapshot_crds() {
# Wait until volumesnapshot CRDs are in place.
CRD_BASE_DIR=https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/master/config/crd
kubectl apply -f "${CRD_BASE_DIR}/snapshot.storage.k8s.io_volumesnapshotclasses.yaml"
until kubectl get volumesnapshotclasses.snapshot.storage.k8s.io
do
sleep 2
done

kubectl apply -f "${CRD_BASE_DIR}/snapshot.storage.k8s.io_volumesnapshots.yaml"
until kubectl get volumesnapshots.snapshot.storage.k8s.io
do
sleep 2
done

kubectl apply -f "${CRD_BASE_DIR}/snapshot.storage.k8s.io_volumesnapshotcontents.yaml"
until kubectl get volumesnapshotcontents.snapshot.storage.k8s.io
do
sleep 2
done
}

# collect logs and cluster status (like the version of all components, Kubernetes version, test version)
collect_cluster_info () {
cat <<EOF
Expand Down Expand Up @@ -987,6 +1010,9 @@ main () {
if tests_need_non_alpha_cluster; then
start_cluster || die "starting the non-alpha cluster failed"

# Install nessesary CRDs
install_snapshot_crds

# Installing the driver might be disabled.
if install_hostpath "$images"; then
collect_cluster_info
Expand Down

0 comments on commit 8c3b745

Please # to comment.