diff --git a/loader/klvault/vaultloader.go b/loader/klvault/vaultloader.go index e6fd6fd4..66f546e4 100644 --- a/loader/klvault/vaultloader.go +++ b/loader/klvault/vaultloader.go @@ -1,6 +1,7 @@ package klvault import ( + "encoding/json" "errors" "fmt" "net/url" @@ -184,8 +185,8 @@ func (vl *Loader) Load(cs konfig.Values) error { // confirming version exists on metadata and it is an int if m, ok := s.Data["metadata"].(map[string]interface{}); ok { kvData, dataOK := s.Data["data"].(map[string]interface{}) - _, versionOK := m["version"].(int) - if versionOK && dataOK { + _, versionJSONNumberOK := m["version"].(json.Number) + if versionJSONNumberOK && dataOK { sData = kvData } } else { diff --git a/loader/klvault/vaultloader_test.go b/loader/klvault/vaultloader_test.go index 31ba03cc..d03ffbd6 100644 --- a/loader/klvault/vaultloader_test.go +++ b/loader/klvault/vaultloader_test.go @@ -1,6 +1,7 @@ package klvault import ( + "encoding/json" "errors" "sync" "testing" @@ -75,7 +76,7 @@ func TestVaultLoader(t *testing.T) { "created_time": "2018-03-22T02:24:06.945319214Z", "deletion_time": "", "destroyed": false, - "version": 1, + "version": json.Number("1"), }, }, LeaseDuration: int(1 * time.Hour / time.Second), @@ -92,7 +93,7 @@ func TestVaultLoader(t *testing.T) { "created_time": "2018-03-22T02:24:06.945319214Z", "deletion_time": "", "destroyed": false, - "version": 1, + "version": json.Number("1"), }, }, LeaseDuration: int(1 * time.Hour / time.Second),