Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move to maintained fork of mapstructure #21557

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion agent/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"fmt"
"time"

"github.com/go-viper/mapstructure/v2"
"github.com/hashicorp/hcl"
"github.com/mitchellh/mapstructure"

"github.com/hashicorp/consul/lib/decode"
)
Expand Down
2 changes: 1 addition & 1 deletion agent/connect/ca/provider_aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import (
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/acmpca"

"github.com/go-viper/mapstructure/v2"
"github.com/hashicorp/go-hclog"
"github.com/mitchellh/mapstructure"

"github.com/hashicorp/consul/agent/connect"
"github.com/hashicorp/consul/agent/structs"
Expand Down
2 changes: 1 addition & 1 deletion agent/connect/ca/provider_consul_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/mitchellh/mapstructure"
)

func ParseConsulCAConfig(raw map[string]interface{}) (*structs.ConsulCAProviderConfig, error) {
Expand Down
2 changes: 1 addition & 1 deletion agent/connect/ca/provider_vault.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/mitchellh/mapstructure"

"github.com/hashicorp/consul/agent/connect"
"github.com/hashicorp/consul/agent/structs"
Expand Down
2 changes: 1 addition & 1 deletion agent/consul/authmethod/authmethods.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"sort"
"sync"

"github.com/go-viper/mapstructure/v2"
"github.com/hashicorp/go-hclog"
"github.com/mitchellh/mapstructure"

"github.com/hashicorp/consul/acl"
"github.com/hashicorp/consul/agent/structs"
Expand Down
2 changes: 1 addition & 1 deletion agent/consul/fsm/commands_ce_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion agent/consul/fsm/snapshot_ce.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"fmt"
"net"

"github.com/go-viper/mapstructure/v2"
"github.com/hashicorp/raft"
"github.com/mitchellh/mapstructure"

"github.com/hashicorp/consul-net-rpc/go-msgpack/codec"

Expand Down
2 changes: 1 addition & 1 deletion agent/discovery_chain_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion agent/dns/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"context"
"fmt"

"github.com/mitchellh/mapstructure"
"github.com/go-viper/mapstructure/v2"
"google.golang.org/grpc/metadata"
)

Expand Down
2 changes: 1 addition & 1 deletion agent/envoyextensions/builtin/aws-lambda/aws_lambda.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion agent/envoyextensions/builtin/ext-authz/ext_authz.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion agent/envoyextensions/builtin/lua/lua.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/mitchellh/mapstructure"
)

var _ extensioncommon.BasicExtension = (*lua)(nil)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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/mitchellh/mapstructure"
"google.golang.org/protobuf/proto"

"github.com/hashicorp/consul/api"
Expand Down
2 changes: 1 addition & 1 deletion agent/envoyextensions/builtin/wasm/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/mitchellh/mapstructure"
"google.golang.org/protobuf/types/known/anypb"
"google.golang.org/protobuf/types/known/durationpb"
"google.golang.org/protobuf/types/known/wrapperspb"
Expand Down
2 changes: 1 addition & 1 deletion agent/grpc-external/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"context"
"fmt"

"github.com/go-viper/mapstructure/v2"
"github.com/hashicorp/consul/agent/structs"
"github.com/mitchellh/mapstructure"
"google.golang.org/grpc/metadata"
)

Expand Down
2 changes: 1 addition & 1 deletion agent/grpc-external/querymeta.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion agent/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import (
"github.com/NYTimes/gziphandler"
"github.com/armon/go-metrics"
"github.com/armon/go-metrics/prometheus"
"github.com/go-viper/mapstructure/v2"
"github.com/hashicorp/go-cleanhttp"
"github.com/mitchellh/mapstructure"
"github.com/pkg/errors"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
Expand Down
2 changes: 1 addition & 1 deletion agent/proxycfg/connect_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion agent/proxycfg/upstreams.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion agent/structs/config_entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/mitchellh/mapstructure"

"github.com/hashicorp/consul-net-rpc/go-msgpack/codec"

Expand Down
2 changes: 1 addition & 1 deletion agent/structs/connect_ca.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion agent/xds/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion api/acl.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"net/url"
"time"

"github.com/mitchellh/mapstructure"
"github.com/go-viper/mapstructure/v2"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion api/config_entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"strings"
"time"

"github.com/mitchellh/mapstructure"
"github.com/go-viper/mapstructure/v2"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion api/connect_ca.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion api/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions api/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down Expand Up @@ -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=
Expand Down
2 changes: 1 addition & 1 deletion api/watch/watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/mitchellh/mapstructure"
)

const DefaultTimeout = 10 * time.Second
Expand Down
2 changes: 1 addition & 1 deletion command/acl/acl_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/mitchellh/mapstructure"
)

func GetTokenAccessorIDFromPartial(client *api.Client, partialAccessorID string) (string, error) {
Expand Down
2 changes: 1 addition & 1 deletion command/connect/envoy/envoy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/mitchellh/mapstructure"
"google.golang.org/protobuf/encoding/protojson"

"github.com/hashicorp/consul/acl"
Expand Down
2 changes: 1 addition & 1 deletion command/connect/redirecttraffic/redirect_traffic.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/mitchellh/mapstructure"
)

func New(ui cli.Ui) *cmd {
Expand Down
3 changes: 1 addition & 2 deletions command/connect/redirecttraffic/redirect_traffic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ func TestRun_FlagValidation(t *testing.T) {
require.Contains(t, ui.ErrorWriter.String(), c.expError)
})
}

}

func TestGenerateConfigFromFlags(t *testing.T) {
Expand Down Expand Up @@ -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:",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so there was a small change in how errors are reported that we needed to update here

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",
Expand Down
2 changes: 1 addition & 1 deletion command/flags/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion command/flags/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"strings"
"testing"

"github.com/mitchellh/mapstructure"
"github.com/go-viper/mapstructure/v2"
)

func TestConfigUtil_Values(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion command/helpers/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion command/services/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"reflect"
"time"

"github.com/go-viper/mapstructure/v2"
"github.com/mitchellh/cli"
"github.com/mitchellh/mapstructure"

"github.com/hashicorp/consul/agent/config"
"github.com/hashicorp/consul/agent/structs"
Expand Down
Loading
Loading