Skip to content

Commit 484fe7c

Browse files
committed
Makefile: automatically select default runc version based on vendor.conf
Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 62a382c commit 484fe7c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

common/common.mk

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,18 @@
1717
CONTAINERD_REMOTE ?=https://github.com/containerd/containerd.git
1818
RUNC_REMOTE ?=https://github.com/opencontainers/runc.git
1919
REF?=HEAD
20-
RUNC_REF?=dc9208a3303feef5b3839f4323d9beb36df0a9dd
2120

21+
# Select the default version of Golang and runc based on the containerd source.
22+
# The runc version commit/tag is defined in vendor.conf. Code below is based on
23+
# the code used in the containerd repository:
24+
# https://github.com/containerd/containerd/blob/499fbb0337c9138b5360117e0b25a7a1428f9667/script/setup/install-runc#L24
2225
ifdef CONTAINERD_DIR
2326
GOVERSION?=$(shell grep "ARG GOLANG_VERSION" $(CONTAINERD_DIR)/contrib/Dockerfile.test | awk -F'=' '{print $$2}')
27+
RUNC_REF?=$(shell grep "opencontainers/runc" "$(CONTAINERD_DIR)/vendor.conf" | awk '{print $$2}')
2428
else
25-
# TODO adjust GOVERSION macro to take CONTAINERD_REMOTE into account
29+
# TODO adjust GOVERSION and RUNC_REF macro to take CONTAINERD_REMOTE into account
2630
GOVERSION?=$(shell curl -fsSL "https://raw.githubusercontent.com/containerd/containerd/$(REF)/contrib/Dockerfile.test" | grep "ARG GOLANG_VERSION" | awk -F'=' '{print $$2}')
31+
RUNC_REF?=$(shell curl -fsSL "https://raw.githubusercontent.com/containerd/containerd/$(REF)/vendor.conf" | grep "opencontainers/runc" | awk '{print $$2}')
2732
endif
2833

2934
GOLANG_IMAGE=golang:$(GOVERSION)

0 commit comments

Comments
 (0)