Skip to content

Commit 3ce25e2

Browse files
authored
Merge pull request #834 from vincepri/fetch-improve
🏃fetch_ext_bins now checks existing version before downloading
2 parents 734df2a + 0d82d12 commit 3ce25e2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

hack/check-everything.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,15 @@ SKIP_FETCH_TOOLS=${SKIP_FETCH_TOOLS:-""}
5050
function fetch_kb_tools {
5151
local dest_dir="${1}"
5252

53+
# use the pre-existing version in the temporary folder if it matches our k8s version
54+
if [[ -x "${dest_dir}/kubebuilder/bin/kube-apiserver" ]]; then
55+
version=$("${dest_dir}"/kubebuilder/bin/kube-apiserver --version)
56+
if [[ $version == *"${k8s_version}"* ]]; then
57+
header_text "Using cached kubebuilder-tools from ${dest_dir}"
58+
return 0
59+
fi
60+
fi
61+
5362
header_text "fetching tools (into '${dest_dir}')"
5463
kb_tools_archive_name="kubebuilder-tools-$k8s_version-$goos-$goarch.tar.gz"
5564
kb_tools_download_url="https://storage.googleapis.com/kubebuilder-tools/$kb_tools_archive_name"

0 commit comments

Comments
 (0)