-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
types: fix marshalling of omitted "interfaces" key in IPConfig JSON
Plugins that don't have knowledge of interfaces, like host-local or other IPAM plugins, should not set the 'interfaces' key of their returned "Result" JSON. This should then not be translated into an interface index of 0, which it was due to the int marshaling and omitempty. Instead, ensure that an omitted 'interface' in JSON ends up being -1 in the IPConfig structure, and that a -1 ensures that no 'interfaces' key is present in the JSON. Yes, this means that you must set Interface:-1 in IPConfig in your plugin, but if you weren't already doing that and your plugin didn't deal with interface indexes, you already had a problem. Fixes: #404
- Loading branch information
Showing
3 changed files
with
64 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters