Skip to content

Commit

Permalink
Address required network name field for updated CNI spec
Browse files Browse the repository at this point in the history
  • Loading branch information
yinyic committed Aug 29, 2022
1 parent 4cdd048 commit c088bac
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions agent/ecscni/netconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ func newNetworkConfig(netcfg interface{}, plugin string, cniVersion string) (*li
Network: &cnitypes.NetConf{
Type: plugin,
CNIVersion: cniVersion,
Name: defaultNetworkName,
},
Bytes: configBytes,
}
Expand Down
4 changes: 4 additions & 0 deletions agent/ecscni/types_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions agent/ecscni/types_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down

0 comments on commit c088bac

Please sign in to comment.