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

aws-ecs-1: add configurable logging drivers #1005

Merged
merged 1 commit into from
Jul 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions sources/api/ecs-settings-applier/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ struct ECSConfig {

#[serde(skip_serializing_if = "Option::is_none")]
privileged_disabled: Option<bool>,

#[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
available_logging_drivers: Vec<String>,
samuelkarp marked this conversation as resolved.
Show resolved Hide resolved
}

// Returning a Result from main makes it print a Debug representation of the error, but with Snafu
Expand Down Expand Up @@ -58,6 +61,12 @@ fn run() -> Result<()> {
let mut config = ECSConfig {
cluster: ecs.cluster,
privileged_disabled: ecs.allow_privileged_containers.map(|s| !s),
available_logging_drivers: ecs
.logging_drivers
.unwrap_or_default()
.iter()
.map(|s| s.to_string())
.collect(),
..Default::default()
};
if let Some(os) = settings.os {
Expand Down
1 change: 1 addition & 0 deletions sources/models/src/aws-ecs-1/override-defaults.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ affected-services = ["ecs"]

[settings.ecs]
allow-privileged-containers = false
logging-drivers = ["json-file", "awslogs", "none"]
1 change: 1 addition & 0 deletions sources/models/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ struct ECSSettings {
cluster: String,
instance_attributes: HashMap<ECSAttributeKey, ECSAttributeValue>,
allow_privileged_containers: bool,
logging_drivers: Vec<SingleLineString>,
}

// Update settings. Taken from userdata. The 'seed' setting is generated
Expand Down