Skip to content

Commit

Permalink
Merge pull request #783 from dcbw/100
Browse files Browse the repository at this point in the history
types changes for 1.0.0
  • Loading branch information
dcbw authored Nov 19, 2020
2 parents 6fc72a4 + 7555ca3 commit d1e1ae3
Show file tree
Hide file tree
Showing 20 changed files with 1,395 additions and 484 deletions.
42 changes: 16 additions & 26 deletions SPEC.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

## Version

This is CNI **spec** version **0.4.0**.
This is CNI **spec** version **1.0.0 pre-release** and is still under active development.

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)).

Expand Down Expand Up @@ -152,8 +152,8 @@ Plugins should generally complete a `DEL` action without error even if some reso

```
{
"cniVersion": "0.4.0", // the version of the CNI spec in use for this output
"supportedVersions": [ "0.1.0", "0.2.0", "0.3.0", "0.3.1", "0.4.0" ] // the list of CNI spec versions that this plugin supports
"cniVersion": "1.0.0", // the version of the CNI spec in use for this output
"supportedVersions": [ "0.1.0", "0.2.0", "0.3.0", "0.3.1", "0.4.0", "1.0.0" ] // the list of CNI spec versions that this plugin supports
}
```

Expand All @@ -178,7 +178,7 @@ Plugins must indicate success with a return code of zero and the following JSON

```
{
"cniVersion": "0.4.0",
"cniVersion": "1.0.0",
"interfaces": [ (this key omitted by IPAM plugins)
{
"name": "<name>",
Expand All @@ -188,7 +188,6 @@ Plugins must indicate success with a return code of zero and the following JSON
],
"ips": [
{
"version": "<4-or-6>",
"address": "<ip-and-prefix-in-CIDR>",
"gateway": "<ip-address-of-the-gateway>", (optional)
"interface": <numeric index into 'interfaces' list>
Expand Down Expand Up @@ -236,7 +235,7 @@ Examples include generating an `/etc/resolv.conf` file to be injected into the c
Errors must be indicated by a non-zero return code and the following JSON being printed to stdout:
```
{
"cniVersion": "0.4.0",
"cniVersion": "1.0.0",
"code": <numeric-error-code>,
"msg": <short-error-message>,
"details": <long-error-message> (optional)
Expand Down Expand Up @@ -273,7 +272,7 @@ Plugins may define additional fields that they accept and may generate an error

```jsonc
{
"cniVersion": "0.4.0",
"cniVersion": "1.0.0",
"name": "dbnet",
"type": "bridge",
// type (plugin) specific
Expand All @@ -294,7 +293,7 @@ Plugins may define additional fields that they accept and may generate an error

```jsonc
{
"cniVersion": "0.4.0",
"cniVersion": "1.0.0",
"name": "pci",
"type": "ovs",
// type (plugin) specific
Expand All @@ -317,7 +316,7 @@ Plugins may define additional fields that they accept and may generate an error

```jsonc
{
"cniVersion": "0.4.0",
"cniVersion": "1.0.0",
"name": "wan",
"type": "macvlan",
// ipam specific
Expand Down Expand Up @@ -367,7 +366,7 @@ If an `ADD` action fails, when the runtime decides to handle the failure it shou

```jsonc
{
"cniVersion": "0.4.0",
"cniVersion": "1.0.0",
"name": "dbnet",
"plugins": [
{
Expand Down Expand Up @@ -409,7 +408,7 @@ Note that the runtime adds the `cniVersion` and `name` fields from configuration

```jsonc
{
"cniVersion": "0.4.0",
"cniVersion": "1.0.0",
"name": "dbnet",
"type": "bridge",
"bridge": "cni0",
Expand All @@ -434,7 +433,7 @@ Note that the runtime adds the `cniVersion` and `name` fields from configuration

```json
{
"cniVersion": "0.4.0",
"cniVersion": "1.0.0",
"name": "dbnet",
"type": "tuning",
"sysctl": {
Expand All @@ -443,7 +442,6 @@ Note that the runtime adds the `cniVersion` and `name` fields from configuration
"prevResult": {
"ips": [
{
"version": "4",
"address": "10.0.0.5/32",
"interface": 2
}
Expand Down Expand Up @@ -476,7 +474,7 @@ Given the same network configuration JSON list, the container runtime would perf

```jsonc
{
"cniVersion": "0.4.0",
"cniVersion": "1.0.0",
"name": "dbnet",
"type": "bridge",
"bridge": "cni0",
Expand All @@ -497,7 +495,6 @@ Given the same network configuration JSON list, the container runtime would perf
"prevResult": {
"ips": [
{
"version": "4",
"address": "10.0.0.5/32",
"interface": 2
}
Expand Down Expand Up @@ -528,7 +525,7 @@ Given the same network configuration JSON list, the container runtime would perf

```json
{
"cniVersion": "0.4.0",
"cniVersion": "1.0.0",
"name": "dbnet",
"type": "tuning",
"sysctl": {
Expand All @@ -537,7 +534,6 @@ Given the same network configuration JSON list, the container runtime would perf
"prevResult": {
"ips": [
{
"version": "4",
"address": "10.0.0.5/32",
"interface": 2
}
Expand Down Expand Up @@ -571,7 +567,7 @@ Note that plugins are executed in reverse order from the `ADD` and `CHECK` actio

```json
{
"cniVersion": "0.4.0",
"cniVersion": "1.0.0",
"name": "dbnet",
"type": "tuning",
"sysctl": {
Expand All @@ -580,7 +576,6 @@ Note that plugins are executed in reverse order from the `ADD` and `CHECK` actio
"prevResult": {
"ips": [
{
"version": "4",
"address": "10.0.0.5/32",
"interface": 2
}
Expand Down Expand Up @@ -611,7 +606,7 @@ Note that plugins are executed in reverse order from the `ADD` and `CHECK` actio

```jsonc
{
"cniVersion": "0.4.0",
"cniVersion": "1.0.0",
"name": "dbnet",
"type": "bridge",
"bridge": "cni0",
Expand All @@ -632,7 +627,6 @@ Note that plugins are executed in reverse order from the `ADD` and `CHECK` actio
"prevResult": {
"ips": [
{
"version": "4",
"address": "10.0.0.5/32",
"interface": 2
}
Expand Down Expand Up @@ -673,10 +667,9 @@ Success must be indicated by a zero return code and the following JSON being pri

```
{
"cniVersion": "0.4.0",
"cniVersion": "1.0.0",
"ips": [
{
"version": "<4-or-6>",
"address": "<ip-and-prefix-in-CIDR>",
"gateway": "<ip-address-of-the-gateway>" (optional)
},
Expand Down Expand Up @@ -728,7 +721,6 @@ IPAM plugin examples:
```
"ips": [
{
"version": "<4-or-6>",
"address": "<ip-and-prefix-in-CIDR>",
"gateway": "<ip-address-of-the-gateway>", (optional)
"interface": <numeric index into 'interfaces' list> (not required for IPAM plugins)
Expand All @@ -740,8 +732,6 @@ IPAM plugin examples:
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`.
- `address` (string): an IP address in CIDR notation (eg "192.168.1.3/24").
- `gateway` (string): the default gateway for this subnet, if one exists.
It does not instruct the CNI plugin to add any routes with this gateway: routes to add are specified separately via the `routes` field.
Expand Down
Loading

0 comments on commit d1e1ae3

Please sign in to comment.