Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
e6cf8f59
Commit
e6cf8f59
authored
Nov 08, 2021
by
Luther Monson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code changes to drop the vendor dir
Signed-off-by:
Luther Monson
<
luther.monson@gmail.com
>
parent
8ad7d141
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
40 additions
and
53 deletions
+40
-53
.golangci.json
.golangci.json
+2
-1
Dockerfile.dapper
Dockerfile.dapper
+1
-2
Makefile
Makefile
+1
-1
go.mod
go.mod
+1
-3
go.sum
go.sum
+2
-0
data.go
pkg/data/data.go
+1
-0
build
scripts/build
+13
-14
build-tests-sonobuoy
scripts/build-tests-sonobuoy
+2
-2
ci
scripts/ci
+1
-4
manifest
scripts/manifest
+1
-1
package-cli
scripts/package-cli
+2
-2
validate
scripts/validate
+13
-7
vendor.go
vendor.go
+0
-16
No files found.
.golangci.json
View file @
e6cf8f59
...
@@ -16,7 +16,8 @@
...
@@ -16,7 +16,8 @@
"contrib"
,
"contrib"
,
"manifests"
,
"manifests"
,
"package"
,
"package"
,
"scripts"
"scripts"
,
"vendor"
],
],
"skip-files"
:
[
"skip-files"
:
[
"/zz_generated_"
"/zz_generated_"
...
...
Dockerfile.dapper
View file @
e6cf8f59
...
@@ -26,7 +26,7 @@ RUN if [ "$(go env GOARCH)" = "arm64" ]; then
...
@@ -26,7 +26,7 @@ RUN if [ "$(go env GOARCH)" = "arm64" ]; then
mv trivy /usr/local/bin; \
mv trivy /usr/local/bin; \
fi
fi
# this works for both go 1.15 and 1.16
# this works for both go 1.15 and 1.16
RUN GO
111MODULE=on GO
PROXY=direct go get golang.org/x/tools/cmd/goimports@gopls/v0.7.0
RUN GOPROXY=direct go get golang.org/x/tools/cmd/goimports@gopls/v0.7.0
RUN rm -rf /go/src /go/pkg
RUN rm -rf /go/src /go/pkg
RUN if [ "$(go env GOARCH)" = "amd64" ]; then \
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
...
@@ -39,7 +39,6 @@ RUN wget -O - ${YQ_URL}_$(go env GOARCH) > /usr/bin/yq && chmod +x /usr/bin/yq
ARG SELINUX=true
ARG SELINUX=true
ENV SELINUX $SELINUX
ENV SELINUX $SELINUX
ENV GO111MODULE off
ENV DAPPER_RUN_ARGS --privileged -v k3s-cache:/go/src/github.com/rancher/k3s/.cache -v trivy-cache:/root/.cache/trivy
ENV DAPPER_RUN_ARGS --privileged -v k3s-cache:/go/src/github.com/rancher/k3s/.cache -v trivy-cache:/root/.cache/trivy
ENV DAPPER_ENV REPO TAG DRONE_TAG IMAGE_NAME SKIP_VALIDATE SKIP_AIRGAP GCLOUD_AUTH GITHUB_TOKEN GOLANG
ENV DAPPER_ENV REPO TAG DRONE_TAG IMAGE_NAME SKIP_VALIDATE SKIP_AIRGAP GCLOUD_AUTH GITHUB_TOKEN GOLANG
ENV DAPPER_SOURCE /go/src/github.com/rancher/k3s/
ENV DAPPER_SOURCE /go/src/github.com/rancher/k3s/
...
...
Makefile
View file @
e6cf8f59
...
@@ -2,7 +2,7 @@ TARGETS := $(shell ls scripts | grep -v \\.sh)
...
@@ -2,7 +2,7 @@ TARGETS := $(shell ls scripts | grep -v \\.sh)
.dapper
:
.dapper
:
@
echo
Downloading dapper
@
echo
Downloading dapper
@
curl
-sL
https://releases.rancher.com/dapper/v0.5.
1
/dapper-
$$
(
uname
-s
)
-
$$
(
uname
-m
)
>
.dapper.tmp
@
curl
-sL
https://releases.rancher.com/dapper/v0.5.
7
/dapper-
$$
(
uname
-s
)
-
$$
(
uname
-m
)
>
.dapper.tmp
@
@chmod +x .dapper.tmp
@
@chmod +x .dapper.tmp
@
./.dapper.tmp
-v
@
./.dapper.tmp
-v
@
mv
.dapper.tmp .dapper
@
mv
.dapper.tmp .dapper
...
...
go.mod
View file @
e6cf8f59
...
@@ -17,8 +17,6 @@ replace (
...
@@ -17,8 +17,6 @@ replace (
github.com/matryer/moq => github.com/rancher/moq v0.0.0-20190404221404-ee5226d43009
github.com/matryer/moq => github.com/rancher/moq v0.0.0-20190404221404-ee5226d43009
github.com/opencontainers/runc => github.com/opencontainers/runc v1.0.3
github.com/opencontainers/runc => github.com/opencontainers/runc v1.0.3
github.com/opencontainers/runtime-spec => github.com/opencontainers/runtime-spec v1.0.3-0.20210316141917-a8c4a9ee0f6b
github.com/opencontainers/runtime-spec => github.com/opencontainers/runtime-spec v1.0.3-0.20210316141917-a8c4a9ee0f6b
github.com/rancher/k3s/pkg/data => ./pkg/data
github.com/rancher/wrangler => github.com/rancher/wrangler v0.8.10
go.etcd.io/etcd/api/v3 => github.com/k3s-io/etcd/api/v3 v3.5.0-k3s2
go.etcd.io/etcd/api/v3 => github.com/k3s-io/etcd/api/v3 v3.5.0-k3s2
go.etcd.io/etcd/client/v3 => github.com/k3s-io/etcd/client/v3 v3.5.0-k3s2
go.etcd.io/etcd/client/v3 => github.com/k3s-io/etcd/client/v3 v3.5.0-k3s2
go.etcd.io/etcd/etcdutl/v3 => github.com/k3s-io/etcd/etcdutl/v3 v3.5.0-k3s2
go.etcd.io/etcd/etcdutl/v3 => github.com/k3s-io/etcd/etcdutl/v3 v3.5.0-k3s2
...
@@ -99,7 +97,7 @@ require (
...
@@ -99,7 +97,7 @@ require (
github.com/rancher/lasso v0.0.0-20210616224652-fc3ebd901c08
github.com/rancher/lasso v0.0.0-20210616224652-fc3ebd901c08
github.com/rancher/remotedialer v0.2.0
github.com/rancher/remotedialer v0.2.0
github.com/rancher/wharfie v0.5.1
github.com/rancher/wharfie v0.5.1
github.com/rancher/wrangler v0.8.
9
github.com/rancher/wrangler v0.8.
10
github.com/robfig/cron/v3 v3.0.1
github.com/robfig/cron/v3 v3.0.1
github.com/rootless-containers/rootlesskit v0.14.5
github.com/rootless-containers/rootlesskit v0.14.5
github.com/sirupsen/logrus v1.8.1
github.com/sirupsen/logrus v1.8.1
...
...
go.sum
View file @
e6cf8f59
...
@@ -927,6 +927,8 @@ github.com/rancher/remotedialer v0.2.0 h1:xD7t3K6JYwTdAsxmGtTHQMkEkFgKouQ1foLxVW
...
@@ -927,6 +927,8 @@ github.com/rancher/remotedialer v0.2.0 h1:xD7t3K6JYwTdAsxmGtTHQMkEkFgKouQ1foLxVW
github.com/rancher/remotedialer v0.2.0/go.mod h1:tkU8ZvrR5lRgaKWaX71nAy6daeqvPFx/lJEnbW7tXSI=
github.com/rancher/remotedialer v0.2.0/go.mod h1:tkU8ZvrR5lRgaKWaX71nAy6daeqvPFx/lJEnbW7tXSI=
github.com/rancher/wharfie v0.5.1 h1:TUqZyNj6BaGe2+tqhwAGwZouuwx02mvAMMjNuyejc5I=
github.com/rancher/wharfie v0.5.1 h1:TUqZyNj6BaGe2+tqhwAGwZouuwx02mvAMMjNuyejc5I=
github.com/rancher/wharfie v0.5.1/go.mod h1:5AHZRFBAOWYPDNCwj/y5Dpj+MMwXLoitPwxjYAIbcxQ=
github.com/rancher/wharfie v0.5.1/go.mod h1:5AHZRFBAOWYPDNCwj/y5Dpj+MMwXLoitPwxjYAIbcxQ=
github.com/rancher/wrangler v0.8.3/go.mod h1:dKEaHNB4izxmPUtpq1Hvr3z3Oh+9k5pCZyFO9sUhlaY=
github.com/rancher/wrangler v0.8.9/go.mod h1:Lte9WjPtGYxYacIWeiS9qawvu2R4NujFU9xuXWJvc/0=
github.com/rancher/wrangler v0.8.10 h1:GfM3dZyw3TconwqknRm6YO/wiKEbUIGl0/HWVqBy658=
github.com/rancher/wrangler v0.8.10 h1:GfM3dZyw3TconwqknRm6YO/wiKEbUIGl0/HWVqBy658=
github.com/rancher/wrangler v0.8.10/go.mod h1:Lte9WjPtGYxYacIWeiS9qawvu2R4NujFU9xuXWJvc/0=
github.com/rancher/wrangler v0.8.10/go.mod h1:Lte9WjPtGYxYacIWeiS9qawvu2R4NujFU9xuXWJvc/0=
github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M=
github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M=
...
...
pkg/data/data.go
0 → 100644
View file @
e6cf8f59
package
data
scripts/build
View file @
e6cf8f59
...
@@ -7,7 +7,7 @@ cd $(dirname $0)/..
...
@@ -7,7 +7,7 @@ cd $(dirname $0)/..
GO
=
${
GO
-go
}
GO
=
${
GO
-go
}
PKG
=
"github.com/
rancher
/k3s"
PKG
=
"github.com/
k3s-io
/k3s"
PKG_CONTAINERD
=
"github.com/containerd/containerd"
PKG_CONTAINERD
=
"github.com/containerd/containerd"
PKG_K3S_CONTAINERD
=
"github.com/k3s-io/containerd"
PKG_K3S_CONTAINERD
=
"github.com/k3s-io/containerd"
PKG_CRICTL
=
"github.com/kubernetes-sigs/cri-tools/pkg"
PKG_CRICTL
=
"github.com/kubernetes-sigs/cri-tools/pkg"
...
@@ -16,25 +16,24 @@ PKG_K8S_CLIENT="k8s.io/client-go/pkg"
...
@@ -16,25 +16,24 @@ PKG_K8S_CLIENT="k8s.io/client-go/pkg"
buildDate
=
$(
date
-u
'+%Y-%m-%dT%H:%M:%SZ'
)
buildDate
=
$(
date
-u
'+%Y-%m-%dT%H:%M:%SZ'
)
VENDOR_PREFIX
=
"
${
PKG
}
/vendor/"
VERSIONFLAGS
=
"
VERSIONFLAGS
=
"
-X
${
PKG
}
/pkg/version.Version=
${
VERSION
}
-X
${
PKG
}
/pkg/version.Version=
${
VERSION
}
-X
${
PKG
}
/pkg/version.GitCommit=
${
COMMIT
:0:8
}
-X
${
PKG
}
/pkg/version.GitCommit=
${
COMMIT
:0:8
}
-X
${
VENDOR_PREFIX
}${
PKG_K8S_CLIENT
}
/version.gitVersion=
${
VERSION
}
-X
${
PKG_K8S_CLIENT
}
/version.gitVersion=
${
VERSION
}
-X
${
VENDOR_PREFIX
}${
PKG_K8S_CLIENT
}
/version.gitCommit=
${
COMMIT
}
-X
${
PKG_K8S_CLIENT
}
/version.gitCommit=
${
COMMIT
}
-X
${
VENDOR_PREFIX
}${
PKG_K8S_CLIENT
}
/version.gitTreeState=
${
TREE_STATE
}
-X
${
PKG_K8S_CLIENT
}
/version.gitTreeState=
${
TREE_STATE
}
-X
${
VENDOR_PREFIX
}${
PKG_K8S_CLIENT
}
/version.buildDate=
${
buildDate
}
-X
${
PKG_K8S_CLIENT
}
/version.buildDate=
${
buildDate
}
-X
${
VENDOR_PREFIX
}${
PKG_K8S_BASE
}
/version.gitVersion=
${
VERSION
}
-X
${
PKG_K8S_BASE
}
/version.gitVersion=
${
VERSION
}
-X
${
VENDOR_PREFIX
}${
PKG_K8S_BASE
}
/version.gitCommit=
${
COMMIT
}
-X
${
PKG_K8S_BASE
}
/version.gitCommit=
${
COMMIT
}
-X
${
VENDOR_PREFIX
}${
PKG_K8S_BASE
}
/version.gitTreeState=
${
TREE_STATE
}
-X
${
PKG_K8S_BASE
}
/version.gitTreeState=
${
TREE_STATE
}
-X
${
VENDOR_PREFIX
}${
PKG_K8S_BASE
}
/version.buildDate=
${
buildDate
}
-X
${
PKG_K8S_BASE
}
/version.buildDate=
${
buildDate
}
-X
${
VENDOR_PREFIX
}${
PKG_CRICTL
}
/version.Version=
${
VERSION_CRICTL
}
-X
${
PKG_CRICTL
}
/version.Version=
${
VERSION_CRICTL
}
-X
${
VENDOR_PREFIX
}${
PKG_CONTAINERD
}
/version.Version=
${
VERSION_CONTAINERD
}
-X
${
PKG_CONTAINERD
}
/version.Version=
${
VERSION_CONTAINERD
}
-X
${
VENDOR_PREFIX
}${
PKG_CONTAINERD
}
/version.Package=
${
PKG_K3S_CONTAINERD
}
-X
${
PKG_CONTAINERD
}
/version.Package=
${
PKG_K3S_CONTAINERD
}
-X
${
PKG_CONTAINERD
}
/version.Version=
${
VERSION_CONTAINERD
}
-X
${
PKG_CONTAINERD
}
/version.Version=
${
VERSION_CONTAINERD
}
-X
${
PKG_CONTAINERD
}
/version.Package=
${
PKG_K3S_CONTAINERD
}
-X
${
PKG_CONTAINERD
}
/version.Package=
${
PKG_K3S_CONTAINERD
}
...
@@ -98,7 +97,7 @@ if [ ! -x ${INSTALLBIN}/cni ]; then
...
@@ -98,7 +97,7 @@ if [ ! -x ${INSTALLBIN}/cni ]; then
WORKDIR
=
$TMPDIR
/src/github.com/containernetworking/plugins
WORKDIR
=
$TMPDIR
/src/github.com/containernetworking/plugins
git clone
-b
$VERSION_CNIPLUGINS
https://github.com/rancher/plugins.git
$WORKDIR
git clone
-b
$VERSION_CNIPLUGINS
https://github.com/rancher/plugins.git
$WORKDIR
cd
$WORKDIR
cd
$WORKDIR
GOPATH
=
$TMPDIR
CGO_ENABLED
=
0
"
${
GO
}
"
build
-tags
"
$TAGS
"
-ldflags
"
$LDFLAGS
$STATIC
"
-o
$INSTALLBIN
/cni
GO
111MODULE
=
off
GO
PATH
=
$TMPDIR
CGO_ENABLED
=
0
"
${
GO
}
"
build
-tags
"
$TAGS
"
-ldflags
"
$LDFLAGS
$STATIC
"
-o
$INSTALLBIN
/cni
)
)
fi
fi
...
...
scripts/build-tests-sonobuoy
View file @
e6cf8f59
...
@@ -14,7 +14,7 @@ PKG_TO_TEST=$(find ./pkg/ -type f -name "*_int_test.go" | sed -r 's|/[^/]+$||' |
...
@@ -14,7 +14,7 @@ PKG_TO_TEST=$(find ./pkg/ -type f -name "*_int_test.go" | sed -r 's|/[^/]+$||' |
for
i
in
$PKG_TO_TEST
;
do
for
i
in
$PKG_TO_TEST
;
do
name
=
$(
echo
"
${
i
##*/
}
"
)
name
=
$(
echo
"
${
i
##*/
}
"
)
echo
$name
echo
$name
go
test
-c
-v
-ldflags
"-X 'github.com/
rancher
/k3s/tests/util.existingServer=True'"
-o
dist/artifacts/k3s-integration-
$name
.test
$i
-run
Integration
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
done
done
# Integration tests under /tests
# Integration tests under /tests
...
@@ -22,7 +22,7 @@ PKG_TO_TEST=$(find ./tests/integration -type f -name "*_int_test.go" | sed -r 's
...
@@ -22,7 +22,7 @@ PKG_TO_TEST=$(find ./tests/integration -type f -name "*_int_test.go" | sed -r 's
for
i
in
$PKG_TO_TEST
;
do
for
i
in
$PKG_TO_TEST
;
do
name
=
$(
echo
"
${
i
##*/
}
"
)
name
=
$(
echo
"
${
i
##*/
}
"
)
echo
$name
echo
$name
go
test
-c
-v
-ldflags
"-X 'github.com/
rancher
/k3s/tests/util.existingServer=True'"
-o
dist/artifacts/k3s-integration-
$name
.test
$i
-run
Integration
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
done
done
docker build
-f
./tests/integration/Dockerfile.test
-t
$REPO
.
docker build
-f
./tests/integration/Dockerfile.test
-t
$REPO
.
docker save
$REPO
-o
./dist/artifacts/
$REPO
.tar
docker save
$REPO
-o
./dist/artifacts/
$REPO
.tar
...
...
scripts/ci
View file @
e6cf8f59
...
@@ -5,10 +5,7 @@ SCRIPT_DIR=$(dirname $0)
...
@@ -5,10 +5,7 @@ SCRIPT_DIR=$(dirname $0)
pushd
$SCRIPT_DIR
pushd
$SCRIPT_DIR
./download
./download
if
[
-z
"
$SKIP_VALIDATE
"
]
;
then
./validate
./validate
fi
./build
./build
./package
./package
...
...
scripts/manifest
View file @
e6cf8f59
...
@@ -25,7 +25,7 @@ if echo "${DRONE_TAG}" | grep -q '-'; then
...
@@ -25,7 +25,7 @@ if echo "${DRONE_TAG}" | grep -q '-'; then
fi
fi
# get latest released version from github
# get latest released version from github
GITHUB_URL
=
https://github.com/
rancher
/k3s/releases
GITHUB_URL
=
https://github.com/
k3s-io
/k3s/releases
VERSION_K3S
=
$(
curl
-w
'%{url_effective}'
-I
-L
-s
-S
${
GITHUB_URL
}
/latest
-o
/dev/null |
sed
-e
's|.*/||'
)
VERSION_K3S
=
$(
curl
-w
'%{url_effective}'
-I
-L
-s
-S
${
GITHUB_URL
}
/latest
-o
/dev/null |
sed
-e
's|.*/||'
)
# function for comparing versions
# function for comparing versions
...
...
scripts/package-cli
View file @
e6cf8f59
...
@@ -52,8 +52,8 @@ CMD_NAME=dist/artifacts/k3s${BIN_SUFFIX}
...
@@ -52,8 +52,8 @@ CMD_NAME=dist/artifacts/k3s${BIN_SUFFIX}
"
${
GO
}
"
generate
"
${
GO
}
"
generate
LDFLAGS
=
"
LDFLAGS
=
"
-X github.com/
rancher
/k3s/pkg/version.Version=
$VERSION
-X github.com/
k3s-io
/k3s/pkg/version.Version=
$VERSION
-X github.com/
rancher
/k3s/pkg/version.GitCommit=
${
COMMIT
:0:8
}
-X github.com/
k3s-io
/k3s/pkg/version.GitCommit=
${
COMMIT
:0:8
}
-w -s
-w -s
"
"
STATIC
=
"-extldflags '-static'"
STATIC
=
"-extldflags '-static'"
...
...
scripts/validate
View file @
e6cf8f59
...
@@ -3,27 +3,33 @@ set -e
...
@@ -3,27 +3,33 @@ set -e
cd
$(
dirname
$0
)
/..
cd
$(
dirname
$0
)
/..
GO
=
${
GO
-go
}
echo
Running: go mod tidy
go mod tidy
echo
Running: go generate
go generate
if
[
-n
"
$SKIP_VALIDATE
"
]
;
then
echo
Skipping validation
exit
fi
if
!
command
-v
golangci-lint
;
then
if
!
command
-v
golangci-lint
;
then
echo
Skipping validation: no golangci-lint available
echo
Skipping validation: no golangci-lint available
exit
exit
fi
fi
echo
Running validation
echo
Running validation
echo
Running: go mod verify
go mod verify
if
[
!
-e
build/data
]
;
then
if
[
!
-e
build/data
]
;
then
mkdir
-p
build/data
mkdir
-p
build/data
fi
fi
echo
Running:
"
${
GO
}
"
generate
"
${
GO
}
"
generate
echo
Running: golangci-lint
echo
Running: golangci-lint
golangci-lint run
-v
golangci-lint run
-v
GO111MODULE
=
on go mod tidy
GO111MODULE
=
on go mod vendor
.
./scripts/version.sh
.
./scripts/version.sh
if
[
-n
"
$DIRTY
"
]
;
then
if
[
-n
"
$DIRTY
"
]
;
then
...
...
vendor.go
deleted
100644 → 0
View file @
8ad7d141
// +build vendor
package
main
import
(
_
"github.com/containerd/containerd/cmd/containerd-shim-runc-v2"
_
"github.com/coreos/go-systemd/activation"
_
"github.com/go-bindata/go-bindata"
_
"github.com/go-bindata/go-bindata/go-bindata"
_
"github.com/opencontainers/runc"
_
"github.com/opencontainers/runc/contrib/cmd/recvtty"
_
"github.com/opencontainers/runc/libcontainer/nsenter"
_
"github.com/opencontainers/runc/libcontainer/specconv"
)
func
main
()
{}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment