Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Centralized Config Proxy Defaults dont support nested maps #5746

Closed
mkeeler opened this issue Apr 30, 2019 · 0 comments · Fixed by #5774
Closed

Centralized Config Proxy Defaults dont support nested maps #5746

mkeeler opened this issue Apr 30, 2019 · 0 comments · Fixed by #5774
Labels
theme/connect Anything related to Consul Connect, Service Mesh, Side Car Proxies type/bug Feature does not function as expected

Comments

@mkeeler
Copy link
Member

mkeeler commented Apr 30, 2019

In short making a PUT request to /v1/config with the following payload gets stored in raft but is unretrievable afterwards.

{
   "Kind": "proxy-defaults",
   "Name": "global",
   "Config": {
      "nested": {
         "foo": "bar"
      }
   }
}
mkeeler-corp:~ mkeeler$ curl -v localhost:8500/v1/config/proxy-defaults/global
*   Trying ::1...
* TCP_NODELAY set
* Connection failed
* connect to ::1 port 8500 failed: Connection refused
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 8500 (#0)
> GET /v1/config/proxy-defaults/global HTTP/1.1
> Host: localhost:8500
> User-Agent: curl/7.54.0
> Accept: */*
>
< HTTP/1.1 500 Internal Server Error
< Vary: Accept-Encoding
< Date: Tue, 30 Apr 2019 15:03:33 GMT
< Content-Length: 53
< Content-Type: text/plain; charset=utf-8
<
* Connection #0 to host localhost left intact
json: unsupported type: map[interface {}]interface {}

The problem seems to be the nested map internally is typed as a map[interface{}]interface{} which the JSON encoder refuses to handle.

To fix this I think we would need to not store these pass through configs as a regular map[string]interface{} but instead have some type which enforces the JSON compatibility of the pass through config when decoding/encoding and prevents these issues.

This is very loosely related to #4971 and could possibly be fixed in a common way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme/connect Anything related to Consul Connect, Service Mesh, Side Car Proxies type/bug Feature does not function as expected
Projects
None yet
2 participants