diff --git a/.golangci.json b/.golangci.json index f317e3171c..4f117ec74c 100644 --- a/.golangci.json +++ b/.golangci.json @@ -11,6 +11,9 @@ ] }, "run": { + "skip-dirs": [ + "build", "/go/src/github.com/rancher/k3s/build" + ], "skip-files": [ "/zz_generated_" ], diff --git a/Dockerfile.dapper b/Dockerfile.dapper index 1b34d5a23a..8793f54ca6 100644 --- a/Dockerfile.dapper +++ b/Dockerfile.dapper @@ -29,7 +29,7 @@ RUN GO111MODULE=on GOPROXY=direct go get golang.org/x/tools/cmd/goimports@gopls/ RUN rm -rf /go/src /go/pkg RUN if [ "$(go env GOARCH)" = "amd64" ]; then \ - curl -sL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s v1.38.0; \ + curl -sL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s v1.40.0; \ fi ENV YQ_URL=https://github.com/mikefarah/yq/releases/download/v4.6.2/yq_linux diff --git a/go.mod b/go.mod index ce7eced65f..40d490a1bb 100644 --- a/go.mod +++ b/go.mod @@ -23,6 +23,7 @@ replace ( github.com/juju/errors => github.com/k3s-io/nocode v0.0.0-20200630202308-cb097102c09f github.com/kubernetes-sigs/cri-tools => github.com/k3s-io/cri-tools v1.21.0-k3s1 github.com/matryer/moq => github.com/rancher/moq v0.0.0-20190404221404-ee5226d43009 + // LOOK TO scripts/download FOR THE VERSION OF runc THAT WE ARE BUILDING/SHIPPING github.com/opencontainers/runc => github.com/opencontainers/runc v1.0.0-rc93.0.20210414171415-3397a09ee932 github.com/opencontainers/runtime-spec => github.com/opencontainers/runtime-spec v1.0.3-0.20210316141917-a8c4a9ee0f6b go.etcd.io/etcd => github.com/k3s-io/etcd v0.5.0-alpha.5.0.20201208200253-50621aee4aea @@ -90,6 +91,7 @@ require ( github.com/minio/minio-go/v7 v7.0.7 github.com/moby/sys/symlink v0.1.0 // indirect github.com/natefinch/lumberjack v2.0.0+incompatible + // LOOK TO scripts/download FOR THE VERSION OF runc THAT WE ARE BUILDING/SHIPPING github.com/opencontainers/runc v1.0.0-rc93 github.com/opencontainers/selinux v1.8.0 github.com/pierrec/lz4 v2.6.0+incompatible diff --git a/scripts/build b/scripts/build index fedc2e83a8..2f3d1dc496 100755 --- a/scripts/build +++ b/scripts/build @@ -117,9 +117,9 @@ ln -s containerd ./bin/ctr # echo Building containerd # CGO_ENABLED=0 "${GO}" build -tags "$TAGS" -ldflags "$VERSIONFLAGS $LDFLAGS $STATIC" -o bin/containerd ./cmd/containerd/ echo Building runc -rm -f ./vendor/github.com/opencontainers/runc/runc -make EXTRA_LDFLAGS="-w -s" BUILDTAGS="$RUNC_TAGS" -C ./vendor/github.com/opencontainers/runc $RUNC_STATIC -cp -f ./vendor/github.com/opencontainers/runc/runc ./bin/runc +rm -f ./build/src/github.com/opencontainers/runc/runc +make GOPATH=$(pwd)/build EXTRA_LDFLAGS="-w -s" BUILDTAGS="$RUNC_TAGS" -C ./build/src/github.com/opencontainers/runc $RUNC_STATIC +cp -f ./build/src/github.com/opencontainers/runc/runc ./bin/runc echo Building containerd-shim rm -f ./vendor/github.com/containerd/containerd/bin/containerd-shim diff --git a/scripts/download b/scripts/download index 3fcd60703e..9622cb8e8a 100755 --- a/scripts/download +++ b/scripts/download @@ -4,6 +4,7 @@ cd $(dirname $0)/.. . ./scripts/version.sh +RUNC_VERSION=v1.0.0-rc94 ROOT_VERSION=v0.8.1 TRAEFIK_VERSION=9.18.2 # appVersion: 2.4.8 CHARTS_DIR=build/static/charts @@ -16,6 +17,12 @@ mkdir -p ${DATA_DIR} curl --compressed -sfL https://github.com/k3s-io/k3s-root/releases/download/${ROOT_VERSION}/k3s-root-${ARCH}.tar | tar xf - +git clone --depth=1 https://github.com/opencontainers/runc build/src/github.com/opencontainers/runc || true +pushd build/src/github.com/opencontainers/runc +git fetch --all --tags +git checkout ${RUNC_VERSION} -b k3s +popd + setup_tmp() { TMP_DIR=$(mktemp -d --tmpdir=${CHARTS_DIR}) cleanup() { diff --git a/scripts/validate b/scripts/validate index aa08e9a56b..cc96d8c689 100755 --- a/scripts/validate +++ b/scripts/validate @@ -33,4 +33,4 @@ if [ -n "$DIRTY" ]; then exit 1 fi -"${GO}" test -v ./... +"${GO}" test -v ./pkg/...