Separate IPAM config/operational data in nw inspect #26880
Separate IPAM config/operational data in nw inspect #26880aboch wants to merge 2 commits intomoby:masterfrom aboch:ip
Conversation
|
@aboch How do I know which one of those |
|
@mrjana I initially thought of that, but from the issues about the network inspect it seems people are looking for the operational data in the current output, and this PR fixes that. Given we fail the network creation if we cannot satisfy the config data, I am not sure whether there is a value in showing both. I though of changing |
|
@aboch Since we are talking about API representation it is fine if it is verbose as long as it provides unambiguous information. For example if somebody is writing migration code where they are reading the network state from one daemon to another, if they use the api in the current form then they can't recreate the network correctly because there is no way of knowing whether this is is user provided config or system generated operational data. I think we should follow the swarmkit api model of separating Since this is not going to be released in a patch release I think we can make the necessary API changes and support both versions based on API versioning design. |
|
@mrjana Ok then, let's reuse this PR to also take care of the config/operational separation. |
|
@aboch Thanks. Yes I was suggesting to make use of this PR to fix it properly since we are changing this part of the API behavior. |
|
@mrjana Took care of your comment, added the new PTAL when you get a chance. |
|
experimental to pass requires docker-py changes |
|
Finally all green. @mrjana PTAL. |
|
LGTM |
api/types/network/network.go
Outdated
There was a problem hiding this comment.
Data doesn't seem like a great name... but I'm blanking on a good one atm.
There was a problem hiding this comment.
Operational, OperationalData, OperationalState ?
I am not good at names either. We need to somehow convey this info is the ipam operational state.
Hopefully somebody can propose a good one.
|
@aboch would it be an idea to use the same concept as the service API; i.e. have a Spec field at the top-level, and anything inside that is the "provided" configuration |
|
I think this change needs to be done in the swagger spec now? |
|
@thaJeztah |
|
@cpuguy83 Thanls. I will take care of the swagger specs |
Signed-off-by: Alessandro Boch <aboch@docker.com>
Signed-off-by: Alessandro Boch <aboch@docker.com>
|
ping @aboch |
|
It's still a thing, but do not have time to invastgate/fix the docker-py test failures now. |
|
Let's reopen when the PR is complete then. Thanks. |
Currently
IPAM.Configentry indocker network inspectoutput is being filled with the network ipam configuration data if present, otherwise with the ipam operationional data.It was decided to finally separate config from operational state.
This means now the IPAM field in the network object will contain
Configas well asDatafield.An excerpt from a
docker networ inspectwould look like this:Fixes #26799
Fixes #26933
Signed-off-by: Alessandro Boch aboch@docker.com