Skip to content

Commit 2a373d1

Browse files
committed
hack: use >= for capi binaries version comparison
Only download the binaries if the existing binaries' version is lower than the minimum version (currently 1.28.0). This change will be needed when we copy etcd/kas binaries from existing container images which build them from source.
1 parent c94bdb3 commit 2a373d1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

hack/build-cluster-api.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ copy_cluster_api_to_mirror() {
2828

2929
sync_envtest() {
3030
if [ -f "${CLUSTER_API_BIN_DIR}/kube-apiserver" ]; then
31-
version=$("${CLUSTER_API_BIN_DIR}/kube-apiserver" --version || echo "Kubernetes v0.0.0")
31+
version=$("${CLUSTER_API_BIN_DIR}/kube-apiserver" --version | sed 's/Kubernetes //' || echo "v0.0.0")
3232
echo "Found envtest binaries with version: ${version}"
33-
if [ "${version}" = "Kubernetes v${ENVTEST_K8S_VERSION}" ]; then
33+
if printf '%s\n%s' v${ENVTEST_K8S_VERSION} "${version}" | sort -V -C; then
3434
return
3535
fi
3636
fi

0 commit comments

Comments
 (0)