Skip to content

Commit

Permalink
Merge pull request #6719 from dmcgowan/backport-1.5-6666
Browse files Browse the repository at this point in the history
[release/1.5] Upgrade Go to 1.17 and golangci-lint
  • Loading branch information
dmcgowan committed Mar 23, 2022
2 parents 37fcd4d + 7f03aea commit 85b9bc9
Show file tree
Hide file tree
Showing 374 changed files with 433 additions and 4,951 deletions.
23 changes: 11 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

strategy:
matrix:
go-version: [1.16.15]
go-version: [1.17.8]
os: [ubuntu-18.04, macos-10.15, windows-2019]

steps:
Expand All @@ -38,12 +38,11 @@ jobs:
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
- uses: golangci/golangci-lint-action@v2
- uses: golangci/golangci-lint-action@v3
with:
version: v1.42.0
version: v1.44.2
working-directory: src/github.com/containerd/containerd
args: --timeout=5m
skip-go-installation: true

#
# Project checks
Expand All @@ -56,7 +55,7 @@ jobs:
steps:
- uses: actions/setup-go@v2
with:
go-version: '1.16.15'
go-version: '1.17.8'

- shell: bash
run: |
Expand Down Expand Up @@ -87,7 +86,7 @@ jobs:
steps:
- uses: actions/setup-go@v2
with:
go-version: '1.16.15'
go-version: '1.17.8'

- uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -120,7 +119,7 @@ jobs:
steps:
- uses: actions/setup-go@v2
with:
go-version: '1.16.15'
go-version: '1.17.8'

- name: Set env
shell: bash
Expand Down Expand Up @@ -166,7 +165,7 @@ jobs:
steps:
- uses: actions/setup-go@v2
with:
go-version: '1.16.15'
go-version: '1.17.8'
- name: Set env
shell: bash
run: |
Expand Down Expand Up @@ -231,7 +230,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-18.04, macos-10.15, windows-2019]
go-version: ['1.16.15']
go-version: ['1.17.8']
include:
# Go 1.13.x is still used by Docker/Moby
- go-version: '1.13.x'
Expand Down Expand Up @@ -277,7 +276,7 @@ jobs:
steps:
- uses: actions/setup-go@v2
with:
go-version: '1.16.15'
go-version: '1.17.8'

- uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -358,7 +357,7 @@ jobs:
steps:
- uses: actions/setup-go@v2
with:
go-version: '1.16.15'
go-version: '1.17.8'

- uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -510,7 +509,7 @@ jobs:
steps:
- uses: actions/setup-go@v2
with:
go-version: '1.16.15'
go-version: '1.17.8'
- uses: actions/checkout@v2
with:
path: src/github.com/containerd/containerd
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
steps:
- uses: actions/setup-go@v2
with:
go-version: '1.16.15'
go-version: '1.17.8'

- uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -135,7 +135,7 @@ jobs:
steps:
- uses: actions/setup-go@v2
with:
go-version: '1.16.15'
go-version: '1.17.8'

- uses: actions/checkout@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: '1.16.15'
go-version: '1.17.8'

- name: Set env
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .zuul/playbooks/containerd-build/integration-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
become: yes
roles:
- role: config-golang
go_version: '1.16.15'
go_version: '1.17.8'
arch: arm64
tasks:
- name: Install pre-requisites
Expand Down
2 changes: 1 addition & 1 deletion .zuul/playbooks/containerd-build/run.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
become: yes
roles:
- role: config-golang
go_version: '1.16.15'
go_version: '1.17.8'
arch: arm64
tasks:
- name: Build containerd
Expand Down
2 changes: 1 addition & 1 deletion .zuul/playbooks/containerd-build/unit-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
become: yes
roles:
- role: config-golang
go_version: '1.16.15'
go_version: '1.17.8'
arch: arm64
tasks:
- name: Build and test containerd
Expand Down
2 changes: 1 addition & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Vagrant.configure("2") do |config|
config.vm.provision "install-golang", type: "shell", run: "once" do |sh|
sh.upload_path = "/tmp/vagrant-install-golang"
sh.env = {
'GO_VERSION': ENV['GO_VERSION'] || "1.16.15",
'GO_VERSION': ENV['GO_VERSION'] || "1.17.8",
}
sh.inline = <<~SHELL
#!/usr/bin/env bash
Expand Down
2 changes: 1 addition & 1 deletion archive/tar.go
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ func createTarFile(ctx context.Context, path, extractDir string, hdr *tar.Header
return nil

default:
return errors.Errorf("unhandled tar header type %d\n", hdr.Typeflag)
return errors.Errorf("unhandled tar header type %d", hdr.Typeflag)
}

// Lchown is not supported on Windows.
Expand Down
1 change: 1 addition & 0 deletions archive/tar_freebsd.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build freebsd
// +build freebsd

/*
Expand Down
1 change: 1 addition & 0 deletions archive/tar_linux_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

/*
Expand Down
1 change: 1 addition & 0 deletions archive/tar_mostunix.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !windows && !freebsd
// +build !windows,!freebsd

/*
Expand Down
1 change: 1 addition & 0 deletions archive/tar_opts_linux.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

/*
Expand Down
1 change: 1 addition & 0 deletions archive/tar_opts_windows.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build windows
// +build windows

/*
Expand Down
1 change: 1 addition & 0 deletions archive/tar_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !windows && !darwin
// +build !windows,!darwin

/*
Expand Down
1 change: 1 addition & 0 deletions archive/tar_unix.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !windows
// +build !windows

/*
Expand Down
1 change: 1 addition & 0 deletions archive/tar_windows.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build windows
// +build windows

/*
Expand Down
1 change: 1 addition & 0 deletions archive/time_unix.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !windows
// +build !windows

/*
Expand Down
1 change: 1 addition & 0 deletions cio/io_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !windows
// +build !windows

/*
Expand Down
1 change: 1 addition & 0 deletions cio/io_unix.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !windows
// +build !windows

/*
Expand Down
1 change: 1 addition & 0 deletions cio/io_unix_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !windows
// +build !windows

/*
Expand Down
1 change: 1 addition & 0 deletions cio/io_windows_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build windows
// +build windows

/*
Expand Down
1 change: 1 addition & 0 deletions cmd/containerd-shim-runc-v1/main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

/*
Expand Down
1 change: 1 addition & 0 deletions cmd/containerd-shim-runc-v2/main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

/*
Expand Down
1 change: 1 addition & 0 deletions cmd/containerd-shim/main_unix.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !windows
// +build !windows

/*
Expand Down
1 change: 1 addition & 0 deletions cmd/containerd-shim/shim_darwin.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build darwin
// +build darwin

/*
Expand Down
1 change: 1 addition & 0 deletions cmd/containerd-shim/shim_freebsd.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build freebsd
// +build freebsd

/*
Expand Down
1 change: 1 addition & 0 deletions cmd/containerd-stress/rlimit_freebsd.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build freebsd
// +build freebsd

/*
Expand Down
1 change: 1 addition & 0 deletions cmd/containerd-stress/rlimit_unix.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !windows && !freebsd
// +build !windows,!freebsd

/*
Expand Down
1 change: 1 addition & 0 deletions cmd/containerd-stress/rlimit_windows.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build windows
// +build windows

/*
Expand Down
1 change: 1 addition & 0 deletions cmd/containerd/builtins_aufs_linux.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !no_aufs
// +build !no_aufs

/*
Expand Down
1 change: 1 addition & 0 deletions cmd/containerd/builtins_btrfs_linux.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !no_btrfs && cgo
// +build !no_btrfs,cgo

/*
Expand Down
1 change: 1 addition & 0 deletions cmd/containerd/builtins_cri.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build (linux && !no_cri) || (windows && !no_cri)
// +build linux,!no_cri windows,!no_cri

/*
Expand Down
1 change: 1 addition & 0 deletions cmd/containerd/builtins_devmapper_linux.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !no_devmapper
// +build !no_devmapper

/*
Expand Down
1 change: 1 addition & 0 deletions cmd/containerd/builtins_unix.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build darwin || freebsd || solaris
// +build darwin freebsd solaris

/*
Expand Down
1 change: 1 addition & 0 deletions cmd/containerd/builtins_windows.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build windows
// +build windows

/*
Expand Down
1 change: 1 addition & 0 deletions cmd/containerd/builtins_zfs_linux.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !no_zfs
// +build !no_zfs

/*
Expand Down
1 change: 1 addition & 0 deletions cmd/containerd/command/config_unsupported.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !linux && !windows && !solaris
// +build !linux,!windows,!solaris

/*
Expand Down
1 change: 1 addition & 0 deletions cmd/containerd/command/main_unix.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux || darwin || freebsd || solaris
// +build linux darwin freebsd solaris

/*
Expand Down
1 change: 1 addition & 0 deletions cmd/containerd/command/notify_linux.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

/*
Expand Down
1 change: 1 addition & 0 deletions cmd/containerd/command/notify_unsupported.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !linux
// +build !linux

/*
Expand Down
1 change: 1 addition & 0 deletions cmd/containerd/command/service_unsupported.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !windows
// +build !windows

/*
Expand Down
1 change: 1 addition & 0 deletions cmd/ctr/app/main_unix.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !windows
// +build !windows

/*
Expand Down
1 change: 1 addition & 0 deletions cmd/ctr/commands/commands_unix.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !windows
// +build !windows

/*
Expand Down
1 change: 1 addition & 0 deletions cmd/ctr/commands/commands_windows.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build windows
// +build windows

/*
Expand Down
1 change: 1 addition & 0 deletions cmd/ctr/commands/namespaces/namespaces_other.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !linux
// +build !linux

/*
Expand Down
1 change: 1 addition & 0 deletions cmd/ctr/commands/pprof/pprof_unix.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !windows
// +build !windows

/*
Expand Down
1 change: 1 addition & 0 deletions cmd/ctr/commands/run/run_unix.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !windows
// +build !windows

/*
Expand Down
1 change: 1 addition & 0 deletions cmd/ctr/commands/shim/io_unix.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !windows
// +build !windows

/*
Expand Down
1 change: 1 addition & 0 deletions cmd/ctr/commands/shim/shim.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !windows
// +build !windows

/*
Expand Down
3 changes: 2 additions & 1 deletion cmd/ctr/commands/signals_notlinux.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//+build !linux
//go:build !linux
// +build !linux

/*
Copyright The containerd Authors.
Expand Down
1 change: 1 addition & 0 deletions cmd/ctr/commands/tasks/metrics.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

/*
Expand Down
1 change: 1 addition & 0 deletions cmd/ctr/commands/tasks/tasks_unix.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !windows
// +build !windows

/*
Expand Down
1 change: 1 addition & 0 deletions container_opts_unix.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !windows
// +build !windows

/*
Expand Down
1 change: 1 addition & 0 deletions content/local/store_bsd.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build darwin || freebsd || netbsd
// +build darwin freebsd netbsd

/*
Expand Down

0 comments on commit 85b9bc9

Please sign in to comment.