Skip to content

Commit 42e7553

Browse files
committedSep 30, 2020
Resolve dependency issue with hashicorp/vault
1 parent cfdb005 commit 42e7553

File tree

5 files changed

+51
-543
lines changed

5 files changed

+51
-543
lines changed
 

‎cmd/config.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010
"strings"
1111
"text/tabwriter"
1212

13-
"github.com/hashicorp/vault/command/agent/config"
1413
"github.com/mitchellh/go-homedir"
1514
"github.com/spf13/cobra"
1615
"github.com/spf13/viper"
@@ -94,8 +93,8 @@ func unmarshalNotaryConfig() (*notary.Config, error) {
9493
return &notaryCfg, nil
9594
}
9695

97-
func unmarshalVaultConfig() (*config.Vault, error) {
98-
var vaultCfg config.Vault
96+
func unmarshalVaultConfig() (*VaultConfig, error) {
97+
var vaultCfg VaultConfig
9998

10099
vaultCfg.Address = viper.GetString("vault.addr")
101100

‎cmd/vault_config.go

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package cmd
2+
3+
// VaultConfig is a copy of https://github.com/hashicorp/vault/blob/master/command/agent/config/config.go#L34
4+
//
5+
// as per https://github.com/hashicorp/vault/issues/9575 we are not supposed to depend on the
6+
// toplevel hashicorp/vault module, which breaks go modules in version 1.5.0
7+
type VaultConfig struct {
8+
Address string `hcl:"address"`
9+
CACert string `hcl:"ca_cert"`
10+
CAPath string `hcl:"ca_path"`
11+
TLSSkipVerify bool `hcl:"-"`
12+
TLSSkipVerifyRaw interface{} `hcl:"tls_skip_verify"`
13+
ClientCert string `hcl:"client_cert"`
14+
ClientKey string `hcl:"client_key"`
15+
TLSServerName string `hcl:"tls_server_name"`
16+
}

‎go.mod

+6-5
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ require (
77
github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412 // indirect
88
github.com/bitly/go-hostpool v0.1.0 // indirect
99
github.com/bitly/go-simplejson v0.5.0 // indirect
10+
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect
1011
github.com/bugsnag/bugsnag-go v1.5.3 // indirect
1112
github.com/bugsnag/panicwrap v1.2.0 // indirect
13+
github.com/cenkalti/backoff v2.2.1+incompatible // indirect
1214
github.com/cloudflare/cfssl v1.4.1 // indirect
1315
github.com/docker/distribution v2.7.1+incompatible
1416
github.com/docker/go v1.5.1-1 // indirect
@@ -22,17 +24,17 @@ require (
2224
github.com/go-sql-driver/mysql v1.5.0 // indirect
2325
github.com/gofrs/uuid v3.2.0+incompatible // indirect
2426
github.com/gorilla/mux v1.7.3 // indirect
25-
github.com/hashicorp/go-retryablehttp v0.6.4 // indirect
26-
github.com/hashicorp/vault v1.4.2
27-
github.com/hashicorp/vault/api v1.0.5-0.20200317185738-82f498082f02
27+
github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed // indirect
28+
github.com/hashicorp/vault/api v1.0.5-0.20200930011044-a71c86e3d7cd
2829
github.com/jinzhu/gorm v1.9.12 // indirect
2930
github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect
3031
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
3132
github.com/lib/pq v1.3.0 // indirect
3233
github.com/mattn/go-sqlite3 v2.0.2+incompatible // indirect
3334
github.com/miekg/pkcs11 v1.0.3 // indirect
3435
github.com/mitchellh/go-homedir v1.1.0
35-
github.com/mitchellh/mapstructure v1.2.2 // indirect
36+
github.com/opencontainers/go-digest v1.0.0 // indirect
37+
github.com/opencontainers/image-spec v1.0.1 // indirect
3638
github.com/pelletier/go-toml v1.7.0 // indirect
3739
github.com/pierrec/lz4 v2.4.0+incompatible // indirect
3840
github.com/pkg/errors v0.9.1 // indirect
@@ -49,7 +51,6 @@ require (
4951
go.uber.org/zap v1.16.0
5052
golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f // indirect
5153
golang.org/x/sys v0.0.0-20200409092240-59c9f1ba88fa // indirect
52-
golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect
5354
golang.org/x/tools v0.0.0-20200107184032-11e9d9cc0042 // indirect
5455
gopkg.in/dancannon/gorethink.v3 v3.0.5 // indirect
5556
gopkg.in/fatih/pool.v2 v2.0.0 // indirect

0 commit comments

Comments
 (0)