Skip to content

Commit

Permalink
Add network builder and platform APIs (aws#3939)
Browse files Browse the repository at this point in the history
Added the network builder and platform APIs into the shared library package. Network builder is intended to act as the API to be consumed by the agent to setup networking resources on the host. Network builder invokes the platform APIs to execute platform specific operations like creation of network namespaces etc.

---------

Co-authored-by: Samuel Konat <samjkon@amazon.com>
  • Loading branch information
samjkon and Samuel Konat committed Oct 19, 2023
1 parent 4b33664 commit b8d2a7f
Show file tree
Hide file tree
Showing 21 changed files with 913 additions and 542 deletions.
2 changes: 1 addition & 1 deletion agent/acs/session/payload_responder.go
Expand Up @@ -140,7 +140,7 @@ func (pmHandler *payloadMessageHandler) addPayloadTasks(payload *ecsacs.PayloadM

// Add ENI information to the task struct.
for _, acsENI := range task.ElasticNetworkInterfaces {
eni, err := ni.ENIFromACS(acsENI)
eni, err := ni.InterfaceFromACS(acsENI)
if err != nil {
pmHandler.handleInvalidTask(task, err, payload)
allTasksOK = false
Expand Down

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

This file was deleted.

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

1 change: 1 addition & 0 deletions agent/vendor/modules.txt
Expand Up @@ -44,6 +44,7 @@ github.com/aws/amazon-ecs-agent/ecs-agent/metrics
github.com/aws/amazon-ecs-agent/ecs-agent/modeltransformer
github.com/aws/amazon-ecs-agent/ecs-agent/netlib/model/appmesh
github.com/aws/amazon-ecs-agent/ecs-agent/netlib/model/networkinterface
github.com/aws/amazon-ecs-agent/ecs-agent/netlib/model/status
github.com/aws/amazon-ecs-agent/ecs-agent/stats
github.com/aws/amazon-ecs-agent/ecs-agent/tcs/client
github.com/aws/amazon-ecs-agent/ecs-agent/tcs/handler
Expand Down
23 changes: 23 additions & 0 deletions ecs-agent/netlib/common_test.go
@@ -0,0 +1,23 @@
package netlib

const (
taskID = "random-task-id"
eniMAC = "f0:5c:89:a3:ab:01"
eniName = "f05c89a3ab01"
eniMAC2 = "f0:5c:89:a3:ab:02"
eniName2 = "f05c89a3ab02"
eniID = "eni-abdf1234"
eniID2 = "eni-abdf12342"
dnsName = "amazon.com"
nameServer = "10.1.0.2"
nameServer2 = "10.2.0.2"
ipv4Addr = "10.1.0.196"
ipv4Addr2 = "10.2.0.196"
ipv6Addr = "2600:1f13:4d9:e611:9009:ac97:1ab4:17d1"
ipv6Addr2 = "2600:1f13:4d9:e611:9009:ac97:1ab4:17d2"
subnetGatewayCIDR = "10.1.0.1/24"
subnetGatewayCIDR2 = "10.2.0.1/24"
netNSNamePattern = "%s-%s"
searchDomainName = "us-west-2.test.compute.internal"
netNSPathDir = "/var/run/netns/"
)

0 comments on commit b8d2a7f

Please sign in to comment.