Skip to content

Commit 9437f18

Browse files
committed
prow.sh: fix hostpath driver version check
The previous logic failed for canary jobs, those also deploy a recent driver. Instead of guessing what driver gets installed based on job parameters, check what really runs in the cluster and base the decision on that. We only need to maintain this blacklist for 1.0.x until we replace it with 1.1.0, then this entire hostpath_supports_block can be removed.
1 parent b5f32f7 commit 9437f18

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

prow.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -619,18 +619,18 @@ install_sanity () (
619619

620620
# Whether the hostpath driver supports raw block devices depends on which version
621621
# we are testing. It would be much nicer if we could determine that by querying the
622-
# installed driver.
622+
# installed driver's capabilities instead of having to do a version check.
623623
hostpath_supports_block () {
624-
if [ -e "cmd/hostpathplugin" ] && ${CSI_PROW_BUILD_JOB}; then
625-
# The assumption is that if we build the hostpath driver, then it is
626-
# a current version with support.
627-
echo true
628-
return
629-
fi
630-
631-
case "${CSI_PROW_DEPLOYMENT}" in kubernetes-1.13) echo false;; # wasn't supported and probably won't be backported
632-
*) echo true;; # probably all other deployments have a recent driver
633-
esac
624+
docker exec csi-prow-control-plane docker image ls --format='{{.Repository}} {{.Tag}} {{.ID}}' | grep hostpath | while read -r repo tag id; do
625+
case "$(docker exec csi-prow-control-plane docker image inspect --format='{{ index .Config.Labels "revision"}}' "$id")" in
626+
v1.0.*)
627+
# Old version, didn't have support yet.
628+
return 1
629+
;;
630+
esac
631+
done
632+
# Assume that it works.
633+
return
634634
}
635635

636636
# Captures pod output while running some other command.

0 commit comments

Comments
 (0)