docker / libkv

Distributed key/value store abstraction library
Apache License 2.0
854 stars 205 forks source link

Panic in older versions of consul #184

Closed lwhile closed 2 years ago

lwhile commented 6 years ago

The code below will cause panic in older versions of consul:

endpoints := []string{"http://127.0.0.1:8500"}
libkv.AddStore(store.CONSUL, consul.New)
store, err := libkv.NewStore(store.CONSUL, endpoints, nil)
panic: interface conversion: http.RoundTripper is nil, not *http.Transport [recovered]
panic: interface conversion: http.RoundTripper is nil, not *http.Transport
...
github.com/hashicorp/consul/api.NewClient(0xc4200942c0, 0x1, 0x1, 0x17)

The consul code that causes panic is: https://github.com/hashicorp/consul/blob/ae6bf56ee116fea921567d681067f920e7fc377b/api/api.go#L404