Skip to content

Commit

Permalink
bump gopkg.in/yaml.v3 to v3.0.1
Browse files Browse the repository at this point in the history
Signed-off-by: Fedor Partanskiy <[email protected]>
  • Loading branch information
pfi79 authored and denyeart committed Oct 11, 2024
1 parent 3294157 commit e44a8a7
Show file tree
Hide file tree
Showing 31 changed files with 18 additions and 10,051 deletions.
2 changes: 1 addition & 1 deletion cmd/common/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/hyperledger/fabric/cmd/common/comm"
"github.com/hyperledger/fabric/cmd/common/signer"
"github.com/pkg/errors"
"gopkg.in/yaml.v2"
"gopkg.in/yaml.v3"
)

// Config aggregates configuration of TLS and signing
Expand Down
2 changes: 1 addition & 1 deletion cmd/cryptogen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"github.com/hyperledger/fabric/internal/cryptogen/msp"

"gopkg.in/alecthomas/kingpin.v2"
"gopkg.in/yaml.v2"
"gopkg.in/yaml.v3"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion cmd/cryptogen/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"testing"

"github.com/stretchr/testify/require"
yaml "gopkg.in/yaml.v2"
yaml "gopkg.in/yaml.v3"
)

func TestDefaultConfigParsing(t *testing.T) {
Expand Down
9 changes: 7 additions & 2 deletions common/viperutil/config_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ SPDX-License-Identifier: Apache-2.0
package viperutil

import (
"bytes"
"encoding/pem"
"fmt"
"io"
Expand All @@ -22,7 +23,7 @@ import (
"github.com/hyperledger/fabric-lib-go/bccsp/factory"
"github.com/hyperledger/fabric-lib-go/common/flogging"
"github.com/pkg/errors"
"gopkg.in/yaml.v2"
"gopkg.in/yaml.v3"
)

var logger = flogging.MustGetLogger("viperutil")
Expand Down Expand Up @@ -422,6 +423,10 @@ func YamlStringToStructHook(m interface{}) func(rf reflect.Kind, rt reflect.Kind
return m, nil
}

return m, yaml.UnmarshalStrict([]byte(raw), &m)
dec := yaml.NewDecoder(bytes.NewBuffer([]byte(raw)))
dec.KnownFields(true)
err := dec.Decode(&m)

return m, err
}
}
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ require (
google.golang.org/grpc v1.67.1
google.golang.org/protobuf v1.35.1
gopkg.in/alecthomas/kingpin.v2 v2.2.6
gopkg.in/yaml.v2 v2.4.0
gopkg.in/yaml.v3 v3.0.1
)

require (
Expand Down Expand Up @@ -119,6 +119,5 @@ require (
golang.org/x/text v0.18.0 // indirect
golang.org/x/tools v0.25.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
rsc.io/tmplfunc v0.0.3 // indirect
)
2 changes: 1 addition & 1 deletion integration/msp/rsaca_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (
"github.com/onsi/gomega/gexec"
"github.com/tedsuo/ifrit"
ginkgomon "github.com/tedsuo/ifrit/ginkgomon_v2"
"gopkg.in/yaml.v2"
"gopkg.in/yaml.v3"
)

var _ = Describe("MSPs with RSA Certificate Authorities", func() {
Expand Down
2 changes: 1 addition & 1 deletion integration/nwo/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import (
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
"google.golang.org/protobuf/proto"
"gopkg.in/yaml.v2"
"gopkg.in/yaml.v3"
)

// Blocks defines block cutting config.
Expand Down
2 changes: 1 addition & 1 deletion internal/cryptogen/msp/msp.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"github.com/hyperledger/fabric/internal/cryptogen/csp"
fabricmsp "github.com/hyperledger/fabric/msp"
"github.com/pkg/errors"
"gopkg.in/yaml.v2"
"gopkg.in/yaml.v3"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion internal/cryptogen/msp/msp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/hyperledger/fabric/internal/cryptogen/msp"
fabricmsp "github.com/hyperledger/fabric/msp"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v2"
"gopkg.in/yaml.v3"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion internal/peer/common/networkconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"os"

"github.com/pkg/errors"
"gopkg.in/yaml.v2"
"gopkg.in/yaml.v3"
)

// NetworkConfig provides a static definition of a Hyperledger Fabric network
Expand Down
2 changes: 1 addition & 1 deletion internal/peer/node/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ import (
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
"google.golang.org/protobuf/proto"
"gopkg.in/yaml.v2"
"gopkg.in/yaml.v3"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion msp/configbuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"github.com/hyperledger/fabric-protos-go-apiv2/msp"
"github.com/pkg/errors"
"google.golang.org/protobuf/proto"
"gopkg.in/yaml.v2"
"gopkg.in/yaml.v3"
)

// OrganizationalUnitIdentifiersConfiguration is used to represent an OU
Expand Down
17 changes: 0 additions & 17 deletions vendor/gopkg.in/yaml.v2/.travis.yml

This file was deleted.

201 changes: 0 additions & 201 deletions vendor/gopkg.in/yaml.v2/LICENSE

This file was deleted.

31 changes: 0 additions & 31 deletions vendor/gopkg.in/yaml.v2/LICENSE.libyaml

This file was deleted.

Loading

0 comments on commit e44a8a7

Please sign in to comment.