Skip to content

Commit

Permalink
Add /etc/pki directory to appnet agent's bind mounts
Browse files Browse the repository at this point in the history
This is the path to the host's PKI directory. The appnet agent container needs
this directory mounted so that it can access the host's PKI directory for the
purpose of utilizing any special CA certs that the underlying EC2 instance has
configured.
  • Loading branch information
sparrc committed Dec 4, 2024
1 parent 0743b42 commit 38ca72c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions agent/engine/serviceconnect/manager_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ const (

ecsAgentLogFileENV = "ECS_LOGFILE"
defaultECSAgentLogPathContainer = "/log"

// This is the path to the host's PKI directory. The appnet agent container needs
// this directory mounted so that it can access the host's PKI directory for the
// purpose of utilizing any special CA certs that the underlying EC2 instance has
// configured.
hostPKIDirPath = "/etc/pki"
)

type manager struct {
Expand Down Expand Up @@ -207,6 +213,7 @@ func (m *manager) initAgentDirectoryMounts(taskId string, container *apicontaine

hostConfig.Binds = append(hostConfig.Binds, getBindMountMapping(statusPathHost, m.statusPathContainer))
hostConfig.Binds = append(hostConfig.Binds, getBindMountMapping(m.relayPathHost, m.relayPathContainer))
hostConfig.Binds = append(hostConfig.Binds, getBindMountMapping(hostPKIDirPath, hostPKIDirPath))

// create logging directory and bind mount, if customer has not configured a logging driver
if container.GetLogDriver() == "" {
Expand Down
1 change: 1 addition & 0 deletions agent/engine/serviceconnect/manager_linux_test_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ func testAgentContainerModificationsForServiceConnect(t *testing.T, privilegedMo
fmt.Sprintf("%s/status/%s:%s", tempDir, scTask.GetID(), "/some/other/run"),
fmt.Sprintf("%s/relay:%s", tempDir, "/not/var/run"),
fmt.Sprintf("%s/log/%s:%s", tempDir, scTask.GetID(), "/some/other/log"),
"/etc/pki:/etc/pki",
}
expectedENVs := map[string]string{
"ReLaYgOeShErE": "unix:///not/var/run/relay_file_of_holiness",
Expand Down

0 comments on commit 38ca72c

Please sign in to comment.