spec/plugins: fix 'ip'->'ips' in the spec, bump to 0.3.1
This commit is contained in:
45
SPEC.md
45
SPEC.md
@@ -1,7 +1,7 @@
|
||||
# Container Networking Interface Proposal
|
||||
|
||||
## Version
|
||||
This is CNI **spec** version **0.3.0**.
|
||||
This is CNI **spec** version **0.3.1**.
|
||||
|
||||
Note that this is **independent from the version of the CNI library and plugins** in this repository (e.g. the versions of [releases](https://github.com/containernetworking/cni/releases)).
|
||||
|
||||
@@ -76,8 +76,8 @@ The operations that the CNI plugin needs to support are:
|
||||
|
||||
```
|
||||
{
|
||||
"cniVersion": "0.3.0", // the version of the CNI spec in use for this output
|
||||
"supportedVersions": [ "0.1.0", "0.2.0", "0.3.0" ] // the list of CNI spec versions that this plugin supports
|
||||
"cniVersion": "0.3.1", // the version of the CNI spec in use for this output
|
||||
"supportedVersions": [ "0.1.0", "0.2.0", "0.3.0", "0.3.1" ] // the list of CNI spec versions that this plugin supports
|
||||
}
|
||||
```
|
||||
|
||||
@@ -97,11 +97,11 @@ Network configuration in JSON format is streamed to the plugin through stdin. Th
|
||||
|
||||
Note that IPAM plugins return an abbreviated `Result` structure as described in [IP Allocation](#ip-allocation).
|
||||
|
||||
Success is indicated by a return code of zero and the following JSON printed to stdout in the case of the ADD command. The `ip` and `dns` items should be the same output as was returned by the IPAM plugin (see [IP Allocation](#ip-allocation) for details) except that the plugin should fill in the `interface` indexes appropriately, which are missing from IPAM plugin output since IPAM plugins should be unaware of interfaces.
|
||||
Success is indicated by a return code of zero and the following JSON printed to stdout in the case of the ADD command. The `ips` and `dns` items should be the same output as was returned by the IPAM plugin (see [IP Allocation](#ip-allocation) for details) except that the plugin should fill in the `interface` indexes appropriately, which are missing from IPAM plugin output since IPAM plugins should be unaware of interfaces.
|
||||
|
||||
```
|
||||
{
|
||||
"cniVersion": "0.3.0",
|
||||
"cniVersion": "0.3.1",
|
||||
"interfaces": [ (this key omitted by IPAM plugins)
|
||||
{
|
||||
"name": "<name>",
|
||||
@@ -109,7 +109,7 @@ Success is indicated by a return code of zero and the following JSON printed to
|
||||
"sandbox": "<netns path or hypervisor identifier>" (required for container/hypervisor interfaces, empty/omitted for host interfaces)
|
||||
}
|
||||
],
|
||||
"ip": [
|
||||
"ips": [
|
||||
{
|
||||
"version": "<4-or-6>",
|
||||
"address": "<ip-and-prefix-in-CIDR>",
|
||||
@@ -143,8 +143,8 @@ If the `CNI_IFNAME` variable exists the plugin must use that name for the sandbo
|
||||
Hypervisor/VM-based plugins should return an ID unique to the virtualized sandbox the interface was created in.
|
||||
This item must be provided for interfaces created or moved into a sandbox like a network namespace or a hypervisor/VM.
|
||||
|
||||
The `ip` field is a list of IP configuration information.
|
||||
See the [IP well-known structure](#ip) section for more information.
|
||||
The `ips` field is a list of IP configuration information.
|
||||
See the [IP well-known structure](#ips) section for more information.
|
||||
|
||||
The `dns` field contains a dictionary consisting of common DNS information.
|
||||
See the [DNS well-known structure](#dns) section for more information.
|
||||
@@ -155,7 +155,7 @@ Examples include generating an `/etc/resolv.conf` file to be injected into the c
|
||||
Errors are indicated by a non-zero return code and the following JSON being printed to stdout:
|
||||
```
|
||||
{
|
||||
"cniVersion": "0.2.0",
|
||||
"cniVersion": "0.3.1",
|
||||
"code": <numeric-error-code>,
|
||||
"msg": <short-error-message>,
|
||||
"details": <long-error-message> (optional)
|
||||
@@ -185,11 +185,12 @@ The network configuration is described in JSON form. The configuration can be st
|
||||
- `options` (list of strings): list of options that can be passed to the resolver
|
||||
|
||||
Plugins may define additional fields that they accept and may generate an error if called with unknown fields. The exception to this is the `args` field may be used to pass arbitrary data which may be ignored by plugins.
|
||||
|
||||
### Example configurations
|
||||
|
||||
```json
|
||||
{
|
||||
"cniVersion": "0.3.0",
|
||||
"cniVersion": "0.3.1",
|
||||
"name": "dbnet",
|
||||
"type": "bridge",
|
||||
// type (plugin) specific
|
||||
@@ -208,7 +209,7 @@ Plugins may define additional fields that they accept and may generate an error
|
||||
|
||||
```json
|
||||
{
|
||||
"cniVersion": "0.3.0",
|
||||
"cniVersion": "0.3.1",
|
||||
"name": "pci",
|
||||
"type": "ovs",
|
||||
// type (plugin) specific
|
||||
@@ -229,7 +230,7 @@ Plugins may define additional fields that they accept and may generate an error
|
||||
|
||||
```json
|
||||
{
|
||||
"cniVersion": "0.3.0",
|
||||
"cniVersion": "0.3.1",
|
||||
"name": "wan",
|
||||
"type": "macvlan",
|
||||
// ipam specific
|
||||
@@ -278,7 +279,7 @@ Plugins should generally complete a DEL action without error even if some resour
|
||||
|
||||
```json
|
||||
{
|
||||
"cniVersion": "0.2.0",
|
||||
"cniVersion": "0.3.1",
|
||||
"name": "dbnet",
|
||||
"plugins": [
|
||||
{
|
||||
@@ -320,7 +321,7 @@ Note that the runtime adds the `cniVersion` and `name` fields from configuration
|
||||
|
||||
```json
|
||||
{
|
||||
"cniVersion": "0.2.0",
|
||||
"cniVersion": "0.3.1",
|
||||
"name": "dbnet",
|
||||
"type": "bridge",
|
||||
"bridge": "cni0",
|
||||
@@ -345,7 +346,7 @@ Note that the runtime adds the `cniVersion` and `name` fields from configuration
|
||||
|
||||
```json
|
||||
{
|
||||
"cniVersion": "0.2.0",
|
||||
"cniVersion": "0.3.1",
|
||||
"name": "dbnet",
|
||||
"type": "tuning",
|
||||
"sysctl": {
|
||||
@@ -371,7 +372,7 @@ Also note that plugins are executed in reverse order from the ADD action.
|
||||
|
||||
```json
|
||||
{
|
||||
"cniVersion": "0.2.0",
|
||||
"cniVersion": "0.3.1",
|
||||
"name": "dbnet",
|
||||
"type": "tuning",
|
||||
"sysctl": {
|
||||
@@ -384,7 +385,7 @@ Also note that plugins are executed in reverse order from the ADD action.
|
||||
|
||||
```json
|
||||
{
|
||||
"cniVersion": "0.2.0",
|
||||
"cniVersion": "0.3.1",
|
||||
"name": "dbnet",
|
||||
"type": "bridge",
|
||||
"bridge": "cni0",
|
||||
@@ -419,7 +420,7 @@ Success is indicated by a zero return code and the following JSON being printed
|
||||
|
||||
```
|
||||
{
|
||||
"cniVersion": "0.3.0",
|
||||
"cniVersion": "0.3.1",
|
||||
"ips": [
|
||||
{
|
||||
"version": "<4-or-6>",
|
||||
@@ -449,7 +450,7 @@ Note that unlike regular CNI plugins, IPAM plugins return an abbreviated `Result
|
||||
`cniVersion` specifies a [Semantic Version 2.0](http://semver.org) of CNI specification used by the plugin.
|
||||
|
||||
The `ips` field is a list of IP configuration information.
|
||||
See the [IP well-known structure](#ip) section for more information.
|
||||
See the [IP well-known structure](#ips) section for more information.
|
||||
|
||||
The `dns` field contains a dictionary consisting of common DNS information.
|
||||
See the [DNS well-known structure](#dns) section for more information.
|
||||
@@ -466,7 +467,7 @@ IPAM plugin examples:
|
||||
|
||||
### Well-known Structures
|
||||
|
||||
#### IP
|
||||
#### IPs
|
||||
|
||||
```
|
||||
"ips": [
|
||||
@@ -480,8 +481,8 @@ IPAM plugin examples:
|
||||
]
|
||||
```
|
||||
|
||||
The `ip` field is a list of IP configuration information determined by the plugin. Each item is a dictionary describing of IP configuration for a network interface.
|
||||
IP configuration for multiple network interfaces and multiple IP configurations for a single interface may be returned as separate items in the `ip` list.
|
||||
The `ips` field is a list of IP configuration information determined by the plugin. Each item is a dictionary describing of IP configuration for a network interface.
|
||||
IP configuration for multiple network interfaces and multiple IP configurations for a single interface may be returned as separate items in the `ips` list.
|
||||
All properties known to the plugin should be provided, even if not strictly required.
|
||||
- `version` (string): either "4" or "6" and corresponds to the IP version of the addresses in the entry.
|
||||
All IP addresses and gateways provided must be valid for the given `version`.
|
||||
|
||||
Reference in New Issue
Block a user