Skip to content

Commit

Permalink
Merge pull request #11251 from hashicorp/f-golang-1.17.1
Browse files Browse the repository at this point in the history
Upgrade Golang to 1.17.1
  • Loading branch information
Mahmood Ali committed Oct 4, 2021
2 parents efa9d4b + 0d34b22 commit 4b81337
Show file tree
Hide file tree
Showing 126 changed files with 174 additions and 62 deletions.
3 changes: 3 additions & 0 deletions .changelog/11251.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:improvement
build: Updated to Go 1.17.1
```
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ executors:
go:
working_directory: /go/src/github.com/hashicorp/nomad
docker:
- image: docker.mirror.hashicorp.services/golang:1.16.7
- image: docker.mirror.hashicorp.services/golang:1.17.1
environment:
<<: *common_envs
GOPATH: /go
Expand All @@ -524,7 +524,7 @@ executors:
environment: &machine_env
<<: *common_envs
GOPATH: /home/circleci/go
GOLANG_VERSION: 1.16.7
GOLANG_VERSION: 1.17.1

# uses a more recent image with unattended upgrades disabled properly
# but seems to break docker builds
Expand All @@ -541,7 +541,7 @@ executors:
environment:
<<: *common_envs
GOPATH: /Users/distiller/go
GOLANG_VERSION: 1.16.7
GOLANG_VERSION: 1.17.1

go-windows:
machine:
Expand All @@ -553,7 +553,7 @@ executors:
GOPATH: c:\gopath
GOBIN: c:\gopath\bin
GOTESTSUM_PATH: c:\tmp\test-reports
GOLANG_VERSION: 1.16.7
GOLANG_VERSION: 1.17.1
GOTESTSUM_VERSION: 0.4.2
VAULT_VERSION: 1.4.1

Expand Down
1 change: 1 addition & 0 deletions api/namespace_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build ent
// +build ent

package api
Expand Down
1 change: 1 addition & 0 deletions api/quota_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build ent
// +build ent

package api
Expand Down
1 change: 1 addition & 0 deletions api/sentinel_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build ent
// +build ent

package api
Expand Down
1 change: 1 addition & 0 deletions build_linux_arm.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux && cgo
// +build linux,cgo

// #cgo LDFLAGS: -mfloat-abi=hard
Expand Down
1 change: 1 addition & 0 deletions client/allocdir/fs_unix.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
// +build darwin dragonfly freebsd linux netbsd openbsd solaris

package allocdir
Expand Down
1 change: 1 addition & 0 deletions client/allocdir/task_dir_nonlinux.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !linux
// +build !linux

package allocdir
Expand Down
1 change: 1 addition & 0 deletions client/allocrunner/alloc_runner_unix_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !windows
// +build !windows

package allocrunner
Expand Down
3 changes: 2 additions & 1 deletion client/allocrunner/network_manager_nonlinux.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//+build !linux
//go:build !linux
// +build !linux

package allocrunner

Expand Down
3 changes: 2 additions & 1 deletion client/allocrunner/networking_cni.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// For now CNI is supported only on Linux.
//
//+build linux
//go:build linux
// +build linux

package allocrunner

Expand Down
11 changes: 6 additions & 5 deletions client/allocrunner/networking_cni_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

package allocrunner
Expand All @@ -19,10 +20,10 @@ func TestCNI_cniToAllocNet_Fallback(t *testing.T) {
// following:
cniResult := &cni.CNIResult{
Interfaces: map[string]*cni.Config{
"cali39179aa3-74": &cni.Config{},
"eth0": &cni.Config{
"cali39179aa3-74": {},
"eth0": {
IPConfigs: []*cni.IPConfig{
&cni.IPConfig{
{
IP: net.IPv4(192, 168, 135, 232),
},
},
Expand All @@ -48,8 +49,8 @@ func TestCNI_cniToAllocNet_Fallback(t *testing.T) {
func TestCNI_cniToAllocNet_Invalid(t *testing.T) {
cniResult := &cni.CNIResult{
Interfaces: map[string]*cni.Config{
"eth0": &cni.Config{},
"veth1": &cni.Config{
"eth0": {},
"veth1": {
IPConfigs: []*cni.IPConfig{},
},
},
Expand Down
2 changes: 2 additions & 0 deletions client/allocrunner/taskrunner/envoy_bootstrap_hook_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
//go:build !windows
// +build !windows

// todo(shoenig): Once Connect is supported on Windows, we'll need to make this
// set of tests work there too.

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

package taskrunner
Expand Down
2 changes: 2 additions & 0 deletions client/allocrunner/taskrunner/sids_hook_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
//go:build !windows
// +build !windows

// todo(shoenig): Once Connect is supported on Windows, we'll need to make this
// set of tests work there too.

Expand Down
1 change: 1 addition & 0 deletions client/allocrunner/testing.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !release
// +build !release

package allocrunner
Expand Down
1 change: 1 addition & 0 deletions client/allocwatcher/alloc_watcher_unix_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !windows
// +build !windows

package allocwatcher
Expand Down
1 change: 1 addition & 0 deletions client/enterprise_client_oss.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !ent
// +build !ent

package client
Expand Down
1 change: 1 addition & 0 deletions client/fingerprint/bridge_default.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !linux
// +build !linux

package fingerprint
Expand Down
1 change: 1 addition & 0 deletions client/fingerprint/cgroup_default.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !linux
// +build !linux

package fingerprint
Expand Down
1 change: 1 addition & 0 deletions client/fingerprint/cgroup_linux.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

package fingerprint
Expand Down
1 change: 1 addition & 0 deletions client/fingerprint/cgroup_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

package fingerprint
Expand Down
3 changes: 2 additions & 1 deletion client/fingerprint/cpu_default.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//+build !linux
//go:build !linux
// +build !linux

package fingerprint

Expand Down
1 change: 1 addition & 0 deletions client/fingerprint/fingerprint_default.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build darwin || dragonfly || freebsd || netbsd || openbsd || solaris || windows
// +build darwin dragonfly freebsd netbsd openbsd solaris windows

package fingerprint
Expand Down
1 change: 1 addition & 0 deletions client/fingerprint/network_default.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !linux && !windows
// +build !linux,!windows

package fingerprint
Expand Down
2 changes: 1 addition & 1 deletion client/fingerprint/network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ func TestNetworkFingerPrint_MultipleAliases(t *testing.T) {
}
}
expected := []string{}
for alias, _ := range cfg.HostNetworks {
for alias := range cfg.HostNetworks {
expected = append(expected, alias)
}
sort.Strings(expected)
Expand Down
1 change: 1 addition & 0 deletions client/fingerprint/storage_unix.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
// +build darwin dragonfly freebsd linux netbsd openbsd solaris

package fingerprint
Expand Down
1 change: 1 addition & 0 deletions client/lib/cgutil/cgutil_default.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !linux
// +build !linux

package cgutil
Expand Down
1 change: 1 addition & 0 deletions client/lib/cgutil/cpuset_manager_default.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !linux
// +build !linux

package cgutil
Expand Down
1 change: 1 addition & 0 deletions client/lib/fifo/fifo_unix.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !windows
// +build !windows

package fifo
Expand Down
1 change: 1 addition & 0 deletions client/pluginmanager/drivermanager/testing.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !release
// +build !release

package drivermanager
Expand Down
2 changes: 1 addition & 1 deletion client/state/db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ func TestStateDB_Batch(t *testing.T) {
if getTxID != nil {
numTransactions := getTxID() - prevTxID
writeTime := time.Now().Sub(startTime)
expectedNumTransactions := ceilDiv(2 * numAllocs, batchSize) + ceilDiv(int(writeTime), int(batchDelay))
expectedNumTransactions := ceilDiv(2*numAllocs, batchSize) + ceilDiv(int(writeTime), int(batchDelay))
require.LessOrEqual(numTransactions, expectedNumTransactions)
prevTxID = getTxID()
}
Expand Down
1 change: 1 addition & 0 deletions command/agent/agent_oss.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !ent
// +build !ent

package agent
Expand Down
1 change: 1 addition & 0 deletions command/agent/config_oss.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !ent
// +build !ent

package agent
Expand Down
2 changes: 1 addition & 1 deletion command/agent/consul/connect_proxies_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ func TestConnectProxies_Proxies(t *testing.T) {
proxies, err := pc.Proxies()
require.NoError(t, err)
require.Equal(t, map[string][]string{
"envoy": []string{"1.14.2", "1.13.2", "1.12.4", "1.11.2"},
"envoy": {"1.14.2", "1.13.2", "1.12.4", "1.11.2"},
}, proxies)
}
1 change: 1 addition & 0 deletions command/agent/host/darwin.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build darwin
// +build darwin

package host
Expand Down
1 change: 1 addition & 0 deletions command/agent/host/linux.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

package host
Expand Down
1 change: 1 addition & 0 deletions command/agent/host/unix.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !windows
// +build !windows

package host
Expand Down
1 change: 1 addition & 0 deletions command/agent/host/windows.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build windows
// +build windows

package host
Expand Down
1 change: 1 addition & 0 deletions command/agent/http_oss.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !ent
// +build !ent

package agent
Expand Down
1 change: 1 addition & 0 deletions command/agent/namespace_endpoint_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build ent
// +build ent

package agent
Expand Down
1 change: 1 addition & 0 deletions command/agent/operator_endpoint_oss.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !ent
// +build !ent

package agent
Expand Down
1 change: 1 addition & 0 deletions command/agent/stub_asset.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !ui
// +build !ui

package agent
Expand Down
1 change: 1 addition & 0 deletions command/agent/testagent_oss.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !ent
// +build !ent

package agent
Expand Down
1 change: 1 addition & 0 deletions command/alloc_exec_unix.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
// +build darwin dragonfly freebsd linux netbsd openbsd solaris

package command
Expand Down
10 changes: 5 additions & 5 deletions command/alloc_status_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ func TestAllocStatusCommand_LifecycleInfo(t *testing.T) {
a.TaskResources["init_task"] = a.TaskResources["web"]
a.TaskResources["prestart_sidecar"] = a.TaskResources["web"]
a.TaskStates = map[string]*structs.TaskState{
"web": &structs.TaskState{State: "pending"},
"init_task": &structs.TaskState{State: "running"},
"prestart_sidecar": &structs.TaskState{State: "running"},
"web": {State: "pending"},
"init_task": {State: "running"},
"prestart_sidecar": {State: "running"},
}

require.Nil(t, state.UpsertAllocs(structs.MsgTypeTestSetup, 1000, []*structs.Allocation{a}))
Expand Down Expand Up @@ -429,7 +429,7 @@ func TestAllocStatusCommand_HostVolumes(t *testing.T) {
// fakes the placement enough so that we have something to iterate
// on in 'nomad alloc status'
alloc.TaskStates = map[string]*structs.TaskState{
"web": &structs.TaskState{
"web": {
Events: []*structs.TaskEvent{
structs.NewTaskEvent("test event").SetMessage("test msg"),
},
Expand Down Expand Up @@ -504,7 +504,7 @@ func TestAllocStatusCommand_CSIVolumes(t *testing.T) {
}
// if we don't set a task state, there's nothing to iterate on alloc status
alloc.TaskStates = map[string]*structs.TaskState{
"web": &structs.TaskState{
"web": {
Events: []*structs.TaskEvent{
structs.NewTaskEvent("test event").SetMessage("test msg"),
},
Expand Down
1 change: 1 addition & 0 deletions command/commands_oss.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !ent
// +build !ent

package command
Expand Down
1 change: 1 addition & 0 deletions command/namespace_apply_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build ent
// +build ent

package command
Expand Down
1 change: 1 addition & 0 deletions command/namespace_delete_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build ent
// +build ent

package command
Expand Down
1 change: 1 addition & 0 deletions command/namespace_inspect_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build ent
// +build ent

package command
Expand Down
1 change: 1 addition & 0 deletions command/namespace_list_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build ent
// +build ent

package command
Expand Down
1 change: 1 addition & 0 deletions command/namespace_status_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build ent
// +build ent

package command
Expand Down
1 change: 1 addition & 0 deletions command/quota_delete_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build ent
// +build ent

package command
Expand Down
1 change: 1 addition & 0 deletions command/quota_inspect_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build ent
// +build ent

package command
Expand Down
1 change: 1 addition & 0 deletions command/quota_list_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build ent
// +build ent

package command
Expand Down
1 change: 1 addition & 0 deletions command/quota_status_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build ent
// +build ent

package command
Expand Down
2 changes: 1 addition & 1 deletion contributing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ A development environment is supplied via Vagrant to make getting started easier

Developing without Vagrant
---
1. Install [Go 1.16.7+](https://golang.org/) *(Note: `gcc-go` is not supported)*
1. Install [Go 1.17.1+](https://golang.org/) *(Note: `gcc-go` is not supported)*
1. Clone this repo
```sh
$ git clone https://github.com/hashicorp/nomad.git
Expand Down
Loading

0 comments on commit 4b81337

Please sign in to comment.