Skip to content

Commit

Permalink
Switch to forked viper
Browse files Browse the repository at this point in the history
Viper currently has a bug where defaults do not get properly propagated
when extracting a configuration sub-tree. See

	spf13/viper#747

A pull request has been opened with a potential fix:

	spf13/viper#1439

Until the fix (or some alternative) gets merged, switch to using the
forked version.
  • Loading branch information
setrofim committed Sep 29, 2022
1 parent 37f9b26 commit 994443c
Show file tree
Hide file tree
Showing 28 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ require (
github.com/mattn/go-sqlite3 v1.14.14
github.com/moogar0880/problems v0.1.1
github.com/open-policy-agent/opa v0.43.1
github.com/setrofim/viper v0.0.0-20220928174525-50d48fb2c36f
github.com/spf13/cobra v1.5.0
github.com/spf13/viper v1.13.0
github.com/stretchr/testify v1.8.0
github.com/veraison/corim v0.0.0-20220801100627-a48aacbd333c
github.com/veraison/dice v0.0.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -957,6 +957,8 @@ github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvW
github.com/seccomp/libseccomp-golang v0.9.2-0.20210429002308-3879420cc921/go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg=
github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
github.com/setrofim/viper v0.0.0-20220928174525-50d48fb2c36f h1:rkZ6LCbEONoUp/x41dXG10MKEotrgP5tUkJqP+TZTuw=
github.com/setrofim/viper v0.0.0-20220928174525-50d48fb2c36f/go.mod h1:vMrVjiy4fuGY9YEdvIPXTvVLCyUzE8x3LzjRCjYV5EA=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/sirupsen/logrus v1.0.4-0.20170822132746-89742aefa4b2/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc=
github.com/sirupsen/logrus v1.0.6/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc=
Expand Down Expand Up @@ -1008,8 +1010,6 @@ github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/y
github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg=
github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns=
github.com/spf13/viper v1.9.0/go.mod h1:+i6ajR7OX2XaiBkrcZJFK21htRk7eDeLg7+O6bhUPP4=
github.com/spf13/viper v1.13.0 h1:BWSJ/M+f+3nmdz9bxB+bWX28kkALN2ok11D0rSo8EJU=
github.com/spf13/viper v1.13.0/go.mod h1:Icm2xNL3/8uyh/wFuB1jI7TiTNKp8632Nwegu+zgdYw=
github.com/stefanberger/go-pkcs11uri v0.0.0-20201008174630-78d3cae3a980/go.mod h1:AO3tvPzVZ/ayst6UlUKUv6rcPQInYe3IknH3jYhAKu8=
github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8=
github.com/stretchr/objx v0.0.0-20180129172003-8a3f7159479f/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
Expand Down
2 changes: 1 addition & 1 deletion kvstore/ikvstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
package kvstore

import "github.com/spf13/viper"
import "github.com/setrofim/viper"

// IKVStore is the interface to a key-value store. Keys and values are both
// strings. A key can be associated with multiple values.
Expand Down
2 changes: 1 addition & 1 deletion kvstore/kvstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"errors"
"fmt"

"github.com/spf13/viper"
"github.com/setrofim/viper"
)

func New(v *viper.Viper) (IKVStore, error) {
Expand Down
2 changes: 1 addition & 1 deletion kvstore/kvstore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package kvstore
import (
"testing"

"github.com/spf13/viper"
"github.com/setrofim/viper"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion kvstore/memory.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"sync"
"text/tabwriter"

"github.com/spf13/viper"
"github.com/setrofim/viper"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion kvstore/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"fmt"
"regexp"

"github.com/spf13/viper"
"github.com/setrofim/viper"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion kvstore/sql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

sqlmock "github.com/DATA-DOG/go-sqlmock"
_ "github.com/mattn/go-sqlite3"
"github.com/spf13/viper"
"github.com/setrofim/viper"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand Down
2 changes: 1 addition & 1 deletion policy/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"encoding/json"
"fmt"

"github.com/spf13/viper"
"github.com/setrofim/viper"
"github.com/veraison/services/proto"
)

Expand Down
2 changes: 1 addition & 1 deletion policy/agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"testing"

"github.com/golang/mock/gomock"
"github.com/spf13/viper"
"github.com/setrofim/viper"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
mock_deps "github.com/veraison/services/policy/mocks"
Expand Down
2 changes: 1 addition & 1 deletion policy/iagent.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package policy
import (
"context"

"github.com/spf13/viper"
"github.com/setrofim/viper"
"github.com/veraison/services/proto"
)

Expand Down
2 changes: 1 addition & 1 deletion policy/ibackend.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package policy
import (
"context"

"github.com/spf13/viper"
"github.com/setrofim/viper"
)

type IBackend interface {
Expand Down
2 changes: 1 addition & 1 deletion policy/mocks/mock_ibackend.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion policy/opa.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"log"

"github.com/open-policy-agent/opa/rego"
"github.com/spf13/viper"
"github.com/setrofim/viper"
"github.com/veraison/services/proto"
)

Expand Down
2 changes: 1 addition & 1 deletion policy/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"errors"
"fmt"

"github.com/spf13/viper"
"github.com/setrofim/viper"
"github.com/veraison/services/kvstore"
)

Expand Down
2 changes: 1 addition & 1 deletion policy/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package policy
import (
"testing"

"github.com/spf13/viper"
"github.com/setrofim/viper"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand Down
2 changes: 1 addition & 1 deletion provisioning/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"os/signal"
"syscall"

"github.com/spf13/viper"
"github.com/setrofim/viper"
"github.com/veraison/services/provisioning/api"
"github.com/veraison/services/provisioning/decoder"
"github.com/veraison/services/vtsclient"
Expand Down
2 changes: 1 addition & 1 deletion verification/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"log"

"github.com/spf13/viper"
"github.com/setrofim/viper"
"github.com/veraison/services/verification/api"
"github.com/veraison/services/verification/sessionmanager"
"github.com/veraison/services/verification/verifier"
Expand Down
2 changes: 1 addition & 1 deletion verification/verifier/verifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"fmt"

"github.com/spf13/viper"
"github.com/setrofim/viper"
"github.com/veraison/services/proto"
"github.com/veraison/services/vtsclient"
"google.golang.org/protobuf/types/known/emptypb"
Expand Down
2 changes: 1 addition & 1 deletion vts/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"syscall"

_ "github.com/mattn/go-sqlite3"
"github.com/spf13/viper"
"github.com/setrofim/viper"

"github.com/veraison/services/kvstore"
"github.com/veraison/services/policy"
Expand Down
2 changes: 1 addition & 1 deletion vts/pluginmanager/pluginmanager_goplugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"log"

"github.com/hashicorp/go-plugin"
"github.com/spf13/viper"
"github.com/setrofim/viper"
"github.com/veraison/services/proto"
"github.com/veraison/services/scheme"
)
Expand Down
2 changes: 1 addition & 1 deletion vts/policymanager/mocks/iagent.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vts/policymanager/mocks/ibackend.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vts/policymanager/mocks/ikvstore.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vts/policymanager/policymanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"errors"
"fmt"

"github.com/spf13/viper"
"github.com/setrofim/viper"
"github.com/veraison/services/policy"
"github.com/veraison/services/proto"
)
Expand Down
2 changes: 1 addition & 1 deletion vts/policymanager/policymanager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"testing"

"github.com/golang/mock/gomock"
"github.com/spf13/viper"
"github.com/setrofim/viper"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/veraison/services/kvstore"
Expand Down
2 changes: 1 addition & 1 deletion vts/trustedservices/trustedservices_grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"log"
"net"

"github.com/spf13/viper"
"github.com/setrofim/viper"
"github.com/veraison/services/kvstore"
"github.com/veraison/services/proto"
"github.com/veraison/services/scheme"
Expand Down
2 changes: 1 addition & 1 deletion vtsclient/vtsclient_grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"fmt"
"time"

"github.com/spf13/viper"
"github.com/setrofim/viper"
"github.com/veraison/services/proto"
"github.com/veraison/services/vts/trustedservices"
"google.golang.org/grpc"
Expand Down

0 comments on commit 994443c

Please sign in to comment.