-
Notifications
You must be signed in to change notification settings - Fork 617
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
Use ECS_EBSTA_SUPPORTED env variable to add EBSTA capabilities #4091
Use ECS_EBSTA_SUPPORTED env variable to add EBSTA capabilities #4091
Conversation
ecs-init/engine/engine.go
Outdated
if err != nil { | ||
return engineError("could not create EBS mount directory", err) | ||
// Skip for External, EBS Task Attach is not supported for External launch type | ||
if !config.RunningInExternal() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This bug affects EC2 launch type too doesn't it? I am wondering if we should just log the failure and continue. Can we disable the EBS capability if we fail to create this directory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, when running in external we're going to advertise the capability anyways here? even though we failed to make the mnt directory?
c0d1de7
90513fe
to
43f374f
Compare
bf779d4
to
d8b7b9c
Compare
d8b7b9c
to
4016522
Compare
Summary
This is a fix for issue #4089
As part of ecs-init start up, init tries to create
/mnt/ecs/ebs
directory. However depending on how instances are configured,/mnt
can be sometimes be read only. This leads toecs-agent
container failing to be created with following error inecs-init
This PR changes this by adding an environment variable
ECS_EBSTA_SUPPORTED
toecs-agent
. If set to false, agent will not advertise EBSTA capabilities. This works as followsecs-init/engine/engine.go
- If the ebs mount directory/mnt/ecs/ebs
fails to be created, we log this error inpre-start
and continueecs-init/docker/docker.go
- Detect if ebs mount directory has been successfully created. If not set an environment variableECS_EBSTA_SUPPORTED
asfalse
(Set defaulttrue
)agent/app/agent_capability.go
- Check the value ofECS_EBSTA_SUPPORTED
and do not add EBSTA capabilities if the env var is set false. This is set as needed by theecs-init
changes. Agent defaults this totrue
for compatibility with olderecs-init
versionsTesting
New tests cover the changes:
No new tests added
Description for the changelog
Bugfix: Use
ECS_EBSTA_SUPPORTED
env variable to add EBSTA capabilitiesDoes this PR include breaking model changes? If so, Have you added transformation functions?
No
Licensing
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.