From 9b8a0e0c6478413b01d846d1292e05627c008819 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 16 Feb 2017 22:57:12 -0600 Subject: [PATCH] spec,libcni: add support for injecting runtimeConfig into plugin stdin data Add a new CapabilityArgs member to the RuntimeConf struct which runtimes can use to pass arbitrary capability-based keys to the plugin. Elements of this member will be filtered against the plugin's advertised capabilities (from its config JSON) and then added to a new "runtimeConfig" top-level map added to the config JSON sent to the plugin on stdin. Also "runtime_config"->"runtimeConfig" in CONVENTIONS.md to make capitalization consistent with other CNI config keys like "cniVersion". --- types/types.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/types/types.go b/types/types.go index b7c27de1..3263015a 100644 --- a/types/types.go +++ b/types/types.go @@ -60,9 +60,10 @@ func (n *IPNet) UnmarshalJSON(data []byte) error { type NetConf struct { CNIVersion string `json:"cniVersion,omitempty"` - Name string `json:"name,omitempty"` - Type string `json:"type,omitempty"` - IPAM struct { + Name string `json:"name,omitempty"` + Type string `json:"type,omitempty"` + Capabilities map[string]bool `json:"capabilities,omitempty"` + IPAM struct { Type string `json:"type,omitempty"` } `json:"ipam,omitempty"` DNS DNS `json:"dns"`