spec: add version command and increment version to 0.2.0

This commit is contained in:
Gabe Rosenhouse 2016-07-21 12:59:08 -07:00
parent 0506bae8fc
commit 7bc96f05bb

17
SPEC.md
View File

@ -62,9 +62,14 @@ The operations that the CNI plugin needs to support are:
- **Extra arguments**, as defined above. - **Extra arguments**, as defined above.
- **Name of the interface inside the container**, as defined above. - **Name of the interface inside the container**, as defined above.
- Report version
- Parameters: NONE.
- Result:
- The version of the CNI spec implemented by the plugin: `{ "cniVersion": "0.2.0" }`
The executable command-line API uses the type of network (see [Network Configuration](#network-configuration) below) as the name of the executable to invoke. The executable command-line API uses the type of network (see [Network Configuration](#network-configuration) below) as the name of the executable to invoke.
It will then look for this executable in a list of predefined directories. Once found, it will invoke the executable using the following environment variables for argument passing: It will then look for this executable in a list of predefined directories. Once found, it will invoke the executable using the following environment variables for argument passing:
- `CNI_COMMAND`: indicates the desired operation; either `ADD` or `DEL` - `CNI_COMMAND`: indicates the desired operation; `ADD`, `DEL` or `VERSION`.
- `CNI_CONTAINERID`: Container ID - `CNI_CONTAINERID`: Container ID
- `CNI_NETNS`: Path to network namespace file - `CNI_NETNS`: Path to network namespace file
- `CNI_IFNAME`: Interface name to set up - `CNI_IFNAME`: Interface name to set up
@ -80,7 +85,7 @@ Success is indicated by a return code of zero and the following JSON printed to
``` ```
{ {
"cniVersion": "0.1.0", "cniVersion": "0.2.0",
"ip4": { "ip4": {
"ip": <ipv4-and-subnet-in-CIDR>, "ip": <ipv4-and-subnet-in-CIDR>,
"gateway": <ipv4-of-the-gateway>, (optional) "gateway": <ipv4-of-the-gateway>, (optional)
@ -109,7 +114,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: Errors are indicated by a non-zero return code and the following JSON being printed to stdout:
``` ```
{ {
"cniVersion": "0.1.0", "cniVersion": "0.2.0",
"code": <numeric-error-code>, "code": <numeric-error-code>,
"msg": <short-error-message>, "msg": <short-error-message>,
"details": <long-error-message> (optional) "details": <long-error-message> (optional)
@ -146,7 +151,7 @@ Plugins may define additional fields that they accept and may generate an error
```json ```json
{ {
"cniVersion": "0.1.0", "cniVersion": "0.2.0",
"name": "dbnet", "name": "dbnet",
"type": "bridge", "type": "bridge",
// type (plugin) specific // type (plugin) specific
@ -165,7 +170,7 @@ Plugins may define additional fields that they accept and may generate an error
```json ```json
{ {
"cniVersion": "0.1.0", "cniVersion": "0.2.0",
"name": "pci", "name": "pci",
"type": "ovs", "type": "ovs",
// type (plugin) specific // type (plugin) specific
@ -215,7 +220,7 @@ Success is indicated by a zero return code and the following JSON being printed
``` ```
{ {
"cniVersion": "0.1.0", "cniVersion": "0.2.0",
"ip4": { "ip4": {
"ip": <ipv4-and-subnet-in-CIDR>, "ip": <ipv4-and-subnet-in-CIDR>,
"gateway": <ipv4-of-the-gateway>, (optional) "gateway": <ipv4-of-the-gateway>, (optional)