add fallback version detection for tarballs < v1.31#3815
Merged
k8s-ci-robot merged 1 commit intokubernetes-sigs:mainfrom Dec 10, 2024
Merged
add fallback version detection for tarballs < v1.31#3815k8s-ci-robot merged 1 commit intokubernetes-sigs:mainfrom
k8s-ci-robot merged 1 commit intokubernetes-sigs:mainfrom
Conversation
Contributor
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: BenTheElder The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Member
Author
|
/hold |
Member
Author
|
Quickly tested with: # confirm from this PR
$ kind version
kind v0.26.0-alpha.10+23486f390e6347 go1.22.9 linux/amd64
# build 1.30.0 with a tarball URL
$ kind build node-image https://dl.k8s.io/v1.30.0/kubernetes-server-linux-amd64.tar.gz
Detected build type: "url"
Building using URL: "https://dl.k8s.io/v1.30.0/kubernetes-server-linux-amd64.tar.gz"
Starting to build Kubernetes
Downloading "https://dl.k8s.io/v1.30.0/kubernetes-server-linux-amd64.tar.gz"
WARNING: Using fallback version detection due to missing version file (This command works best with Kubernetes v1.31+)
Finished building Kubernetes
Building node image ...
Building in container: kind-build-1733851560-1979951427
Image "kindest/node:latest" build completed.
# confirm cluster works
$ kind create cluster --name=test --image=kindest/node:latest
Creating cluster "test" ...
✓ Ensuring node image (kindest/node:latest) 🖼
✓ Preparing nodes 📦
✓ Writing configuration 📜
✓ Starting control-plane 🕹️
✓ Installing CNI 🔌
✓ Installing StorageClass 💾
Set kubectl context to "kind-test"
You can now use your cluster with:
kubectl cluster-info --context kind-test
Have a nice day! 👋
$ kubectl version
Client Version: v1.30.6-dispatcher
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.30.0
# cleanup
$ kind delete cluster --name=test
Deleting cluster "test" ...
Deleted nodes: ["test-control-plane"]
# build 1.29.4 from a version
$ kind build node-image v1.29.4
Detected build type: "release"
Building using release "v1.29.4" artifacts
Starting to build Kubernetes
Downloading "https://dl.k8s.io/v1.29.4/kubernetes-server-linux-amd64.tar.gz"
WARNING: Using fallback version detection due to missing version file (This command works best with Kubernetes v1.31+)
Finished building Kubernetes
Building node image ...
Building in container: kind-build-1733852026-2066378617
Image "kindest/node:latest" build completed.
# confirm cluster works
$ kind create cluster --name=test --image=kindest/node:latest
Creating cluster "test" ...
✓ Ensuring node image (kindest/node:latest) 🖼
✓ Preparing nodes 📦
✓ Writing configuration 📜
✓ Starting control-plane 🕹️
✓ Installing CNI 🔌
✓ Installing StorageClass 💾
Set kubectl context to "kind-test"
You can now use your cluster with:
kubectl cluster-info --context kind-test
Have a nice day! 👋
$ kubectl version
Client Version: v1.29.10
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.29.4
$ kind delete cluster --name=test
Deleting cluster "test" ...
Deleted nodes: ["test-control-plane"]
# build with 1.31.0+
$ kind build node-image v1.31.0
Detected build type: "release"
Building using release "v1.31.0" artifacts
Starting to build Kubernetes
Downloading "https://dl.k8s.io/v1.31.0/kubernetes-server-linux-amd64.tar.gz"
Finished building Kubernetes
Building node image ...
Building in container: kind-build-1733852209-1132115696
Image "kindest/node:latest" build completed. |
Member
Author
|
/hold cancel |
BenTheElder
commented
Dec 10, 2024
23486f3 to
794538f
Compare
Contributor
|
/lgtm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ref #3797
This effectively restores the behavior before #3715 only when we can't get the
versionfile, along with a warning. It will not work with pre-release builds or builds with custom version metadata appended, as before, but it will work with normal upstream tagged stable release builds < v1.31.For 1.31+ we should continue to use the
versionfile, which will work with pre-release builds and builds with custom build metadata (v1.31.1+foo)Alternative to #3800