diff --git a/.github/workflows/gofmt.yml b/.github/workflows/gofmt.yml index 117fcf2..51a8041 100644 --- a/.github/workflows/gofmt.yml +++ b/.github/workflows/gofmt.yml @@ -14,21 +14,21 @@ jobs: runs-on: ubuntu-latest steps: - - name: Set up Go 1.16 - uses: actions/setup-go@v1 + - name: Set up Go 1.17 + uses: actions/setup-go@v2 with: - go-version: 1.16 + go-version: 1.17 id: go - name: Check out code into the Go module directory - uses: actions/checkout@v1 + uses: actions/checkout@v2 - - uses: actions/cache@v1 + - uses: actions/cache@v2 with: path: ~/go/pkg/mod - key: ${{ runner.os }}-gofmt1.16-${{ hashFiles('**/go.sum') }} + key: ${{ runner.os }}-gofmt1.17-${{ hashFiles('**/go.sum') }} restore-keys: | - ${{ runner.os }}-gofmt1.16- + ${{ runner.os }}-gofmt1.17- - name: Install goimports run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b415905..f1cb8ca 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,10 +10,10 @@ jobs: name: Build Linux All runs-on: ubuntu-latest steps: - - name: Set up Go 1.16 - uses: actions/setup-go@v1 + - name: Set up Go 1.17 + uses: actions/setup-go@v2 with: - go-version: 1.16 + go-version: 1.17 - name: Checkout code uses: actions/checkout@v2 @@ -34,10 +34,10 @@ jobs: name: Build Windows amd64 runs-on: windows-latest steps: - - name: Set up Go 1.16 - uses: actions/setup-go@v1 + - name: Set up Go 1.17 + uses: actions/setup-go@v2 with: - go-version: 1.16 + go-version: 1.17 - name: Checkout code uses: actions/checkout@v2 @@ -58,10 +58,10 @@ jobs: name: Build Darwin amd64 runs-on: macOS-latest steps: - - name: Set up Go 1.16 - uses: actions/setup-go@v1 + - name: Set up Go 1.17 + uses: actions/setup-go@v2 with: - go-version: 1.16 + go-version: 1.17 - name: Checkout code uses: actions/checkout@v2 diff --git a/.github/workflows/smoke.yml b/.github/workflows/smoke.yml index bcc7501..2965a0a 100644 --- a/.github/workflows/smoke.yml +++ b/.github/workflows/smoke.yml @@ -18,21 +18,21 @@ jobs: runs-on: ubuntu-latest steps: - - name: Set up Go 1.16 - uses: actions/setup-go@v1 + - name: Set up Go 1.17 + uses: actions/setup-go@v2 with: - go-version: 1.16 + go-version: 1.17 id: go - name: Check out code into the Go module directory - uses: actions/checkout@v1 + uses: actions/checkout@v2 - - uses: actions/cache@v1 + - uses: actions/cache@v2 with: path: ~/go/pkg/mod - key: ${{ runner.os }}-go1.16-${{ hashFiles('**/go.sum') }} + key: ${{ runner.os }}-go1.17-${{ hashFiles('**/go.sum') }} restore-keys: | - ${{ runner.os }}-go1.16- + ${{ runner.os }}-go1.17- - name: build run: make bin-docker diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3d717e8..32697ae 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,21 +18,21 @@ jobs: runs-on: ubuntu-latest steps: - - name: Set up Go 1.16 - uses: actions/setup-go@v1 + - name: Set up Go 1.17 + uses: actions/setup-go@v2 with: - go-version: 1.16 + go-version: 1.17 id: go - name: Check out code into the Go module directory - uses: actions/checkout@v1 + uses: actions/checkout@v2 - - uses: actions/cache@v1 + - uses: actions/cache@v2 with: path: ~/go/pkg/mod - key: ${{ runner.os }}-go1.16-${{ hashFiles('**/go.sum') }} + key: ${{ runner.os }}-go1.17-${{ hashFiles('**/go.sum') }} restore-keys: | - ${{ runner.os }}-go1.16- + ${{ runner.os }}-go1.17- - name: Build run: make all @@ -51,21 +51,21 @@ jobs: os: [windows-latest, macOS-latest] steps: - - name: Set up Go 1.16 - uses: actions/setup-go@v1 + - name: Set up Go 1.17 + uses: actions/setup-go@v2 with: - go-version: 1.16 + go-version: 1.17 id: go - name: Check out code into the Go module directory - uses: actions/checkout@v1 + uses: actions/checkout@v2 - - uses: actions/cache@v1 + - uses: actions/cache@v2 with: path: ~/go/pkg/mod - key: ${{ runner.os }}-go1.16-${{ hashFiles('**/go.sum') }} + key: ${{ runner.os }}-go1.17-${{ hashFiles('**/go.sum') }} restore-keys: | - ${{ runner.os }}-go1.16- + ${{ runner.os }}-go1.17- - name: Build nebula run: go build ./cmd/nebula diff --git a/CHANGELOG.md b/CHANGELOG.md index 603e3d6..6603019 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - New config option `pki.disconnect_invalid` that will tear down tunnels when they become invalid (through expiry or removal of root trust). Default is `false`. Note, this will not currently recognize if a remote has changed certificates since the last handshake. (#370) + +### Changed + +- Build against go 1.17. (#553) ### Deprecated diff --git a/Makefile b/Makefile index 2a488b5..852ac0f 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -GOMINVERSION = 1.16 +GOMINVERSION = 1.17 NEBULA_CMD_PATH = "./cmd/nebula" GO111MODULE = on export GO111MODULE diff --git a/cmd/nebula-cert/ca_test.go b/cmd/nebula-cert/ca_test.go index 84ed791..be803ed 100644 --- a/cmd/nebula-cert/ca_test.go +++ b/cmd/nebula-cert/ca_test.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package main diff --git a/cmd/nebula-cert/sign_test.go b/cmd/nebula-cert/sign_test.go index e1e9445..4ccfaf3 100644 --- a/cmd/nebula-cert/sign_test.go +++ b/cmd/nebula-cert/sign_test.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package main diff --git a/cmd/nebula-service/logs_generic.go b/cmd/nebula-service/logs_generic.go index 5bbedc2..3b7cdd1 100644 --- a/cmd/nebula-service/logs_generic.go +++ b/cmd/nebula-service/logs_generic.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package main diff --git a/control_tester.go b/control_tester.go index ff79141..df1d2e7 100644 --- a/control_tester.go +++ b/control_tester.go @@ -1,3 +1,4 @@ +//go:build e2e_testing // +build e2e_testing package nebula diff --git a/e2e/handshakes_test.go b/e2e/handshakes_test.go index 07920fe..a4a0ea0 100644 --- a/e2e/handshakes_test.go +++ b/e2e/handshakes_test.go @@ -1,3 +1,4 @@ +//go:build e2e_testing // +build e2e_testing package e2e diff --git a/e2e/helpers_test.go b/e2e/helpers_test.go index 224784e..35938cf 100644 --- a/e2e/helpers_test.go +++ b/e2e/helpers_test.go @@ -1,3 +1,4 @@ +//go:build e2e_testing // +build e2e_testing package e2e diff --git a/e2e/router/router.go b/e2e/router/router.go index e656c16..b53bd94 100644 --- a/e2e/router/router.go +++ b/e2e/router/router.go @@ -1,3 +1,4 @@ +//go:build e2e_testing // +build e2e_testing package router diff --git a/go.mod b/go.mod index fd281c1..256a8e4 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/slackhq/nebula -go 1.16 +go 1.17 require ( github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 @@ -33,3 +33,13 @@ require ( google.golang.org/protobuf v1.26.0 gopkg.in/yaml.v2 v2.2.7 ) + +require ( + github.com/beorn7/perks v1.0.1 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/prometheus/common v0.7.0 // indirect + golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect + gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect +) diff --git a/tun_android.go b/tun_android.go index 370ae65..8d1a1ff 100644 --- a/tun_android.go +++ b/tun_android.go @@ -1,3 +1,4 @@ +//go:build !e2e_testing // +build !e2e_testing package nebula diff --git a/tun_darwin.go b/tun_darwin.go index 6e4cb6c..e2801ba 100644 --- a/tun_darwin.go +++ b/tun_darwin.go @@ -1,5 +1,5 @@ -// +build !ios -// +build !e2e_testing +//go:build !ios && !e2e_testing +// +build !ios,!e2e_testing package nebula diff --git a/tun_freebsd.go b/tun_freebsd.go index 7bbb2c4..accbd40 100644 --- a/tun_freebsd.go +++ b/tun_freebsd.go @@ -1,3 +1,4 @@ +//go:build !e2e_testing // +build !e2e_testing package nebula diff --git a/tun_ios.go b/tun_ios.go index 41fb3ca..43e29f3 100644 --- a/tun_ios.go +++ b/tun_ios.go @@ -1,5 +1,5 @@ -// +build ios -// +build !e2e_testing +//go:build ios && !e2e_testing +// +build ios,!e2e_testing package nebula diff --git a/tun_linux.go b/tun_linux.go index aba5c88..e982be9 100644 --- a/tun_linux.go +++ b/tun_linux.go @@ -1,5 +1,5 @@ -// +build !android -// +build !e2e_testing +//go:build !android && !e2e_testing +// +build !android,!e2e_testing package nebula diff --git a/tun_linux_test.go b/tun_linux_test.go index 95eb8d2..17a0faa 100644 --- a/tun_linux_test.go +++ b/tun_linux_test.go @@ -1,3 +1,4 @@ +//go:build !e2e_testing // +build !e2e_testing package nebula diff --git a/tun_tester.go b/tun_tester.go index 01b3c9d..09e2684 100644 --- a/tun_tester.go +++ b/tun_tester.go @@ -1,3 +1,4 @@ +//go:build e2e_testing // +build e2e_testing package nebula diff --git a/tun_windows.go b/tun_windows.go index 234d653..8dcc002 100644 --- a/tun_windows.go +++ b/tun_windows.go @@ -1,3 +1,4 @@ +//go:build !e2e_testing // +build !e2e_testing package nebula diff --git a/udp_android.go b/udp_android.go index 9e688f3..c41cf8f 100644 --- a/udp_android.go +++ b/udp_android.go @@ -1,3 +1,4 @@ +//go:build !e2e_testing // +build !e2e_testing package nebula diff --git a/udp_darwin.go b/udp_darwin.go index 861334f..795199a 100644 --- a/udp_darwin.go +++ b/udp_darwin.go @@ -1,3 +1,4 @@ +//go:build !e2e_testing // +build !e2e_testing package nebula diff --git a/udp_freebsd.go b/udp_freebsd.go index 184e092..2858919 100644 --- a/udp_freebsd.go +++ b/udp_freebsd.go @@ -1,3 +1,4 @@ +//go:build !e2e_testing // +build !e2e_testing package nebula diff --git a/udp_generic.go b/udp_generic.go index 64978a2..28525d9 100644 --- a/udp_generic.go +++ b/udp_generic.go @@ -1,3 +1,4 @@ +//go:build (!linux || android) && !e2e_testing // +build !linux android // +build !e2e_testing diff --git a/udp_linux.go b/udp_linux.go index 6eb22f4..45e2fe6 100644 --- a/udp_linux.go +++ b/udp_linux.go @@ -1,5 +1,5 @@ -// +build !android -// +build !e2e_testing +//go:build !android && !e2e_testing +// +build !android,!e2e_testing package nebula diff --git a/udp_linux_32.go b/udp_linux_32.go index e8c56b2..de01862 100644 --- a/udp_linux_32.go +++ b/udp_linux_32.go @@ -1,3 +1,4 @@ +//go:build linux && (386 || amd64p32 || arm || mips || mipsle) && !android && !e2e_testing // +build linux // +build 386 amd64p32 arm mips mipsle // +build !android diff --git a/udp_linux_64.go b/udp_linux_64.go index 1639a88..f88b899 100644 --- a/udp_linux_64.go +++ b/udp_linux_64.go @@ -1,3 +1,4 @@ +//go:build linux && (amd64 || arm64 || ppc64 || ppc64le || mips64 || mips64le || s390x || riscv64) && !android && !e2e_testing // +build linux // +build amd64 arm64 ppc64 ppc64le mips64 mips64le s390x riscv64 // +build !android diff --git a/udp_tester.go b/udp_tester.go index cc7e181..9350a4b 100644 --- a/udp_tester.go +++ b/udp_tester.go @@ -1,3 +1,4 @@ +//go:build e2e_testing // +build e2e_testing package nebula diff --git a/udp_windows.go b/udp_windows.go index 2d3918c..b983d97 100644 --- a/udp_windows.go +++ b/udp_windows.go @@ -1,3 +1,4 @@ +//go:build !e2e_testing // +build !e2e_testing package nebula