This will give deterministic MAC addresses for all interfaces CNI
creates and manages the IP for:
* bridge: container veth and host bridge
* macvlan: container veth
* ptp: container veth and host veth
This will give deterministic MAC addresses for all interfaces CNI
creates and manages the IP for:
* bridge: container veth and host bridge
* macvlan: container veth
* ptp: container veth and host veth
* _suite.go and _test.go file should be in the same package, using the
_test package for that, which requires some fields and methods to be
exported
* Introduce error type for cleaner error handling
* test adaptions for error type checking
* _suite.go and _test.go file should be in the same package, using the
_test package for that, which requires some fields and methods to be
exported
* Introduce error type for cleaner error handling
* test adaptions for error type checking
Previously, the log lines appeared in stdout before the JSON encoding of
the error message. That would break JSON parsing of stdout. Instead, we use
stderr for these unstructured logs, consistent with the CNI spec.
Previously, the log lines appeared in stdout before the JSON encoding of
the error message. That would break JSON parsing of stdout. Instead, we use
stderr for these unstructured logs, consistent with the CNI spec.
Based on previous discussions on the CNI maintainers calls, the spec is
unclear on 1) when CNI_ARGS should be used and 2) the fact the dynamic
config can be passed in through the network JSON.
This PR makes it clear that per-container config can be passed in
through the network JSON, adding a top level `args` field into
which orchestrators can add additional metadata without worrying that
plugins might reject the additional data. It also allows for plugins to
reject unknown fields passed in at the top level.
Using JSON is preferable to CNI_ARGS since it allows namespaced and
structured data. CNI_ARGS is a flat list of KV pairs which has reserved
characters with no escaping rules defined.
CNI_ARGS may still be used by orchestrators that want the simplicity of
passing the network config JSON as specified by the user, unchanged
through to the CNI plugin. But for any kind of structured data, it's
recommended that the `args` field in the JSON is used instead.
Allow strings to be unmarshalled for CNI_ARGS
CNI_ARGS uses types.LoadArgs to populate a struct.
The fields in the struct must meet the TextUnmarshaler interface.
This code adds a UnmarshallableString type to assist with this.