Skip to content

Commit e6cf8f5

Browse files
committed
code changes to drop the vendor dir
Signed-off-by: Luther Monson <[email protected]>
1 parent 8ad7d14 commit e6cf8f5

File tree

13 files changed

+40
-53
lines changed

13 files changed

+40
-53
lines changed

.golangci.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
"contrib",
1717
"manifests",
1818
"package",
19-
"scripts"
19+
"scripts",
20+
"vendor"
2021
],
2122
"skip-files": [
2223
"/zz_generated_"

Dockerfile.dapper

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ RUN if [ "$(go env GOARCH)" = "arm64" ]; then
2626
mv trivy /usr/local/bin; \
2727
fi
2828
# this works for both go 1.15 and 1.16
29-
RUN GO111MODULE=on GOPROXY=direct go get golang.org/x/tools/cmd/goimports@gopls/v0.7.0
29+
RUN GOPROXY=direct go get golang.org/x/tools/cmd/goimports@gopls/v0.7.0
3030
RUN rm -rf /go/src /go/pkg
3131

3232
RUN if [ "$(go env GOARCH)" = "amd64" ]; then \
@@ -39,7 +39,6 @@ RUN wget -O - ${YQ_URL}_$(go env GOARCH) > /usr/bin/yq && chmod +x /usr/bin/yq
3939
ARG SELINUX=true
4040
ENV SELINUX $SELINUX
4141

42-
ENV GO111MODULE off
4342
ENV DAPPER_RUN_ARGS --privileged -v k3s-cache:/go/src/github.com/rancher/k3s/.cache -v trivy-cache:/root/.cache/trivy
4443
ENV DAPPER_ENV REPO TAG DRONE_TAG IMAGE_NAME SKIP_VALIDATE SKIP_AIRGAP GCLOUD_AUTH GITHUB_TOKEN GOLANG
4544
ENV DAPPER_SOURCE /go/src/github.com/rancher/k3s/

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ TARGETS := $(shell ls scripts | grep -v \\.sh)
22

33
.dapper:
44
@echo Downloading dapper
5-
@curl -sL https://releases.rancher.com/dapper/v0.5.1/dapper-$$(uname -s)-$$(uname -m) > .dapper.tmp
5+
@curl -sL https://releases.rancher.com/dapper/v0.5.7/dapper-$$(uname -s)-$$(uname -m) > .dapper.tmp
66
@@chmod +x .dapper.tmp
77
@./.dapper.tmp -v
88
@mv .dapper.tmp .dapper

go.mod

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ replace (
1717
github.com/matryer/moq => github.com/rancher/moq v0.0.0-20190404221404-ee5226d43009
1818
github.com/opencontainers/runc => github.com/opencontainers/runc v1.0.3
1919
github.com/opencontainers/runtime-spec => github.com/opencontainers/runtime-spec v1.0.3-0.20210316141917-a8c4a9ee0f6b
20-
github.com/rancher/k3s/pkg/data => ./pkg/data
21-
github.com/rancher/wrangler => github.com/rancher/wrangler v0.8.10
2220
go.etcd.io/etcd/api/v3 => github.com/k3s-io/etcd/api/v3 v3.5.0-k3s2
2321
go.etcd.io/etcd/client/v3 => github.com/k3s-io/etcd/client/v3 v3.5.0-k3s2
2422
go.etcd.io/etcd/etcdutl/v3 => github.com/k3s-io/etcd/etcdutl/v3 v3.5.0-k3s2
@@ -99,7 +97,7 @@ require (
9997
github.com/rancher/lasso v0.0.0-20210616224652-fc3ebd901c08
10098
github.com/rancher/remotedialer v0.2.0
10199
github.com/rancher/wharfie v0.5.1
102-
github.com/rancher/wrangler v0.8.9
100+
github.com/rancher/wrangler v0.8.10
103101
github.com/robfig/cron/v3 v3.0.1
104102
github.com/rootless-containers/rootlesskit v0.14.5
105103
github.com/sirupsen/logrus v1.8.1

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -927,6 +927,8 @@ github.com/rancher/remotedialer v0.2.0 h1:xD7t3K6JYwTdAsxmGtTHQMkEkFgKouQ1foLxVW
927927
github.com/rancher/remotedialer v0.2.0/go.mod h1:tkU8ZvrR5lRgaKWaX71nAy6daeqvPFx/lJEnbW7tXSI=
928928
github.com/rancher/wharfie v0.5.1 h1:TUqZyNj6BaGe2+tqhwAGwZouuwx02mvAMMjNuyejc5I=
929929
github.com/rancher/wharfie v0.5.1/go.mod h1:5AHZRFBAOWYPDNCwj/y5Dpj+MMwXLoitPwxjYAIbcxQ=
930+
github.com/rancher/wrangler v0.8.3/go.mod h1:dKEaHNB4izxmPUtpq1Hvr3z3Oh+9k5pCZyFO9sUhlaY=
931+
github.com/rancher/wrangler v0.8.9/go.mod h1:Lte9WjPtGYxYacIWeiS9qawvu2R4NujFU9xuXWJvc/0=
930932
github.com/rancher/wrangler v0.8.10 h1:GfM3dZyw3TconwqknRm6YO/wiKEbUIGl0/HWVqBy658=
931933
github.com/rancher/wrangler v0.8.10/go.mod h1:Lte9WjPtGYxYacIWeiS9qawvu2R4NujFU9xuXWJvc/0=
932934
github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M=

pkg/data/data.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package data

scripts/build

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ cd $(dirname $0)/..
77

88
GO=${GO-go}
99

10-
PKG="github.com/rancher/k3s"
10+
PKG="github.com/k3s-io/k3s"
1111
PKG_CONTAINERD="github.com/containerd/containerd"
1212
PKG_K3S_CONTAINERD="github.com/k3s-io/containerd"
1313
PKG_CRICTL="github.com/kubernetes-sigs/cri-tools/pkg"
@@ -16,25 +16,24 @@ PKG_K8S_CLIENT="k8s.io/client-go/pkg"
1616

1717
buildDate=$(date -u '+%Y-%m-%dT%H:%M:%SZ')
1818

19-
VENDOR_PREFIX="${PKG}/vendor/"
2019
VERSIONFLAGS="
2120
-X ${PKG}/pkg/version.Version=${VERSION}
2221
-X ${PKG}/pkg/version.GitCommit=${COMMIT:0:8}
2322
24-
-X ${VENDOR_PREFIX}${PKG_K8S_CLIENT}/version.gitVersion=${VERSION}
25-
-X ${VENDOR_PREFIX}${PKG_K8S_CLIENT}/version.gitCommit=${COMMIT}
26-
-X ${VENDOR_PREFIX}${PKG_K8S_CLIENT}/version.gitTreeState=${TREE_STATE}
27-
-X ${VENDOR_PREFIX}${PKG_K8S_CLIENT}/version.buildDate=${buildDate}
23+
-X ${PKG_K8S_CLIENT}/version.gitVersion=${VERSION}
24+
-X ${PKG_K8S_CLIENT}/version.gitCommit=${COMMIT}
25+
-X ${PKG_K8S_CLIENT}/version.gitTreeState=${TREE_STATE}
26+
-X ${PKG_K8S_CLIENT}/version.buildDate=${buildDate}
2827
29-
-X ${VENDOR_PREFIX}${PKG_K8S_BASE}/version.gitVersion=${VERSION}
30-
-X ${VENDOR_PREFIX}${PKG_K8S_BASE}/version.gitCommit=${COMMIT}
31-
-X ${VENDOR_PREFIX}${PKG_K8S_BASE}/version.gitTreeState=${TREE_STATE}
32-
-X ${VENDOR_PREFIX}${PKG_K8S_BASE}/version.buildDate=${buildDate}
28+
-X ${PKG_K8S_BASE}/version.gitVersion=${VERSION}
29+
-X ${PKG_K8S_BASE}/version.gitCommit=${COMMIT}
30+
-X ${PKG_K8S_BASE}/version.gitTreeState=${TREE_STATE}
31+
-X ${PKG_K8S_BASE}/version.buildDate=${buildDate}
3332
34-
-X ${VENDOR_PREFIX}${PKG_CRICTL}/version.Version=${VERSION_CRICTL}
33+
-X ${PKG_CRICTL}/version.Version=${VERSION_CRICTL}
3534
36-
-X ${VENDOR_PREFIX}${PKG_CONTAINERD}/version.Version=${VERSION_CONTAINERD}
37-
-X ${VENDOR_PREFIX}${PKG_CONTAINERD}/version.Package=${PKG_K3S_CONTAINERD}
35+
-X ${PKG_CONTAINERD}/version.Version=${VERSION_CONTAINERD}
36+
-X ${PKG_CONTAINERD}/version.Package=${PKG_K3S_CONTAINERD}
3837
3938
-X ${PKG_CONTAINERD}/version.Version=${VERSION_CONTAINERD}
4039
-X ${PKG_CONTAINERD}/version.Package=${PKG_K3S_CONTAINERD}
@@ -98,7 +97,7 @@ if [ ! -x ${INSTALLBIN}/cni ]; then
9897
WORKDIR=$TMPDIR/src/github.com/containernetworking/plugins
9998
git clone -b $VERSION_CNIPLUGINS https://github.com/rancher/plugins.git $WORKDIR
10099
cd $WORKDIR
101-
GOPATH=$TMPDIR CGO_ENABLED=0 "${GO}" build -tags "$TAGS" -ldflags "$LDFLAGS $STATIC" -o $INSTALLBIN/cni
100+
GO111MODULE=off GOPATH=$TMPDIR CGO_ENABLED=0 "${GO}" build -tags "$TAGS" -ldflags "$LDFLAGS $STATIC" -o $INSTALLBIN/cni
102101
)
103102
fi
104103

scripts/build-tests-sonobuoy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ PKG_TO_TEST=$(find ./pkg/ -type f -name "*_int_test.go" | sed -r 's|/[^/]+$||' |
1414
for i in $PKG_TO_TEST; do
1515
name=$(echo "${i##*/}")
1616
echo $name
17-
go test -c -v -ldflags "-X 'github.com/rancher/k3s/tests/util.existingServer=True'" -o dist/artifacts/k3s-integration-$name.test $i -run Integration
17+
go test -c -v -ldflags "-X 'github.com/k3s-io/k3s/tests/util.existingServer=True'" -o dist/artifacts/k3s-integration-$name.test $i -run Integration
1818
done
1919

2020
# Integration tests under /tests
2121
PKG_TO_TEST=$(find ./tests/integration -type f -name "*_int_test.go" | sed -r 's|/[^/]+$||' |sort -u)
2222
for i in $PKG_TO_TEST; do
2323
name=$(echo "${i##*/}")
2424
echo $name
25-
go test -c -v -ldflags "-X 'github.com/rancher/k3s/tests/util.existingServer=True'" -o dist/artifacts/k3s-integration-$name.test $i -run Integration
25+
go test -c -v -ldflags "-X 'github.com/k3s-io/k3s/tests/util.existingServer=True'" -o dist/artifacts/k3s-integration-$name.test $i -run Integration
2626
done
2727
docker build -f ./tests/integration/Dockerfile.test -t $REPO .
2828
docker save $REPO -o ./dist/artifacts/$REPO.tar

scripts/ci

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@ SCRIPT_DIR=$(dirname $0)
55
pushd $SCRIPT_DIR
66

77
./download
8-
if [ -z "$SKIP_VALIDATE" ]; then
9-
./validate
10-
fi
11-
8+
./validate
129
./build
1310
./package
1411

scripts/manifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ if echo "${DRONE_TAG}" | grep -q '-'; then
2525
fi
2626

2727
# get latest released version from github
28-
GITHUB_URL=https://github.com/rancher/k3s/releases
28+
GITHUB_URL=https://github.com/k3s-io/k3s/releases
2929
VERSION_K3S=$(curl -w '%{url_effective}' -I -L -s -S ${GITHUB_URL}/latest -o /dev/null | sed -e 's|.*/||')
3030

3131
# function for comparing versions

0 commit comments

Comments
 (0)