Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge branch collect-awsvpc-network-metrics into dev #2545

Merged
merged 9 commits into from
Jul 31, 2020
24 changes: 13 additions & 11 deletions agent/Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion agent/Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ required = ["github.com/golang/mock/mockgen/model"]
[[constraint]]
name = "github.com/vishvananda/netlink"
revision ="fe3b5664d23a11b52ba59bece4ff29c52772a56b"

[[constraint]]
name = "github.com/didip/tollbooth"
version = "3.0.2"
Expand All @@ -96,3 +95,7 @@ required = ["github.com/golang/mock/mockgen/model"]
[[constraint]]
branch = "master"
name = "github.com/awslabs/go-config-generator-for-fluentd-and-fluentbit"

[[constraint]]
name = "github.com/containernetworking/plugins"
version = "0.8.6"
91 changes: 69 additions & 22 deletions agent/ecscni/mocks_libcni/libcni_mocks.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions agent/ecscni/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func (client *cniClient) setupNS(ctx context.Context, cfg *Config) (*current.Res
var bridgeResult cnitypes.Result
runtimeConfig := libcni.RuntimeConf{
ContainerID: cfg.ContainerID,
NetNS: fmt.Sprintf(netnsFormat, cfg.ContainerPID),
NetNS: fmt.Sprintf(NetnsFormat, cfg.ContainerPID),
}

// Execute all CNI network configurations serially, in the given order.
Expand Down Expand Up @@ -162,7 +162,7 @@ func (client *cniClient) cleanupNS(ctx context.Context, cfg *Config) error {

runtimeConfig := libcni.RuntimeConf{
ContainerID: cfg.ContainerID,
NetNS: fmt.Sprintf(netnsFormat, cfg.ContainerPID),
NetNS: fmt.Sprintf(NetnsFormat, cfg.ContainerPID),
}

// Execute all CNI network configurations serially, in the reverse order.
Expand Down Expand Up @@ -197,7 +197,7 @@ func (client *cniClient) ReleaseIPResource(ctx context.Context, cfg *Config, tim

runtimeConfig := libcni.RuntimeConf{
ContainerID: cfg.ContainerID,
NetNS: fmt.Sprintf(netnsFormat, cfg.ContainerPID),
NetNS: fmt.Sprintf(NetnsFormat, cfg.ContainerPID),
}

seelog.Debugf("[ECSCNI] Releasing the ip resource from ipam db, id: [%s], ip: [%v]", cfg.ID, cfg.IPAMV4Address)
Expand Down
4 changes: 2 additions & 2 deletions agent/ecscni/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ const (
// defaultAppMeshIfName is the default name of app mesh to setup iptable rules
// for app mesh container. IfName is mandatory field to invoke CNI plugin.
defaultAppMeshIfName = "aws-appmesh"
// netnsFormat is used to construct the path to cotainer network namespace
netnsFormat = "/host/proc/%s/ns/net"
// ecsSubnet is the available ip addresses to use for task networking
ecsSubnet = "169.254.172.0/22"

// NetnsFormat is used to construct the path to cotainer network namespace
NetnsFormat = "/host/proc/%s/ns/net"
// ECSIPAMPluginName is the binary of the ipam plugin
ECSIPAMPluginName = "ecs-ipam"
// ECSBridgePluginName is the binary of the bridge plugin
Expand Down
Loading