Skip to content

Commit

Permalink
Merge pull request #3419 from kolyshkin/go1.18
Browse files Browse the repository at this point in the history
Add / switch to Go 1.18
  • Loading branch information
kolyshkin authored Mar 23, 2022
2 parents 404d916 + a0f8847 commit 6e624d6
Show file tree
Hide file tree
Showing 36 changed files with 45 additions and 230 deletions.
4 changes: 2 additions & 2 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ task:
mkdir -p -m 0700 /root/.ssh
vagrant ssh-config >> /root/.ssh/config
guest_info_script: |
ssh default 'sh -exc "uname -a && systemctl --version && df -T && cat /etc/os-release"'
ssh default 'sh -exc "uname -a && systemctl --version && df -T && cat /etc/os-release && go version"'
unit_tests_script: |
ssh default 'sudo -i make -C /vagrant localunittest'
integration_systemd_script: |
Expand All @@ -68,7 +68,7 @@ task:
env:
HOME: /root
CIRRUS_WORKING_DIR: /home/runc
GO_VERSION: "1.17.3"
GO_VERSION: "1.18"
BATS_VERSION: "v1.3.0"
# yamllint disable rule:key-duplicates
matrix:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ jobs:
strategy:
fail-fast: false
matrix:
go-version: [1.16.x, 1.17.x, 1.18.0-beta1]
go-version: [1.17.x, 1.18.x]
rootless: ["rootless", ""]
race: ["-race", ""]
criu: [""]
include:
# Also test against latest criu-dev
- go-version: 1.17.x
- go-version: 1.18.x
rootless: ""
race: ""
criu: "criu-dev"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- release-*
pull_request:
env:
GO_VERSION: 1.17.x
GO_VERSION: 1.18.x

jobs:

Expand All @@ -25,7 +25,7 @@ jobs:
sudo apt -q install libseccomp-dev
- uses: golangci/golangci-lint-action@v3
with:
version: v1.44
version: v1.45

lint-extra:
# Extra linters, only checking new code from pull requests.
Expand All @@ -46,7 +46,7 @@ jobs:
with:
only-new-issues: true
args: --config .golangci-extra.yml
version: v1.44
version: v1.45


compile-buildtags:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG GO_VERSION=1.17
ARG GO_VERSION=1.18
ARG BATS_VERSION=v1.3.0
ARG LIBSECCOMP_VERSION=2.5.3

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ A third party security audit was performed by Cure53, you can see the full repor

## Building

`runc` only supports Linux. It must be built with Go version 1.16 or higher.
`runc` only supports Linux. It must be built with Go version 1.17 or higher.

In order to enable seccomp support you will need to install `libseccomp` on your platform.
> e.g. `libseccomp-devel` for CentOS, or `libseccomp-dev` for Ubuntu
Expand Down
7 changes: 6 additions & 1 deletion Vagrantfile.fedora
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,17 @@ Vagrant.configure("2") do |config|
cat << EOF | dnf -y --exclude=kernel,kernel-core shell && break
config install_weak_deps false
update
install iptables gcc make golang-go glibc-static libseccomp-devel bats jq git-core criu fuse-sshfs
install iptables gcc make glibc-static libseccomp-devel bats jq git-core criu fuse-sshfs
ts run
EOF
done
dnf clean all
# Install golang.
# FIXME go back to golang-go rpm once switched to Fedora 36.
curl -fsSL https://go.dev/dl/go1.18.linux-amd64.tar.gz | tar Cxz /usr/local
echo 'export PATH=/usr/local/go/bin:$PATH' >> /etc/profile.d/golang.sh
# Add a user for rootless tests
useradd -u2000 -m -d/home/rootless -s/bin/bash rootless
Expand Down
9 changes: 8 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/opencontainers/runc

go 1.16
go 1.17

require (
github.com/checkpoint-restore/go-criu/v5 v5.3.0
Expand All @@ -24,3 +24,10 @@ require (
golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c
google.golang.org/protobuf v1.27.1
)

require (
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d // indirect
github.com/russross/blackfriday/v2 v2.0.1 // indirect
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df // indirect
)
2 changes: 1 addition & 1 deletion libcontainer/container_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,7 @@ func (c *linuxContainer) criuSupportsExtNS(t configs.NamespaceType) bool {
}

func criuNsToKey(t configs.NamespaceType) string {
return "extRoot" + strings.Title(configs.NsName(t)) + "NS"
return "extRoot" + strings.Title(configs.NsName(t)) + "NS" //nolint:staticcheck // SA1019: strings.Title is deprecated
}

func (c *linuxContainer) handleCheckpointingExternalNamespaces(rpcOpts *criurpc.CriuOpts, t configs.NamespaceType) error {
Expand Down
39 changes: 0 additions & 39 deletions libcontainer/devices/device_unix_go116_test.go

This file was deleted.

8 changes: 0 additions & 8 deletions libcontainer/devices/device_unix_go117_test.go

This file was deleted.

2 changes: 1 addition & 1 deletion libcontainer/devices/device_unix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func TestHostDevicesIoutilReadDirDeepFailure(t *testing.T) {
t.Fatalf("Unexpected error %v", err)
}

return []fs.DirEntry{fileInfoToDirEntry(fi)}, nil
return []fs.DirEntry{fs.FileInfoToDirEntry(fi)}, nil
}
defer cleanupTest()

Expand Down

This file was deleted.

10 changes: 0 additions & 10 deletions vendor/github.com/checkpoint-restore/go-criu/v5/go.sum

This file was deleted.

9 changes: 0 additions & 9 deletions vendor/github.com/cilium/ebpf/go.mod

This file was deleted.

20 changes: 0 additions & 20 deletions vendor/github.com/cilium/ebpf/go.sum

This file was deleted.

5 changes: 0 additions & 5 deletions vendor/github.com/containerd/console/go.mod

This file was deleted.

2 changes: 0 additions & 2 deletions vendor/github.com/containerd/console/go.sum

This file was deleted.

3 changes: 0 additions & 3 deletions vendor/github.com/cyphar/filepath-securejoin/go.mod

This file was deleted.

3 changes: 0 additions & 3 deletions vendor/github.com/godbus/dbus/v5/go.mod

This file was deleted.

Empty file.
5 changes: 0 additions & 5 deletions vendor/github.com/moby/sys/mountinfo/go.mod

This file was deleted.

2 changes: 0 additions & 2 deletions vendor/github.com/moby/sys/mountinfo/go.sum

This file was deleted.

3 changes: 0 additions & 3 deletions vendor/github.com/mrunalp/fileutils/go.mod

This file was deleted.

1 change: 0 additions & 1 deletion vendor/github.com/russross/blackfriday/v2/go.mod

This file was deleted.

3 changes: 0 additions & 3 deletions vendor/github.com/seccomp/libseccomp-golang/go.mod

This file was deleted.

23 changes: 0 additions & 23 deletions vendor/github.com/seccomp/libseccomp-golang/go.sum

This file was deleted.

This file was deleted.

10 changes: 0 additions & 10 deletions vendor/github.com/sirupsen/logrus/go.mod

This file was deleted.

8 changes: 0 additions & 8 deletions vendor/github.com/sirupsen/logrus/go.sum

This file was deleted.

9 changes: 0 additions & 9 deletions vendor/github.com/urfave/cli/go.mod

This file was deleted.

14 changes: 0 additions & 14 deletions vendor/github.com/urfave/cli/go.sum

This file was deleted.

8 changes: 0 additions & 8 deletions vendor/github.com/vishvananda/netlink/go.mod

This file was deleted.

4 changes: 0 additions & 4 deletions vendor/github.com/vishvananda/netlink/go.sum

This file was deleted.

3 changes: 0 additions & 3 deletions vendor/github.com/vishvananda/netns/go.mod

This file was deleted.

Empty file.
Loading

0 comments on commit 6e624d6

Please sign in to comment.