Fix detection of default runc version due upstream to switch to go.mod#224
Conversation
|
Hmm... looks like |
c9a3ea9 to
7e78bf1
Compare
|
Fixed the |
|
7e78bf1 to
330ff9a
Compare
|
@silvin-lubecki @fuweid @StefanScherer @tianon @tiborvass ptal note that we'll have to update this script once containerd/containerd#5036 has been accepted upstreeam |
| fi | ||
|
|
||
| # shellcheck disable=SC2164 | ||
| repo_abspath="$(cd -- "$(dirname "$0")/.." >/dev/null 2>&1 ; pwd -P)" |
There was a problem hiding this comment.
don't know if there's a cleaner way; this variant seems to be portable (as in; it works on macOS as well, which doesn't support readlink -f)
There was a problem hiding this comment.
Just curiosity about what -- is used for. look likes repo_abspath="$(cd "$(dirname "$0")/.." >/dev/null 2>&1 ; pwd -P)" can work.
There was a problem hiding this comment.
Good point; TBH I was testing some variations that didn't work on macOS, and found this one, which did work, but was also wondering why the -- was there, and forgot to test without; let me try
There was a problem hiding this comment.
Looks like it's the preferred way to do this (to be most portable); there's some discussion in https://go-review.googlesource.com/c/sys/+/210157/, which at some point suggests adding the -- instead of skipping it.
330ff9a to
2f5633a
Compare
The code that was used to automatically select the default version of
runc to use for containerd was still assuming the containerd code to
have a vendor.conf.
Containerd "master", and v1.5 have switched to go modules, so should
now look in the go.mod file to get the recommended / default version.
Also change the order in which we check out source-code, so that the
containerd source-code is checked out before we determine the runc
version; this allows us to always use the local source of containerd,
without having to use curl to get the version from GitHub.
Finally, a small modification was made for the "make validate" target,
which now uses a generic "alpine" Golang image, so that validation can
be done before the containerd source code was checked out (which was
used to detect the Go version to use).
Before this patch:
$ make docker.io/library/ubuntu:focal
...
curl: (22) The requested URL returned error: 404 Not Found
--------------------------------------------------------------------
Building packages on docker.io/library/ubuntu:focal
containerd : HEAD (commit: a72fe7d)
runc : (commit: 59ad417)
architecture : x86_64
build image : docker.io/library/ubuntu:focal
golang image : docker.io/library/golang:1.15.8-buster
With this patch:
$ make docker.io/library/ubuntu:focal
INFO: detected runc version from script/setup/runc-version
...
Building packages on docker.io/library/ubuntu:focal
containerd : HEAD (commit: a72fe7d)
runc : v1.0.0-rc93 (commit: 59ad417)
architecture : x86_64
build image : docker.io/library/ubuntu:focal
golang image : docker.io/library/golang:1.15.8-buster
Signed-off-by: Sebastiaan van Stijn <[email protected]>
2f5633a to
6a2e254
Compare
|
Updated to take the changes from upstream containerd/containerd#5036 into account |
The code that was used to automatically select the default version of runc to use for containerd was still assuming the containerd code to have a vendor.conf.
Containerd "master", and v1.5 have switched to go modules, so should now look in the go.mod file to get the recommended / default version.
Also change the order in which we check out source-code, so that the containerd source-code is checked out before we determine the runc version; this allows us to always use the local source of containerd, without having to use curl to get the version from GitHub.
Finally, a small modification was made for the "make validate" target, which now uses a generic "alpine" Golang image, so that validation can be done before the containerd source code was checked out (which was used to detect the Go version to use).
Before this patch:
With this patch: