diff --git a/agent/ecscni/netconfig.go b/agent/ecscni/netconfig.go index dda77a8f907..6f84fb71bb2 100644 --- a/agent/ecscni/netconfig.go +++ b/agent/ecscni/netconfig.go @@ -33,6 +33,7 @@ func newNetworkConfig(netcfg interface{}, plugin string, cniVersion string) (*li Network: &cnitypes.NetConf{ Type: plugin, CNIVersion: cniVersion, + Name: defaultNetworkName, }, Bytes: configBytes, } diff --git a/agent/ecscni/types_linux.go b/agent/ecscni/types_linux.go index 2ad65834acd..729acac38ff 100644 --- a/agent/ecscni/types_linux.go +++ b/agent/ecscni/types_linux.go @@ -41,6 +41,10 @@ const ( ECSBranchENIPluginName = "vpc-branch-eni" // NetnsFormat is used to construct the path to cotainer network namespace NetnsFormat = "/host/proc/%s/ns/net" + // Starting with CNI plugin v0.8.0 (this PR https://github.com/containernetworking/cni/pull/698) + // NetworkName has to be non-empty field for network config. + // We do not actually make use of the field, hence passing in a placeholder string to fulfill the API spec + defaultNetworkName = "network-name" ) //IPAMNetworkConfig is the config format accepted by the plugin diff --git a/agent/ecscni/types_windows.go b/agent/ecscni/types_windows.go index 4a2218f255b..249c5b9ad19 100644 --- a/agent/ecscni/types_windows.go +++ b/agent/ecscni/types_windows.go @@ -31,6 +31,10 @@ const ( TaskHNSNetworkNamePrefix = "task" // ECSBridgeNetworkName is the name of the HNS network used as ecs-bridge. ECSBridgeNetworkName = "nat" + // Starting with CNI plugin v0.8.0 (this PR https://github.com/containernetworking/cni/pull/698) + // NetworkName has to be non-empty field for network config. + // We do not actually make use of the field, hence passing in a placeholder string to fulfill the API spec + defaultNetworkName = "network-name" ) var (