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
Incorrect model for IPAM config settings #201
Comments
Looks like the swagger definition is incorrect here so that's unhelpful! IPAM:
type: "object"
properties:
Driver:
description: "Name of the IPAM driver to use."
type: "string"
default: "default"
Config:
description: |
List of IPAM configuration options, specified as a map:
```
{"Subnet": <CIDR>, "IPRange": <CIDR>, "Gateway": <IP address>, "AuxAddress": <device_name:IP address>}
```
type: "array"
items:
type: "object"
additionalProperties:
type: "string"
Options:
description: "Driver-specific options, specified as a map."
type: "object"
additionalProperties:
type: "string" |
Thanks for raising an issue upstream. |
I'm wondering if this can be supported in the swagger version 2 specification, as it does not support |
I created an upstream patch and generated the bollard stubs from it. Could you test my branch to verify that the patch is correct? |
Can you give me some tips on how to test this branch? I tried the following in
But I think it didn't bring in the updated bollard-stubs so it was still failing to decode. |
Hmm... OK, I pulled in the new models into the
|
Yes that resolves the issue. |
The current model for IPAM configuration is incorrect. It currently (https://cs.github.com/fussybeaver/bollard/blob/5effe1a16363d929e290919bca6542bbfaccd45a/codegen/target/generated-sources/src/models.rs#L1991) assumes a map of string keys to string values but the values can be more complex than this. One such example is the AuxiliaryAddresses setting which rather than having a string value is actually a map of strings to addresses.
One of my servers is using this, the list networks API call returns the following for the network in question:
Bollard returns an error on encountering this due to the incorrect model:
Failed to deserialize JSON: invalid type: map, expected a string at line 1 column 1057
.The text was updated successfully, but these errors were encountered: