Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌱 Use dl.k8s.io instead of hardcoded GCS URIs #4958

Merged
merged 1 commit into from
Jul 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ brew install kustomize

```bash
# Install kubectl
KUBECTL_VERSION=$(curl -sf https://storage.googleapis.com/kubernetes-release/release/stable.txt)
curl -fLO https://storage.googleapis.com/kubernetes-release/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl
KUBECTL_VERSION=$(curl -sf https://dl.k8s.io/release/stable.txt)
curl -fLO https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl

# Install kustomize
OS_TYPE=linux
Expand Down
2 changes: 1 addition & 1 deletion hack/ensure-kubectl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ verify_kubectl_version() {
mkdir -p "${GOPATH_BIN}"
fi
echo 'kubectl not found, installing'
curl -sLo "${GOPATH_BIN}/kubectl" https://storage.googleapis.com/kubernetes-release/release/${MINIMUM_KUBECTL_VERSION}/bin/linux/amd64/kubectl
curl -sLo "${GOPATH_BIN}/kubectl" https://dl.k8s.io/release/${MINIMUM_KUBECTL_VERSION}/bin/linux/amd64/kubectl
chmod +x "${GOPATH_BIN}/kubectl"
else
echo "Missing required binary in path: kubectl"
Expand Down
6 changes: 3 additions & 3 deletions scripts/ci-e2e-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ k8s::resolveVersion() {
fi

if [[ "$version" =~ ^ci/ ]]; then
resolveVersion=$(curl -LsS "http://gcsweb.k8s.io/gcs/kubernetes-release-dev/ci/${version#ci/}.txt")
resolveVersion=$(curl -LsS "http://dl.k8s.io/ci/${version#ci/}.txt")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: this might still be causing you to pickup stale builds depending on how racy/flaky the build and build-deprecated jobs are. You're getting the version marker from gs://kubernetes-release-dev, but the binaries from gs://k8s-release-dev

Using dl.k8s.io for both means you don't have to think about it

else
resolveVersion=$(curl -LsS "http://gcsweb.k8s.io/gcs/kubernetes-release/release/${version}.txt")
resolveVersion=$(curl -LsS "http://dl.k8s.io/release/${version}.txt")
fi
echo "+ $variableName=\"$version\" resolved to \"$resolveVersion\""
}
Expand Down Expand Up @@ -216,4 +216,4 @@ kind::prepullImage () {
else
echo "+ image $image already present in the system, skipping pre-pull"
fi
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ if [[ "$${KUBERNETES_VERSION}" != "" ]]; then
echo "* testing CI version $${KUBERNETES_VERSION}"
# Check for semver
if [[ "$${KUBERNETES_VERSION}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
CI_URL="https://storage.googleapis.com/kubernetes-release/release/$${KUBERNETES_VERSION}/bin/linux/amd64"
CI_URL="https://dl.k8s.io/release/$${KUBERNETES_VERSION}/bin/linux/amd64"
VERSION_WITHOUT_PREFIX="$${KUBERNETES_VERSION#v}"
export DEBIAN_FRONTEND=noninteractive
# sometimes the network is not immediately available, so we have to retry the apt-get update
Expand All @@ -91,7 +91,7 @@ if [[ "$${KUBERNETES_VERSION}" != "" ]]; then
apt-get install -y "$${CI_PACKAGE}=$${PACKAGE_VERSION}"
done
else
CI_URL="https://storage.googleapis.com/k8s-release-dev/ci/$${KUBERNETES_VERSION}/bin/linux/amd64"
CI_URL="https://dl.k8s.io/ci/$${KUBERNETES_VERSION}/bin/linux/amd64"
for CI_PACKAGE in "$${PACKAGES_TO_TEST[@]}"; do
# Browser: https://console.cloud.google.com/storage/browser/k8s-release-dev?project=k8s-release-dev
# e.g.: https://storage.googleapis.com/k8s-release-dev/ci/v1.21.0-beta.1.378+cf3374e43491c5/bin/linux/amd64/kubectl
Expand All @@ -103,8 +103,10 @@ if [[ "$${KUBERNETES_VERSION}" != "" ]]; then
systemctl restart kubelet
fi
for CI_CONTAINER in "$${CONTAINERS_TO_TEST[@]}"; do
# Browser: https://console.cloud.google.com/storage/browser/kubernetes-release?project=kubernetes-release
# e.g.: https://storage.googleapis.com/kubernetes-release/release/v1.20.4/bin/linux/amd64/kube-apiserver.tar
# Redirect: https://dl.k8s.io/release/{path}
# e.g. https://dl.k8s.io/release/v1.20.4/bin/linux/amd64/kube-apiserver.tar
# Browser: https://gcsweb.k8s.io/gcs/kubernetes-release/
# e.g. https://gcsweb.k8s.io/gcs/kubernetes-release/release/v1.20.4/bin/linux/amd64
echo "* downloading package: $${CI_URL}/$${CI_CONTAINER}.$${CONTAINER_EXT}"
wget "$${CI_URL}/$${CI_CONTAINER}.$${CONTAINER_EXT}" -O "$${CI_DIR}/$${CI_CONTAINER}.$${CONTAINER_EXT}"
$${SUDO} ctr -n k8s.io images import "$${CI_DIR}/$${CI_CONTAINER}.$${CONTAINER_EXT}" || echo "* ignoring expected 'ctr images import' result"
Expand Down
2 changes: 1 addition & 1 deletion test/framework/kubernetesversions/versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (

const (
ciVersionURL = "https://dl.k8s.io/ci/latest.txt"
stableVersionURL = "https://storage.googleapis.com/kubernetes-release/release/stable-%d.%d.txt"
stableVersionURL = "https://dl.k8s.io/release/stable-%d.%d.txt"
tagPrefix = "v"
)

Expand Down
2 changes: 1 addition & 1 deletion test/infrastructure/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
# Gets additional CAPD dependencies
WORKDIR /tmp

RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.21.2/bin/linux/amd64/kubectl && \
RUN curl -LO https://dl.k8s.io/release/v1.21.2/bin/linux/amd64/kubectl && \
chmod +x ./kubectl && \
mv ./kubectl /usr/bin/kubectl

Expand Down