From 46137ff119ac5034170572690f1dc3780bab1995 Mon Sep 17 00:00:00 2001 From: jm96441n Date: Tue, 23 Jul 2024 12:29:35 -0400 Subject: [PATCH 1/4] move to maintained fork of mapstructure --- agent/config/config.go | 2 +- agent/connect/ca/provider_aws.go | 2 +- agent/connect/ca/provider_consul_config.go | 2 +- agent/connect/ca/provider_vault.go | 2 +- agent/consul/authmethod/authmethods.go | 2 +- agent/consul/fsm/commands_ce_test.go | 2 +- agent/consul/fsm/snapshot_ce.go | 2 +- agent/discovery_chain_endpoint.go | 2 +- agent/dns/context.go | 2 +- agent/envoyextensions/builtin/aws-lambda/aws_lambda.go | 2 +- agent/envoyextensions/builtin/ext-authz/ext_authz.go | 2 +- agent/envoyextensions/builtin/lua/lua.go | 2 +- .../builtin/otel-access-logging/otel_access_logging.go | 2 +- .../builtin/property-override/property_override.go | 2 +- agent/envoyextensions/builtin/wasm/structs.go | 2 +- agent/grpc-external/options.go | 2 +- agent/grpc-external/querymeta.go | 2 +- agent/http.go | 2 +- agent/proxycfg/connect_proxy.go | 2 +- agent/proxycfg/upstreams.go | 2 +- agent/structs/config_entry.go | 2 +- agent/structs/connect_ca.go | 2 +- agent/xds/config/config.go | 2 +- api/acl.go | 2 +- api/config_entry.go | 2 +- api/connect_ca.go | 2 +- api/go.mod | 2 +- api/go.sum | 4 ++-- api/watch/watch.go | 2 +- command/acl/acl_helpers.go | 2 +- command/connect/envoy/envoy.go | 2 +- command/connect/redirecttraffic/redirect_traffic.go | 2 +- command/flags/config.go | 2 +- command/flags/config_test.go | 2 +- command/helpers/helpers.go | 2 +- command/services/config.go | 2 +- connect/proxy/config.go | 2 +- go.mod | 3 ++- go.sum | 2 ++ lib/decode/decode_test.go | 2 +- lib/map_walker.go | 2 +- test/integration/consul-container/libs/cluster/agent.go | 2 +- 42 files changed, 45 insertions(+), 42 deletions(-) diff --git a/agent/config/config.go b/agent/config/config.go index 3201f790a752..27b6cc058001 100644 --- a/agent/config/config.go +++ b/agent/config/config.go @@ -9,7 +9,7 @@ import ( "time" "github.com/hashicorp/hcl" - "github.com/mitchellh/mapstructure" + "github.com/go-viper/mapstructure/v2" "github.com/hashicorp/consul/lib/decode" ) diff --git a/agent/connect/ca/provider_aws.go b/agent/connect/ca/provider_aws.go index 1ce5a5eba57d..58daf3563c27 100644 --- a/agent/connect/ca/provider_aws.go +++ b/agent/connect/ca/provider_aws.go @@ -17,7 +17,7 @@ import ( "github.com/aws/aws-sdk-go/service/acmpca" "github.com/hashicorp/go-hclog" - "github.com/mitchellh/mapstructure" + "github.com/go-viper/mapstructure/v2" "github.com/hashicorp/consul/agent/connect" "github.com/hashicorp/consul/agent/structs" diff --git a/agent/connect/ca/provider_consul_config.go b/agent/connect/ca/provider_consul_config.go index c7e8b0346cdb..e35bbca9b3cf 100644 --- a/agent/connect/ca/provider_consul_config.go +++ b/agent/connect/ca/provider_consul_config.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/consul/agent/connect" "github.com/hashicorp/consul/agent/structs" - "github.com/mitchellh/mapstructure" + "github.com/go-viper/mapstructure/v2" ) func ParseConsulCAConfig(raw map[string]interface{}) (*structs.ConsulCAProviderConfig, error) { diff --git a/agent/connect/ca/provider_vault.go b/agent/connect/ca/provider_vault.go index 692b9a568c23..4350d2e3d8e0 100644 --- a/agent/connect/ca/provider_vault.go +++ b/agent/connect/ca/provider_vault.go @@ -16,7 +16,7 @@ import ( "github.com/hashicorp/go-hclog" vaultapi "github.com/hashicorp/vault/api" - "github.com/mitchellh/mapstructure" + "github.com/go-viper/mapstructure/v2" "github.com/hashicorp/consul/agent/connect" "github.com/hashicorp/consul/agent/structs" diff --git a/agent/consul/authmethod/authmethods.go b/agent/consul/authmethod/authmethods.go index d03e2b410cb4..02c26782ab0e 100644 --- a/agent/consul/authmethod/authmethods.go +++ b/agent/consul/authmethod/authmethods.go @@ -10,7 +10,7 @@ import ( "sync" "github.com/hashicorp/go-hclog" - "github.com/mitchellh/mapstructure" + "github.com/go-viper/mapstructure/v2" "github.com/hashicorp/consul/acl" "github.com/hashicorp/consul/agent/structs" diff --git a/agent/consul/fsm/commands_ce_test.go b/agent/consul/fsm/commands_ce_test.go index c24dd2ea8f40..bec7009f3a55 100644 --- a/agent/consul/fsm/commands_ce_test.go +++ b/agent/consul/fsm/commands_ce_test.go @@ -13,7 +13,7 @@ import ( "testing" "time" - "github.com/mitchellh/mapstructure" + "github.com/go-viper/mapstructure/v2" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "google.golang.org/grpc" diff --git a/agent/consul/fsm/snapshot_ce.go b/agent/consul/fsm/snapshot_ce.go index 0fcd38703661..1ad25459f06c 100644 --- a/agent/consul/fsm/snapshot_ce.go +++ b/agent/consul/fsm/snapshot_ce.go @@ -8,7 +8,7 @@ import ( "net" "github.com/hashicorp/raft" - "github.com/mitchellh/mapstructure" + "github.com/go-viper/mapstructure/v2" "github.com/hashicorp/consul-net-rpc/go-msgpack/codec" diff --git a/agent/discovery_chain_endpoint.go b/agent/discovery_chain_endpoint.go index 69a5e668f46e..58018038fd80 100644 --- a/agent/discovery_chain_endpoint.go +++ b/agent/discovery_chain_endpoint.go @@ -9,7 +9,7 @@ import ( "strings" "time" - "github.com/mitchellh/mapstructure" + "github.com/go-viper/mapstructure/v2" "github.com/hashicorp/consul/acl" cachetype "github.com/hashicorp/consul/agent/cache-types" diff --git a/agent/dns/context.go b/agent/dns/context.go index 2054d6316a91..350e670827b9 100644 --- a/agent/dns/context.go +++ b/agent/dns/context.go @@ -7,7 +7,7 @@ import ( "context" "fmt" - "github.com/mitchellh/mapstructure" + "github.com/go-viper/mapstructure/v2" "google.golang.org/grpc/metadata" ) diff --git a/agent/envoyextensions/builtin/aws-lambda/aws_lambda.go b/agent/envoyextensions/builtin/aws-lambda/aws_lambda.go index 978fc5cf5552..3b8c39f87697 100644 --- a/agent/envoyextensions/builtin/aws-lambda/aws_lambda.go +++ b/agent/envoyextensions/builtin/aws-lambda/aws_lambda.go @@ -17,7 +17,7 @@ import ( envoy_http_v3 "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/http_connection_manager/v3" envoy_tls_v3 "github.com/envoyproxy/go-control-plane/envoy/extensions/transport_sockets/tls/v3" envoy_resource_v3 "github.com/envoyproxy/go-control-plane/pkg/resource/v3" - "github.com/mitchellh/mapstructure" + "github.com/go-viper/mapstructure/v2" pstruct "google.golang.org/protobuf/types/known/structpb" "github.com/hashicorp/consul/api" diff --git a/agent/envoyextensions/builtin/ext-authz/ext_authz.go b/agent/envoyextensions/builtin/ext-authz/ext_authz.go index 00e1d47640c4..55ababed3a4f 100644 --- a/agent/envoyextensions/builtin/ext-authz/ext_authz.go +++ b/agent/envoyextensions/builtin/ext-authz/ext_authz.go @@ -7,7 +7,7 @@ import ( "fmt" envoy_listener_v3 "github.com/envoyproxy/go-control-plane/envoy/config/listener/v3" - "github.com/mitchellh/mapstructure" + "github.com/go-viper/mapstructure/v2" "github.com/hashicorp/consul/api" ext_cmn "github.com/hashicorp/consul/envoyextensions/extensioncommon" diff --git a/agent/envoyextensions/builtin/lua/lua.go b/agent/envoyextensions/builtin/lua/lua.go index 91e912842ef4..d068ff951733 100644 --- a/agent/envoyextensions/builtin/lua/lua.go +++ b/agent/envoyextensions/builtin/lua/lua.go @@ -15,7 +15,7 @@ import ( "github.com/hashicorp/consul/api" "github.com/hashicorp/consul/envoyextensions/extensioncommon" "github.com/hashicorp/go-multierror" - "github.com/mitchellh/mapstructure" + "github.com/go-viper/mapstructure/v2" ) var _ extensioncommon.BasicExtension = (*lua)(nil) diff --git a/agent/envoyextensions/builtin/otel-access-logging/otel_access_logging.go b/agent/envoyextensions/builtin/otel-access-logging/otel_access_logging.go index 2f003b552582..f667b014b3df 100644 --- a/agent/envoyextensions/builtin/otel-access-logging/otel_access_logging.go +++ b/agent/envoyextensions/builtin/otel-access-logging/otel_access_logging.go @@ -9,7 +9,7 @@ import ( envoy_extensions_access_loggers_v3 "github.com/envoyproxy/go-control-plane/envoy/config/accesslog/v3" envoy_listener_v3 "github.com/envoyproxy/go-control-plane/envoy/config/listener/v3" envoy_extensions_access_loggers_otel_v3 "github.com/envoyproxy/go-control-plane/envoy/extensions/access_loggers/open_telemetry/v3" - "github.com/mitchellh/mapstructure" + "github.com/go-viper/mapstructure/v2" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/types/known/anypb" diff --git a/agent/envoyextensions/builtin/property-override/property_override.go b/agent/envoyextensions/builtin/property-override/property_override.go index 70577a56e3d4..d11826df1b7f 100644 --- a/agent/envoyextensions/builtin/property-override/property_override.go +++ b/agent/envoyextensions/builtin/property-override/property_override.go @@ -12,7 +12,7 @@ import ( envoy_route_v3 "github.com/envoyproxy/go-control-plane/envoy/config/route/v3" "github.com/hashicorp/consul/lib/decode" "github.com/hashicorp/go-multierror" - "github.com/mitchellh/mapstructure" + "github.com/go-viper/mapstructure/v2" "google.golang.org/protobuf/proto" "github.com/hashicorp/consul/api" diff --git a/agent/envoyextensions/builtin/wasm/structs.go b/agent/envoyextensions/builtin/wasm/structs.go index 67540fee56c9..f592de63c548 100644 --- a/agent/envoyextensions/builtin/wasm/structs.go +++ b/agent/envoyextensions/builtin/wasm/structs.go @@ -14,7 +14,7 @@ import ( "github.com/hashicorp/consul/api" "github.com/hashicorp/consul/envoyextensions/extensioncommon" "github.com/hashicorp/go-multierror" - "github.com/mitchellh/mapstructure" + "github.com/go-viper/mapstructure/v2" "google.golang.org/protobuf/types/known/anypb" "google.golang.org/protobuf/types/known/durationpb" "google.golang.org/protobuf/types/known/wrapperspb" diff --git a/agent/grpc-external/options.go b/agent/grpc-external/options.go index 04e5c10efb51..9c72c9aa5ebf 100644 --- a/agent/grpc-external/options.go +++ b/agent/grpc-external/options.go @@ -8,7 +8,7 @@ import ( "fmt" "github.com/hashicorp/consul/agent/structs" - "github.com/mitchellh/mapstructure" + "github.com/go-viper/mapstructure/v2" "google.golang.org/grpc/metadata" ) diff --git a/agent/grpc-external/querymeta.go b/agent/grpc-external/querymeta.go index 0f4dd52adb86..26c625c5d90d 100644 --- a/agent/grpc-external/querymeta.go +++ b/agent/grpc-external/querymeta.go @@ -7,7 +7,7 @@ import ( "fmt" "reflect" - "github.com/mitchellh/mapstructure" + "github.com/go-viper/mapstructure/v2" "google.golang.org/grpc/metadata" "github.com/hashicorp/consul/agent/structs" diff --git a/agent/http.go b/agent/http.go index 66c3a8bd36c0..616e4bc5af58 100644 --- a/agent/http.go +++ b/agent/http.go @@ -23,7 +23,7 @@ import ( "github.com/armon/go-metrics" "github.com/armon/go-metrics/prometheus" "github.com/hashicorp/go-cleanhttp" - "github.com/mitchellh/mapstructure" + "github.com/go-viper/mapstructure/v2" "github.com/pkg/errors" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" diff --git a/agent/proxycfg/connect_proxy.go b/agent/proxycfg/connect_proxy.go index 0a8c1737923e..fe3ca766f692 100644 --- a/agent/proxycfg/connect_proxy.go +++ b/agent/proxycfg/connect_proxy.go @@ -11,7 +11,7 @@ import ( "path" "strings" - "github.com/mitchellh/mapstructure" + "github.com/go-viper/mapstructure/v2" "github.com/hashicorp/consul/acl" cachetype "github.com/hashicorp/consul/agent/cache-types" diff --git a/agent/proxycfg/upstreams.go b/agent/proxycfg/upstreams.go index 209a3446d981..03b921dac5a1 100644 --- a/agent/proxycfg/upstreams.go +++ b/agent/proxycfg/upstreams.go @@ -9,7 +9,7 @@ import ( "strings" "time" - "github.com/mitchellh/mapstructure" + "github.com/go-viper/mapstructure/v2" "github.com/hashicorp/consul/acl" cachetype "github.com/hashicorp/consul/agent/cache-types" diff --git a/agent/structs/config_entry.go b/agent/structs/config_entry.go index 5d419e083295..3e8d88993714 100644 --- a/agent/structs/config_entry.go +++ b/agent/structs/config_entry.go @@ -15,7 +15,7 @@ import ( "github.com/hashicorp/go-multierror" "github.com/mitchellh/hashstructure" - "github.com/mitchellh/mapstructure" + "github.com/go-viper/mapstructure/v2" "github.com/hashicorp/consul-net-rpc/go-msgpack/codec" diff --git a/agent/structs/connect_ca.go b/agent/structs/connect_ca.go index 267aeba5e63d..0d7c1babee49 100644 --- a/agent/structs/connect_ca.go +++ b/agent/structs/connect_ca.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/consul/lib/stringslice" - "github.com/mitchellh/mapstructure" + "github.com/go-viper/mapstructure/v2" "github.com/hashicorp/consul/acl" "github.com/hashicorp/consul/lib" diff --git a/agent/xds/config/config.go b/agent/xds/config/config.go index ed7da3c61c02..c7b9cd6f340f 100644 --- a/agent/xds/config/config.go +++ b/agent/xds/config/config.go @@ -10,7 +10,7 @@ import ( envoy_cluster_v3 "github.com/envoyproxy/go-control-plane/envoy/config/cluster/v3" "google.golang.org/protobuf/types/known/durationpb" - "github.com/mitchellh/mapstructure" + "github.com/go-viper/mapstructure/v2" "google.golang.org/protobuf/types/known/wrapperspb" "github.com/hashicorp/consul/agent/structs" diff --git a/api/acl.go b/api/acl.go index fcea0fdde082..80101a456202 100644 --- a/api/acl.go +++ b/api/acl.go @@ -10,7 +10,7 @@ import ( "net/url" "time" - "github.com/mitchellh/mapstructure" + "github.com/go-viper/mapstructure/v2" ) const ( diff --git a/api/config_entry.go b/api/config_entry.go index 8c3a080f70bd..458553f799a5 100644 --- a/api/config_entry.go +++ b/api/config_entry.go @@ -12,7 +12,7 @@ import ( "strings" "time" - "github.com/mitchellh/mapstructure" + "github.com/go-viper/mapstructure/v2" ) const ( diff --git a/api/connect_ca.go b/api/connect_ca.go index 8a5c9f870e95..d2d276cafaf0 100644 --- a/api/connect_ca.go +++ b/api/connect_ca.go @@ -7,7 +7,7 @@ import ( "fmt" "time" - "github.com/mitchellh/mapstructure" + "github.com/go-viper/mapstructure/v2" ) // CAConfig is the structure for the Connect CA configuration. diff --git a/api/go.mod b/api/go.mod index 0a1f7fee6fcf..914cef740a79 100644 --- a/api/go.mod +++ b/api/go.mod @@ -10,6 +10,7 @@ replace ( retract v1.28.0 // tag was mutated require ( + github.com/go-viper/mapstructure/v2 v2.0.0 github.com/google/go-cmp v0.5.9 github.com/hashicorp/consul/proto-public v0.6.1 github.com/hashicorp/consul/sdk v0.16.1 @@ -19,7 +20,6 @@ require ( github.com/hashicorp/go-rootcerts v1.0.2 github.com/hashicorp/go-uuid v1.0.3 github.com/hashicorp/serf v0.10.1 - github.com/mitchellh/mapstructure v1.5.0 github.com/stretchr/testify v1.8.4 golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 google.golang.org/protobuf v1.33.0 diff --git a/api/go.sum b/api/go.sum index 0821e2748959..bd28729b1c2d 100644 --- a/api/go.sum +++ b/api/go.sum @@ -30,6 +30,8 @@ github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2 github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-viper/mapstructure/v2 v2.0.0 h1:dhn8MZ1gZ0mzeodTG3jt5Vj/o87xZKuNAprG2mQfMfc= +github.com/go-viper/mapstructure/v2 v2.0.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -119,8 +121,6 @@ github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= -github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= diff --git a/api/watch/watch.go b/api/watch/watch.go index ea00f8ef0cba..36f3c2e82631 100644 --- a/api/watch/watch.go +++ b/api/watch/watch.go @@ -12,7 +12,7 @@ import ( consulapi "github.com/hashicorp/consul/api" "github.com/hashicorp/go-hclog" - "github.com/mitchellh/mapstructure" + "github.com/go-viper/mapstructure/v2" ) const DefaultTimeout = 10 * time.Second diff --git a/command/acl/acl_helpers.go b/command/acl/acl_helpers.go index a847f979fb63..a18cac852959 100644 --- a/command/acl/acl_helpers.go +++ b/command/acl/acl_helpers.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/consul/api" "github.com/hashicorp/consul/command/helpers" "github.com/hashicorp/hcl" - "github.com/mitchellh/mapstructure" + "github.com/go-viper/mapstructure/v2" ) func GetTokenAccessorIDFromPartial(client *api.Client, partialAccessorID string) (string, error) { diff --git a/command/connect/envoy/envoy.go b/command/connect/envoy/envoy.go index b974a525e9cd..9ca18583a86a 100644 --- a/command/connect/envoy/envoy.go +++ b/command/connect/envoy/envoy.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/go-hclog" "github.com/hashicorp/go-version" "github.com/mitchellh/cli" - "github.com/mitchellh/mapstructure" + "github.com/go-viper/mapstructure/v2" "google.golang.org/protobuf/encoding/protojson" "github.com/hashicorp/consul/acl" diff --git a/command/connect/redirecttraffic/redirect_traffic.go b/command/connect/redirecttraffic/redirect_traffic.go index 8a597696b7f0..3989011362c9 100644 --- a/command/connect/redirecttraffic/redirect_traffic.go +++ b/command/connect/redirecttraffic/redirect_traffic.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/consul/command/flags" "github.com/hashicorp/consul/sdk/iptables" "github.com/mitchellh/cli" - "github.com/mitchellh/mapstructure" + "github.com/go-viper/mapstructure/v2" ) func New(ui cli.Ui) *cmd { diff --git a/command/flags/config.go b/command/flags/config.go index 39c615554d67..042c892f8f8e 100644 --- a/command/flags/config.go +++ b/command/flags/config.go @@ -12,7 +12,7 @@ import ( "strconv" "time" - "github.com/mitchellh/mapstructure" + "github.com/go-viper/mapstructure/v2" ) // TODO (slackpad) - Trying out a different pattern here for config handling. diff --git a/command/flags/config_test.go b/command/flags/config_test.go index 1a6d69ca4b57..5cbc8a53ecf5 100644 --- a/command/flags/config_test.go +++ b/command/flags/config_test.go @@ -12,7 +12,7 @@ import ( "strings" "testing" - "github.com/mitchellh/mapstructure" + "github.com/go-viper/mapstructure/v2" ) func TestConfigUtil_Values(t *testing.T) { diff --git a/command/helpers/helpers.go b/command/helpers/helpers.go index e4b95fff37e8..b148e5d9aba9 100644 --- a/command/helpers/helpers.go +++ b/command/helpers/helpers.go @@ -11,7 +11,7 @@ import ( "strings" "time" - "github.com/mitchellh/mapstructure" + "github.com/go-viper/mapstructure/v2" "github.com/hashicorp/consul/api" "github.com/hashicorp/consul/lib/decode" diff --git a/command/services/config.go b/command/services/config.go index 1a173078d6f0..7d8ae975f4d1 100644 --- a/command/services/config.go +++ b/command/services/config.go @@ -8,7 +8,7 @@ import ( "time" "github.com/mitchellh/cli" - "github.com/mitchellh/mapstructure" + "github.com/go-viper/mapstructure/v2" "github.com/hashicorp/consul/agent/config" "github.com/hashicorp/consul/agent/structs" diff --git a/connect/proxy/config.go b/connect/proxy/config.go index 19476d48d49f..5e883fae4fef 100644 --- a/connect/proxy/config.go +++ b/connect/proxy/config.go @@ -7,7 +7,7 @@ import ( "fmt" "time" - "github.com/mitchellh/mapstructure" + "github.com/go-viper/mapstructure/v2" "github.com/hashicorp/consul/api" "github.com/hashicorp/consul/api/watch" diff --git a/go.mod b/go.mod index a6ebcbaabd58..fff67b9efcfa 100644 --- a/go.mod +++ b/go.mod @@ -35,6 +35,7 @@ require ( github.com/go-jose/go-jose/v3 v3.0.3 github.com/go-openapi/runtime v0.26.2 github.com/go-openapi/strfmt v0.21.10 + github.com/go-viper/mapstructure/v2 v2.0.0 github.com/google/go-cmp v0.5.9 github.com/google/gofuzz v1.2.0 github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 @@ -92,7 +93,6 @@ require ( github.com/mitchellh/go-testing-interface v1.14.0 github.com/mitchellh/hashstructure v0.0.0-20170609045927-2bca23e0e452 github.com/mitchellh/hashstructure/v2 v2.0.2 - github.com/mitchellh/mapstructure v1.5.0 github.com/mitchellh/pointerstructure v1.2.1 github.com/mitchellh/reflectwalk v1.0.2 github.com/natefinch/npipe v0.0.0-20160621034901-c1b8fa8bdcce @@ -226,6 +226,7 @@ require ( github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-ps v1.0.0 // indirect github.com/mitchellh/go-wordwrap v1.0.1 // indirect + github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect diff --git a/go.sum b/go.sum index 86dbf3e57d07..21a2f1af3ef1 100644 --- a/go.sum +++ b/go.sum @@ -280,6 +280,8 @@ github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/me github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/go-test/deep v1.1.0 h1:WOcxcdHcvdgThNXjw0t76K42FXTU7HpNQWHpA2HHNlg= github.com/go-test/deep v1.1.0/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= +github.com/go-viper/mapstructure/v2 v2.0.0 h1:dhn8MZ1gZ0mzeodTG3jt5Vj/o87xZKuNAprG2mQfMfc= +github.com/go-viper/mapstructure/v2 v2.0.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= diff --git a/lib/decode/decode_test.go b/lib/decode/decode_test.go index 3219e96b4bf9..993143e19979 100644 --- a/lib/decode/decode_test.go +++ b/lib/decode/decode_test.go @@ -9,7 +9,7 @@ import ( "testing" "github.com/hashicorp/hcl" - "github.com/mitchellh/mapstructure" + "github.com/go-viper/mapstructure/v2" "github.com/stretchr/testify/require" ) diff --git a/lib/map_walker.go b/lib/map_walker.go index 1be33b61f15f..ea214005a37c 100644 --- a/lib/map_walker.go +++ b/lib/map_walker.go @@ -8,7 +8,7 @@ import ( "reflect" "github.com/mitchellh/copystructure" - "github.com/mitchellh/mapstructure" + "github.com/go-viper/mapstructure/v2" "github.com/mitchellh/reflectwalk" ) diff --git a/test/integration/consul-container/libs/cluster/agent.go b/test/integration/consul-container/libs/cluster/agent.go index e44f588c464b..596f7f4389d4 100644 --- a/test/integration/consul-container/libs/cluster/agent.go +++ b/test/integration/consul-container/libs/cluster/agent.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/consul/api" "github.com/hashicorp/consul/lib/decode" "github.com/hashicorp/hcl" - "github.com/mitchellh/mapstructure" + "github.com/go-viper/mapstructure/v2" "github.com/testcontainers/testcontainers-go" "google.golang.org/grpc" From 45065227dcc1c6ef5c853417ad90b23e9af3f317 Mon Sep 17 00:00:00 2001 From: jm96441n Date: Tue, 23 Jul 2024 12:34:50 -0400 Subject: [PATCH 2/4] go mod tidy all the things --- envoyextensions/go.mod | 2 +- envoyextensions/go.sum | 4 ++-- test-integ/go.mod | 2 +- test-integ/go.sum | 4 ++-- test/integration/consul-container/go.mod | 2 +- test/integration/consul-container/go.sum | 4 ++-- testing/deployer/go.mod | 2 +- testing/deployer/go.sum | 4 ++-- troubleshoot/go.mod | 2 +- troubleshoot/go.sum | 4 ++-- 10 files changed, 15 insertions(+), 15 deletions(-) diff --git a/envoyextensions/go.mod b/envoyextensions/go.mod index c9bb9cb6f00c..b79bb78b414a 100644 --- a/envoyextensions/go.mod +++ b/envoyextensions/go.mod @@ -27,6 +27,7 @@ require ( github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/envoyproxy/protoc-gen-validate v1.0.2 // indirect github.com/fatih/color v1.16.0 // indirect + github.com/go-viper/mapstructure/v2 v2.0.0 // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect @@ -38,7 +39,6 @@ require ( github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect - github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 // indirect diff --git a/envoyextensions/go.sum b/envoyextensions/go.sum index b215d6492103..a492e491f982 100644 --- a/envoyextensions/go.sum +++ b/envoyextensions/go.sum @@ -44,6 +44,8 @@ github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2 github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-viper/mapstructure/v2 v2.0.0 h1:dhn8MZ1gZ0mzeodTG3jt5Vj/o87xZKuNAprG2mQfMfc= +github.com/go-viper/mapstructure/v2 v2.0.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= @@ -131,8 +133,6 @@ github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXx github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= -github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= diff --git a/test-integ/go.mod b/test-integ/go.mod index 072dda44acf0..b1a3def8c26b 100644 --- a/test-integ/go.mod +++ b/test-integ/go.mod @@ -47,6 +47,7 @@ require ( github.com/fatih/color v1.16.0 // indirect github.com/go-jose/go-jose/v3 v3.0.3 // indirect github.com/go-test/deep v1.1.0 // indirect + github.com/go-viper/mapstructure/v2 v2.0.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/google/btree v1.0.1 // indirect @@ -77,7 +78,6 @@ require ( github.com/miekg/dns v1.1.50 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-wordwrap v1.0.1 // indirect - github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/moby/patternmatcher v0.5.0 // indirect github.com/moby/sys/sequential v0.5.0 // indirect diff --git a/test-integ/go.sum b/test-integ/go.sum index a7b09dfb8318..45f2b46e5141 100644 --- a/test-integ/go.sum +++ b/test-integ/go.sum @@ -85,6 +85,8 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-test/deep v1.1.0 h1:WOcxcdHcvdgThNXjw0t76K42FXTU7HpNQWHpA2HHNlg= github.com/go-test/deep v1.1.0/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= +github.com/go-viper/mapstructure/v2 v2.0.0 h1:dhn8MZ1gZ0mzeodTG3jt5Vj/o87xZKuNAprG2mQfMfc= +github.com/go-viper/mapstructure/v2 v2.0.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= @@ -207,8 +209,6 @@ github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUb github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= -github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/moby/patternmatcher v0.5.0 h1:YCZgJOeULcxLw1Q+sVR636pmS7sPEn1Qo2iAN6M7DBo= diff --git a/test/integration/consul-container/go.mod b/test/integration/consul-container/go.mod index d1e077db52a4..6f3962a53aa4 100644 --- a/test/integration/consul-container/go.mod +++ b/test/integration/consul-container/go.mod @@ -11,6 +11,7 @@ require ( github.com/docker/go-connections v0.4.0 github.com/evanphx/json-patch v4.12.0+incompatible github.com/go-jose/go-jose/v3 v3.0.3 + github.com/go-viper/mapstructure/v2 v2.0.0 github.com/hashicorp/consul v1.16.1 github.com/hashicorp/consul/api v1.29.1 github.com/hashicorp/consul/envoyextensions v0.7.0 @@ -25,7 +26,6 @@ require ( github.com/hashicorp/serf v0.10.1 github.com/itchyny/gojq v0.12.12 github.com/mitchellh/copystructure v1.2.0 - github.com/mitchellh/mapstructure v1.5.0 github.com/otiai10/copy v1.10.0 github.com/pkg/errors v0.9.1 github.com/stretchr/testify v1.8.4 diff --git a/test/integration/consul-container/go.sum b/test/integration/consul-container/go.sum index a418b57d6d9a..c24a4135ed8e 100644 --- a/test/integration/consul-container/go.sum +++ b/test/integration/consul-container/go.sum @@ -91,6 +91,8 @@ github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2 github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-viper/mapstructure/v2 v2.0.0 h1:dhn8MZ1gZ0mzeodTG3jt5Vj/o87xZKuNAprG2mQfMfc= +github.com/go-viper/mapstructure/v2 v2.0.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= @@ -210,8 +212,6 @@ github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= -github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/moby/patternmatcher v0.5.0 h1:YCZgJOeULcxLw1Q+sVR636pmS7sPEn1Qo2iAN6M7DBo= diff --git a/testing/deployer/go.mod b/testing/deployer/go.mod index 0dd3855e3b9e..3f3bcd1b0b6c 100644 --- a/testing/deployer/go.mod +++ b/testing/deployer/go.mod @@ -33,6 +33,7 @@ require ( github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/fatih/color v1.16.0 // indirect + github.com/go-viper/mapstructure/v2 v2.0.0 // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect @@ -45,7 +46,6 @@ require ( github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-wordwrap v1.0.0 // indirect - github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect diff --git a/testing/deployer/go.sum b/testing/deployer/go.sum index db7d88bffda4..757de7ccd2fb 100644 --- a/testing/deployer/go.sum +++ b/testing/deployer/go.sum @@ -46,6 +46,8 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= +github.com/go-viper/mapstructure/v2 v2.0.0 h1:dhn8MZ1gZ0mzeodTG3jt5Vj/o87xZKuNAprG2mQfMfc= +github.com/go-viper/mapstructure/v2 v2.0.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -157,8 +159,6 @@ github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrk github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= -github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= diff --git a/troubleshoot/go.mod b/troubleshoot/go.mod index 9af318f62f0b..109876db9736 100644 --- a/troubleshoot/go.mod +++ b/troubleshoot/go.mod @@ -31,6 +31,7 @@ require ( github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/envoyproxy/protoc-gen-validate v1.0.2 // indirect github.com/fatih/color v1.16.0 // indirect + github.com/go-viper/mapstructure/v2 v2.0.0 // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect @@ -45,7 +46,6 @@ require ( github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect - github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_model v0.5.0 // indirect diff --git a/troubleshoot/go.sum b/troubleshoot/go.sum index eb39bb30face..88b73322cc64 100644 --- a/troubleshoot/go.sum +++ b/troubleshoot/go.sum @@ -46,6 +46,8 @@ github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2 github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-viper/mapstructure/v2 v2.0.0 h1:dhn8MZ1gZ0mzeodTG3jt5Vj/o87xZKuNAprG2mQfMfc= +github.com/go-viper/mapstructure/v2 v2.0.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= @@ -132,8 +134,6 @@ github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXx github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= -github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= From 90ddf4a84fa9252b21f9b91435ecfadc67bfbea4 Mon Sep 17 00:00:00 2001 From: jm96441n Date: Tue, 23 Jul 2024 12:39:20 -0400 Subject: [PATCH 3/4] run `make fmt` --- agent/config/config.go | 2 +- agent/connect/ca/provider_aws.go | 2 +- agent/connect/ca/provider_consul_config.go | 2 +- agent/connect/ca/provider_vault.go | 2 +- agent/consul/authmethod/authmethods.go | 2 +- agent/consul/fsm/snapshot_ce.go | 2 +- agent/envoyextensions/builtin/lua/lua.go | 2 +- .../builtin/property-override/property_override.go | 2 +- agent/envoyextensions/builtin/wasm/structs.go | 2 +- agent/grpc-external/options.go | 2 +- agent/http.go | 2 +- agent/structs/config_entry.go | 2 +- api/watch/watch.go | 2 +- command/acl/acl_helpers.go | 2 +- command/connect/envoy/envoy.go | 2 +- command/connect/redirecttraffic/redirect_traffic.go | 2 +- command/services/config.go | 2 +- lib/decode/decode_test.go | 2 +- lib/map_walker.go | 2 +- test/integration/consul-container/libs/cluster/agent.go | 2 +- 20 files changed, 20 insertions(+), 20 deletions(-) diff --git a/agent/config/config.go b/agent/config/config.go index 27b6cc058001..eac14aa8c959 100644 --- a/agent/config/config.go +++ b/agent/config/config.go @@ -8,8 +8,8 @@ import ( "fmt" "time" - "github.com/hashicorp/hcl" "github.com/go-viper/mapstructure/v2" + "github.com/hashicorp/hcl" "github.com/hashicorp/consul/lib/decode" ) diff --git a/agent/connect/ca/provider_aws.go b/agent/connect/ca/provider_aws.go index 58daf3563c27..28b6d0112be1 100644 --- a/agent/connect/ca/provider_aws.go +++ b/agent/connect/ca/provider_aws.go @@ -16,8 +16,8 @@ import ( "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/acmpca" - "github.com/hashicorp/go-hclog" "github.com/go-viper/mapstructure/v2" + "github.com/hashicorp/go-hclog" "github.com/hashicorp/consul/agent/connect" "github.com/hashicorp/consul/agent/structs" diff --git a/agent/connect/ca/provider_consul_config.go b/agent/connect/ca/provider_consul_config.go index e35bbca9b3cf..166a6e8bb7c4 100644 --- a/agent/connect/ca/provider_consul_config.go +++ b/agent/connect/ca/provider_consul_config.go @@ -7,9 +7,9 @@ import ( "fmt" "time" + "github.com/go-viper/mapstructure/v2" "github.com/hashicorp/consul/agent/connect" "github.com/hashicorp/consul/agent/structs" - "github.com/go-viper/mapstructure/v2" ) func ParseConsulCAConfig(raw map[string]interface{}) (*structs.ConsulCAProviderConfig, error) { diff --git a/agent/connect/ca/provider_vault.go b/agent/connect/ca/provider_vault.go index 4350d2e3d8e0..33708e717cdd 100644 --- a/agent/connect/ca/provider_vault.go +++ b/agent/connect/ca/provider_vault.go @@ -14,9 +14,9 @@ import ( "strings" "time" + "github.com/go-viper/mapstructure/v2" "github.com/hashicorp/go-hclog" vaultapi "github.com/hashicorp/vault/api" - "github.com/go-viper/mapstructure/v2" "github.com/hashicorp/consul/agent/connect" "github.com/hashicorp/consul/agent/structs" diff --git a/agent/consul/authmethod/authmethods.go b/agent/consul/authmethod/authmethods.go index 02c26782ab0e..94fef233a347 100644 --- a/agent/consul/authmethod/authmethods.go +++ b/agent/consul/authmethod/authmethods.go @@ -9,8 +9,8 @@ import ( "sort" "sync" - "github.com/hashicorp/go-hclog" "github.com/go-viper/mapstructure/v2" + "github.com/hashicorp/go-hclog" "github.com/hashicorp/consul/acl" "github.com/hashicorp/consul/agent/structs" diff --git a/agent/consul/fsm/snapshot_ce.go b/agent/consul/fsm/snapshot_ce.go index 1ad25459f06c..6989adb6d279 100644 --- a/agent/consul/fsm/snapshot_ce.go +++ b/agent/consul/fsm/snapshot_ce.go @@ -7,8 +7,8 @@ import ( "fmt" "net" - "github.com/hashicorp/raft" "github.com/go-viper/mapstructure/v2" + "github.com/hashicorp/raft" "github.com/hashicorp/consul-net-rpc/go-msgpack/codec" diff --git a/agent/envoyextensions/builtin/lua/lua.go b/agent/envoyextensions/builtin/lua/lua.go index d068ff951733..899b7368df21 100644 --- a/agent/envoyextensions/builtin/lua/lua.go +++ b/agent/envoyextensions/builtin/lua/lua.go @@ -12,10 +12,10 @@ import ( envoy_lua_v3 "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/lua/v3" envoy_http_v3 "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/http_connection_manager/v3" envoy_resource_v3 "github.com/envoyproxy/go-control-plane/pkg/resource/v3" + "github.com/go-viper/mapstructure/v2" "github.com/hashicorp/consul/api" "github.com/hashicorp/consul/envoyextensions/extensioncommon" "github.com/hashicorp/go-multierror" - "github.com/go-viper/mapstructure/v2" ) var _ extensioncommon.BasicExtension = (*lua)(nil) diff --git a/agent/envoyextensions/builtin/property-override/property_override.go b/agent/envoyextensions/builtin/property-override/property_override.go index d11826df1b7f..729d65102735 100644 --- a/agent/envoyextensions/builtin/property-override/property_override.go +++ b/agent/envoyextensions/builtin/property-override/property_override.go @@ -10,9 +10,9 @@ import ( envoy_endpoint_v3 "github.com/envoyproxy/go-control-plane/envoy/config/endpoint/v3" envoy_listener_v3 "github.com/envoyproxy/go-control-plane/envoy/config/listener/v3" envoy_route_v3 "github.com/envoyproxy/go-control-plane/envoy/config/route/v3" + "github.com/go-viper/mapstructure/v2" "github.com/hashicorp/consul/lib/decode" "github.com/hashicorp/go-multierror" - "github.com/go-viper/mapstructure/v2" "google.golang.org/protobuf/proto" "github.com/hashicorp/consul/api" diff --git a/agent/envoyextensions/builtin/wasm/structs.go b/agent/envoyextensions/builtin/wasm/structs.go index f592de63c548..f04afb910661 100644 --- a/agent/envoyextensions/builtin/wasm/structs.go +++ b/agent/envoyextensions/builtin/wasm/structs.go @@ -10,11 +10,11 @@ import ( envoy_core_v3 "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" envoy_wasm_v3 "github.com/envoyproxy/go-control-plane/envoy/extensions/wasm/v3" + "github.com/go-viper/mapstructure/v2" "github.com/hashicorp/consul/acl" "github.com/hashicorp/consul/api" "github.com/hashicorp/consul/envoyextensions/extensioncommon" "github.com/hashicorp/go-multierror" - "github.com/go-viper/mapstructure/v2" "google.golang.org/protobuf/types/known/anypb" "google.golang.org/protobuf/types/known/durationpb" "google.golang.org/protobuf/types/known/wrapperspb" diff --git a/agent/grpc-external/options.go b/agent/grpc-external/options.go index 9c72c9aa5ebf..e90c7680ed77 100644 --- a/agent/grpc-external/options.go +++ b/agent/grpc-external/options.go @@ -7,8 +7,8 @@ import ( "context" "fmt" - "github.com/hashicorp/consul/agent/structs" "github.com/go-viper/mapstructure/v2" + "github.com/hashicorp/consul/agent/structs" "google.golang.org/grpc/metadata" ) diff --git a/agent/http.go b/agent/http.go index 616e4bc5af58..29a73de82b86 100644 --- a/agent/http.go +++ b/agent/http.go @@ -22,8 +22,8 @@ import ( "github.com/NYTimes/gziphandler" "github.com/armon/go-metrics" "github.com/armon/go-metrics/prometheus" - "github.com/hashicorp/go-cleanhttp" "github.com/go-viper/mapstructure/v2" + "github.com/hashicorp/go-cleanhttp" "github.com/pkg/errors" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" diff --git a/agent/structs/config_entry.go b/agent/structs/config_entry.go index 3e8d88993714..ec1eef2e72d1 100644 --- a/agent/structs/config_entry.go +++ b/agent/structs/config_entry.go @@ -13,9 +13,9 @@ import ( "github.com/miekg/dns" + "github.com/go-viper/mapstructure/v2" "github.com/hashicorp/go-multierror" "github.com/mitchellh/hashstructure" - "github.com/go-viper/mapstructure/v2" "github.com/hashicorp/consul-net-rpc/go-msgpack/codec" diff --git a/api/watch/watch.go b/api/watch/watch.go index 36f3c2e82631..04a9bca2b0fb 100644 --- a/api/watch/watch.go +++ b/api/watch/watch.go @@ -10,9 +10,9 @@ import ( "sync" "time" + "github.com/go-viper/mapstructure/v2" consulapi "github.com/hashicorp/consul/api" "github.com/hashicorp/go-hclog" - "github.com/go-viper/mapstructure/v2" ) const DefaultTimeout = 10 * time.Second diff --git a/command/acl/acl_helpers.go b/command/acl/acl_helpers.go index a18cac852959..a60a80dc591b 100644 --- a/command/acl/acl_helpers.go +++ b/command/acl/acl_helpers.go @@ -7,12 +7,12 @@ import ( "fmt" "strings" + "github.com/go-viper/mapstructure/v2" "github.com/hashicorp/consul/acl" "github.com/hashicorp/consul/agent/structs" "github.com/hashicorp/consul/api" "github.com/hashicorp/consul/command/helpers" "github.com/hashicorp/hcl" - "github.com/go-viper/mapstructure/v2" ) func GetTokenAccessorIDFromPartial(client *api.Client, partialAccessorID string) (string, error) { diff --git a/command/connect/envoy/envoy.go b/command/connect/envoy/envoy.go index 9ca18583a86a..a4ff6e86d6c4 100644 --- a/command/connect/envoy/envoy.go +++ b/command/connect/envoy/envoy.go @@ -14,10 +14,10 @@ import ( "strings" "time" + "github.com/go-viper/mapstructure/v2" "github.com/hashicorp/go-hclog" "github.com/hashicorp/go-version" "github.com/mitchellh/cli" - "github.com/go-viper/mapstructure/v2" "google.golang.org/protobuf/encoding/protojson" "github.com/hashicorp/consul/acl" diff --git a/command/connect/redirecttraffic/redirect_traffic.go b/command/connect/redirecttraffic/redirect_traffic.go index 3989011362c9..68dcdee1951c 100644 --- a/command/connect/redirecttraffic/redirect_traffic.go +++ b/command/connect/redirecttraffic/redirect_traffic.go @@ -9,11 +9,11 @@ import ( "net" "strconv" + "github.com/go-viper/mapstructure/v2" "github.com/hashicorp/consul/api" "github.com/hashicorp/consul/command/flags" "github.com/hashicorp/consul/sdk/iptables" "github.com/mitchellh/cli" - "github.com/go-viper/mapstructure/v2" ) func New(ui cli.Ui) *cmd { diff --git a/command/services/config.go b/command/services/config.go index 7d8ae975f4d1..905dbb2ef177 100644 --- a/command/services/config.go +++ b/command/services/config.go @@ -7,8 +7,8 @@ import ( "reflect" "time" - "github.com/mitchellh/cli" "github.com/go-viper/mapstructure/v2" + "github.com/mitchellh/cli" "github.com/hashicorp/consul/agent/config" "github.com/hashicorp/consul/agent/structs" diff --git a/lib/decode/decode_test.go b/lib/decode/decode_test.go index 993143e19979..67e4b957cdcb 100644 --- a/lib/decode/decode_test.go +++ b/lib/decode/decode_test.go @@ -8,8 +8,8 @@ import ( "reflect" "testing" - "github.com/hashicorp/hcl" "github.com/go-viper/mapstructure/v2" + "github.com/hashicorp/hcl" "github.com/stretchr/testify/require" ) diff --git a/lib/map_walker.go b/lib/map_walker.go index ea214005a37c..fc1e900e128b 100644 --- a/lib/map_walker.go +++ b/lib/map_walker.go @@ -7,8 +7,8 @@ import ( "fmt" "reflect" - "github.com/mitchellh/copystructure" "github.com/go-viper/mapstructure/v2" + "github.com/mitchellh/copystructure" "github.com/mitchellh/reflectwalk" ) diff --git a/test/integration/consul-container/libs/cluster/agent.go b/test/integration/consul-container/libs/cluster/agent.go index 596f7f4389d4..ad1f142f1ad3 100644 --- a/test/integration/consul-container/libs/cluster/agent.go +++ b/test/integration/consul-container/libs/cluster/agent.go @@ -10,10 +10,10 @@ import ( "io" jsonpatch "github.com/evanphx/json-patch" + "github.com/go-viper/mapstructure/v2" "github.com/hashicorp/consul/api" "github.com/hashicorp/consul/lib/decode" "github.com/hashicorp/hcl" - "github.com/go-viper/mapstructure/v2" "github.com/testcontainers/testcontainers-go" "google.golang.org/grpc" From 11204749cc5b3424c390bfd9f24409527d2539ec Mon Sep 17 00:00:00 2001 From: jm96441n Date: Tue, 23 Jul 2024 14:41:40 -0400 Subject: [PATCH 4/4] update error message in test --- command/connect/redirecttraffic/redirect_traffic_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/command/connect/redirecttraffic/redirect_traffic_test.go b/command/connect/redirecttraffic/redirect_traffic_test.go index de9b362416c2..89f739bab452 100644 --- a/command/connect/redirecttraffic/redirect_traffic_test.go +++ b/command/connect/redirecttraffic/redirect_traffic_test.go @@ -58,7 +58,6 @@ func TestRun_FlagValidation(t *testing.T) { require.Contains(t, ui.ErrorWriter.String(), c.expError) }) } - } func TestGenerateConfigFromFlags(t *testing.T) { @@ -215,7 +214,7 @@ func TestGenerateConfigFromFlags(t *testing.T) { }, }, }, - expError: "failed parsing Proxy.Config: 1 error(s) decoding:\n\n* cannot parse 'bind_port' as int:", + expError: "failed parsing Proxy.Config: decoding failed due to the following error(s):\n\ncannot parse 'bind_port' as int:", }, { name: "proxyID with proxy outbound port",