diff --git a/CHANGELOG.md b/CHANGELOG.md index 1dfd4acc01a..ab633c4997c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ * Feature - Support for provisioning Tasks with ENIs * Enhancement - Support `init` process in containers by adding support for Docker remote API client version 1.25 [#996](https://github.com/aws/amazon-ecs-agent/pull/996) +* Enhancement - Enable 'none' logging driver capability by default + [#1041](https://github.com/aws/amazon-ecs-agent/pull/1041) * Bug - Fixed a bug where tasks that fail to pull containers can cause the agent to fail to restore properly after a restart. [#1033](https://github.com/aws/amazon-ecs-agent/pull/1033) diff --git a/README.md b/README.md index 1ee0d31d5b7..78b3dee42f4 100644 --- a/README.md +++ b/README.md @@ -162,7 +162,7 @@ configure them as something other than the defaults. | `ECS_UPDATE_DOWNLOAD_DIR` | /cache | Where to place update tarballs within the container. | | | | `ECS_DISABLE_METRICS` | <true | false> | Whether to disable metrics gathering for tasks. | false | true | | `ECS_RESERVED_MEMORY` | 32 | Memory, in MB, to reserve for use by things other than containers managed by Amazon ECS. | 0 | 0 | -| `ECS_AVAILABLE_LOGGING_DRIVERS` | `["awslogs","fluentd","gelf","json-file","journald","logentries","splunk","syslog"]` | Which logging drivers are available on the container instance. | `["json-file"]` | `["json-file"]` | +| `ECS_AVAILABLE_LOGGING_DRIVERS` | `["awslogs","fluentd","gelf","json-file","journald","logentries","splunk","syslog"]` | Which logging drivers are available on the container instance. | `["json-file","none"]` | `["json-file","none"]` | | `ECS_DISABLE_PRIVILEGED` | `true` | Whether launching privileged containers is disabled on the container instance. | `false` | `false` | | `ECS_SELINUX_CAPABLE` | `true` | Whether SELinux is available on the container instance. | `false` | `false` | | `ECS_APPARMOR_CAPABLE` | `true` | Whether AppArmor is available on the container instance. | `false` | `false` | diff --git a/agent/app/agent_capability.go b/agent/app/agent_capability.go index 6a6c905f903..e27bf5f7012 100644 --- a/agent/app/agent_capability.go +++ b/agent/app/agent_capability.go @@ -45,6 +45,7 @@ const ( // com.amazonaws.ecs.capability.logging-driver.fluentd // com.amazonaws.ecs.capability.logging-driver.journald // com.amazonaws.ecs.capability.logging-driver.gelf +// com.amazonaws.ecs.capability.logging-driver.none // com.amazonaws.ecs.capability.selinux // com.amazonaws.ecs.capability.apparmor // com.amazonaws.ecs.capability.ecr-auth diff --git a/agent/config/config_unix.go b/agent/config/config_unix.go index 5700b8279fa..746d279ab5e 100644 --- a/agent/config/config_unix.go +++ b/agent/config/config_unix.go @@ -35,7 +35,7 @@ func DefaultConfig() Config { DataDirOnHost: "/var/lib/ecs", DisableMetrics: false, ReservedMemory: 0, - AvailableLoggingDrivers: []dockerclient.LoggingDriver{dockerclient.JSONFileDriver}, + AvailableLoggingDrivers: []dockerclient.LoggingDriver{dockerclient.JSONFileDriver, dockerclient.NoneDriver}, TaskCleanupWaitDuration: DefaultTaskCleanupWaitDuration, DockerStopTimeout: DefaultDockerStopTimeout, CredentialsAuditLogFile: defaultCredentialsAuditLogFile, diff --git a/agent/config/config_unix_test.go b/agent/config/config_unix_test.go index d9446236f1a..54a8a14e168 100644 --- a/agent/config/config_unix_test.go +++ b/agent/config/config_unix_test.go @@ -61,7 +61,8 @@ func TestConfigDefault(t *testing.T) { assert.Equal(t, uint16(0), cfg.ReservedMemory, "Default reserved memory set incorrectly") assert.Equal(t, 30*time.Second, cfg.DockerStopTimeout, "Default docker stop container timeout set incorrectly") assert.False(t, cfg.PrivilegedDisabled, "Default PrivilegedDisabled set incorrectly") - assert.Equal(t, []dockerclient.LoggingDriver{dockerclient.JSONFileDriver}, cfg.AvailableLoggingDrivers, "Default logging drivers set incorrectly") + assert.Equal(t, []dockerclient.LoggingDriver{dockerclient.JSONFileDriver, dockerclient.NoneDriver}, + cfg.AvailableLoggingDrivers, "Default logging drivers set incorrectly") assert.Equal(t, 3*time.Hour, cfg.TaskCleanupWaitDuration, "Default task cleanup wait duration set incorrectly") assert.False(t, cfg.TaskENIEnabled, "TaskENIEnabled set incorrectly") assert.False(t, cfg.TaskIAMRoleEnabled, "TaskIAMRoleEnabled set incorrectly") diff --git a/agent/config/config_windows.go b/agent/config/config_windows.go index c64d5dd0a15..c0a5fce0334 100644 --- a/agent/config/config_windows.go +++ b/agent/config/config_windows.go @@ -67,7 +67,7 @@ func DefaultConfig() Config { // DisableMetrics is set to true on Windows as docker stats does not work DisableMetrics: true, ReservedMemory: 0, - AvailableLoggingDrivers: []dockerclient.LoggingDriver{dockerclient.JSONFileDriver}, + AvailableLoggingDrivers: []dockerclient.LoggingDriver{dockerclient.JSONFileDriver, dockerclient.NoneDriver}, TaskCleanupWaitDuration: DefaultTaskCleanupWaitDuration, DockerStopTimeout: DefaultDockerStopTimeout, CredentialsAuditLogFile: filepath.Join(ecsRoot, defaultCredentialsAuditLogFile), diff --git a/agent/config/config_windows_test.go b/agent/config/config_windows_test.go index f052faf965f..85292202126 100644 --- a/agent/config/config_windows_test.go +++ b/agent/config/config_windows_test.go @@ -54,7 +54,8 @@ func TestConfigDefault(t *testing.T) { assert.Equal(t, uint16(0), cfg.ReservedMemory, "Default reserved memory set incorrectly") assert.Equal(t, 30*time.Second, cfg.DockerStopTimeout, "Default docker stop container timeout set incorrectly") assert.False(t, cfg.PrivilegedDisabled, "Default PrivilegedDisabled set incorrectly") - assert.Equal(t, []dockerclient.LoggingDriver{dockerclient.JSONFileDriver}, cfg.AvailableLoggingDrivers, "Default logging drivers set incorrectly") + assert.Equal(t, []dockerclient.LoggingDriver{dockerclient.JSONFileDriver, dockerclient.NoneDriver}, + cfg.AvailableLoggingDrivers, "Default logging drivers set incorrectly") assert.Equal(t, 3*time.Hour, cfg.TaskCleanupWaitDuration, "Default task cleanup wait duration set incorrectly") assert.False(t, cfg.TaskIAMRoleEnabled, "TaskIAMRoleEnabled set incorrectly") assert.False(t, cfg.TaskIAMRoleEnabledForNetworkHost, "TaskIAMRoleEnabledForNetworkHost set incorrectly") diff --git a/agent/config/types.go b/agent/config/types.go index 05549c9c58f..b3076ba6cc9 100644 --- a/agent/config/types.go +++ b/agent/config/types.go @@ -91,7 +91,7 @@ type Config struct { DockerStopTimeout time.Duration // AvailableLoggingDrivers specifies the logging drivers available for use - // with Docker. If not set, it defaults to ["json-file"]. + // with Docker. If not set, it defaults to ["json-file","none"]. AvailableLoggingDrivers []dockerclient.LoggingDriver // PrivilegedDisabled specified whether the Agent is capable of launching diff --git a/agent/engine/dockerclient/logging_drivers.go b/agent/engine/dockerclient/logging_drivers.go index 484e7fc613b..0aec379b03b 100644 --- a/agent/engine/dockerclient/logging_drivers.go +++ b/agent/engine/dockerclient/logging_drivers.go @@ -25,6 +25,7 @@ const ( SplunklogsDriver LoggingDriver = "splunk" LogentriesDriver LoggingDriver = "logentries" SumoLogicDriver LoggingDriver = "sumologic" + NoneDriver LoggingDriver = "none" ) var LoggingDriverMinimumVersion = map[LoggingDriver]DockerVersion{ @@ -37,4 +38,5 @@ var LoggingDriverMinimumVersion = map[LoggingDriver]DockerVersion{ SplunklogsDriver: Version_1_22, LogentriesDriver: Version_1_25, SumoLogicDriver: Version_1_29, + NoneDriver: Version_1_19, }