Skip to content

Commit 8120fdf

Browse files
committed
Also bump required modules
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
1 parent 264f077 commit 8120fdf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Dockerfile

+4-2
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@ RUN git clone --depth=1 https://${SRC}.git $GOPATH/src/${PKG}
1919
WORKDIR $GOPATH/src/${PKG}
2020
RUN git fetch --all --tags --prune
2121
RUN git checkout tags/${TAG} -b ${TAG}
22-
RUN TAG_MINOR=$(echo ${TAG} | awk -F. '{printf "%s.%s.\n", $1, $2}'); \
22+
RUN set -x; \
23+
TAG_MINOR=$(echo ${TAG} | awk -F. '{printf "%s.%s.\n", $1, $2}'); \
2324
K8S_VERSION=$(curl -sL https://proxy.golang.org/k8s.io/kubernetes/@v/list | grep -v - | grep ${TAG_MINOR} | sort -V | tail -n 1); \
2425
K8S_VERSION_MOD=$(echo ${K8S_VERSION} | awk -F. '{printf "v0.%s.%s\n", $2, $3}'); \
2526
go mod edit -replace github.com/docker/docker=github.com/docker/docker@v27.1.1+incompatible -replace k8s.io/kubernetes=k8s.io/kubernetes@${K8S_VERSION}; \
26-
for MODULE in $(go mod edit --json | jq -r '.Replace[] | select(.Old.Path | test("^k8s.io/")) | select(.Old.Path != "k8s.io/kubernetes") | .Old.Path'); do go mod edit --replace ${MODULE}=${MODULE}@${K8S_VERSION_MOD}; done; \
27+
for MODULE in $(go mod edit --json | jq -r '.Replace[] | select(.Old.Path | test("^k8s.io/")) | select(.Old.Path | test("^k8s.io/(kubernetes|klog|utils|kube-openapi)") | not) | .Old.Path'); do go mod edit --replace ${MODULE}=${MODULE}@${K8S_VERSION_MOD}; done; \
28+
for MODULE in $(go mod edit --json | jq -r '.Require[] | select(.Path | test("^k8s.io/")) | select(.Path | test("^k8s.io/(kubernetes|klog|utils|kube-openapi)") | not) | .Path'); do go mod edit --require ${MODULE}@${K8S_VERSION_MOD}; done; \
2729
go mod tidy && go mod vendor
2830
RUN GO_LDFLAGS="-linkmode=external -X $(awk '/^module /{print $2}' go.mod)/pkg/version.Version=${TAG}" \
2931
go-build-static.sh -gcflags=-trimpath=${GOPATH}/src -o bin/crictl ./cmd/crictl

0 commit comments

Comments
 (0)