mirror of https://github.com/hashicorp/consul
Upgrade Go to 1.21
parent
1e351e286e
commit
01ca961e04
|
@ -0,0 +1,3 @@
|
||||||
|
```release-note:improvement
|
||||||
|
Upgrade to use Go 1.21.6.
|
||||||
|
```
|
|
@ -51,10 +51,12 @@ jobs:
|
||||||
with:
|
with:
|
||||||
go-version: ${{ inputs.go-version }}
|
go-version: ${{ inputs.go-version }}
|
||||||
- run: go env
|
- run: go env
|
||||||
|
- name: Set golangci-lint version
|
||||||
|
run: echo "GOLANGCI_LINT_VERSION=$(make --no-print-directory print-GOLANGCI_LINT_VERSION)" >> $GITHUB_ENV
|
||||||
- name: lint-${{ matrix.directory }}
|
- name: lint-${{ matrix.directory }}
|
||||||
uses: golangci/golangci-lint-action@639cd343e1d3b897ff35927a75193d57cfcba299 # v3.6.0
|
uses: golangci/golangci-lint-action@639cd343e1d3b897ff35927a75193d57cfcba299 # v3.6.0
|
||||||
with:
|
with:
|
||||||
working-directory: ${{ matrix.directory }}
|
working-directory: ${{ matrix.directory }}
|
||||||
version: v1.51.1
|
version: ${{ env.GOLANGCI_LINT_VERSION }}
|
||||||
args: --build-tags="${{ env.GOTAGS }}" -v
|
args: --build-tags="${{ env.GOTAGS }}" -v
|
||||||
skip-cache: true
|
skip-cache: true
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
1.20.12
|
1.21.6
|
||||||
|
|
|
@ -98,18 +98,14 @@ linters-settings:
|
||||||
- google.golang.org/protobuf
|
- google.golang.org/protobuf
|
||||||
|
|
||||||
depguard:
|
depguard:
|
||||||
list-type: denylist
|
rules:
|
||||||
include-go-root: true
|
main:
|
||||||
# A list of packages for the list type specified.
|
listMode: lax
|
||||||
# Default: []
|
deny:
|
||||||
packages:
|
- pkg: net/rpc
|
||||||
- net/rpc
|
desc: "only use forked copy in github.com/hashicorp/consul-net-rpc/net/rpc"
|
||||||
# A list of packages for the list type specified.
|
- pkg: github.com/golang/protobuf
|
||||||
# Specify an error message to output when a denied package is used.
|
desc: "only use google.golang.org/protobuf"
|
||||||
# Default: []
|
|
||||||
packages-with-error-message:
|
|
||||||
- net/rpc: "only use forked copy in github.com/hashicorp/consul-net-rpc/net/rpc"
|
|
||||||
- github.com/golang/protobuf: "only use google.golang.org/protobuf"
|
|
||||||
|
|
||||||
run:
|
run:
|
||||||
timeout: 10m
|
timeout: 10m
|
||||||
|
|
2
Makefile
2
Makefile
|
@ -10,7 +10,7 @@ GO_MODULES := $(shell find . -name go.mod -exec dirname {} \; | grep -v "proto-g
|
||||||
# These version variables can either be a valid string for "go install <module>@<version>"
|
# These version variables can either be a valid string for "go install <module>@<version>"
|
||||||
# or the string @DEV to imply use what is currently installed locally.
|
# or the string @DEV to imply use what is currently installed locally.
|
||||||
###
|
###
|
||||||
GOLANGCI_LINT_VERSION='v1.51.1'
|
GOLANGCI_LINT_VERSION='v1.55.2'
|
||||||
MOCKERY_VERSION='v2.37.1'
|
MOCKERY_VERSION='v2.37.1'
|
||||||
BUF_VERSION='v1.26.0'
|
BUF_VERSION='v1.26.0'
|
||||||
|
|
||||||
|
|
|
@ -717,8 +717,11 @@ func TestAPI_ClientTLSOptions(t *testing.T) {
|
||||||
|
|
||||||
// Should fail
|
// Should fail
|
||||||
_, err = client.Agent().Self()
|
_, err = client.Agent().Self()
|
||||||
if err == nil || !strings.Contains(err.Error(), "bad certificate") {
|
// Check for one of the possible cert error messages
|
||||||
t.Fatal(err)
|
// See https://cs.opensource.google/go/go/+/62a994837a57a7d0c58bb364b580a389488446c9
|
||||||
|
if err == nil || !(strings.Contains(err.Error(), "tls: bad certificate") ||
|
||||||
|
strings.Contains(err.Error(), "tls: certificate required")) {
|
||||||
|
t.Fatalf("expected tls certificate error, but got '%v'", err)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -138,6 +138,7 @@ func destinationRulesByPort(allPorts []string, destinationRules []*pbauth.Destin
|
||||||
return out
|
return out
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//nolint:unparam
|
||||||
func convertDestinationRule(allPorts []string, dr *pbauth.DestinationRule) ([]string, DestinationRule) {
|
func convertDestinationRule(allPorts []string, dr *pbauth.DestinationRule) ([]string, DestinationRule) {
|
||||||
ports := make(map[string]struct{})
|
ports := make(map[string]struct{})
|
||||||
if len(dr.PortNames) > 0 {
|
if len(dr.PortNames) > 0 {
|
||||||
|
|
Loading…
Reference in New Issue