Skip to content

Commit

Permalink
engine/dockerclient, app: Add new Docker version support and required…
Browse files Browse the repository at this point in the history
… agent Capability

New Docker client versions' agent capabilities to use the Capability prefix "ecs.capability"
  • Loading branch information
sharanyad committed Sep 29, 2017
1 parent 62f3de1 commit 86a2f33
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion agent/app/agent_capability.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const (
// ecs.capability.task-eni
// ecs.capability.task-eni-block-instance-metadata
func (agent *ecsAgent) capabilities() []*ecs.Attribute {
dockerLegacyCapabilityPrefix := map[string]bool {"1.17": true, "1.18": true, "1.19": true, "1.20": true, "1.21": true, "1.22": true, "1.23": true, "1.24": true}
var capabilities []*ecs.Attribute

if !agent.cfg.PrivilegedDisabled {
Expand All @@ -63,7 +64,11 @@ func (agent *ecsAgent) capabilities() []*ecs.Attribute {
// Determine API versions to report as supported. Supported versions are also used for capability-enablement, except
// logging drivers.
for _, version := range agent.dockerClient.SupportedVersions() {
capabilities = appendNameOnlyAttribute(capabilities, capabilityPrefix+"docker-remote-api."+string(version))
if dockerLegacyCapabilityPrefix[string(version)] {
capabilities = appendNameOnlyAttribute(capabilities, capabilityPrefix+"docker-remote-api."+string(version))
} else {
capabilities = appendNameOnlyAttribute(capabilities, attributePrefix+"docker-remote-api."+string(version))
}
supportedVersions[version] = true
}

Expand Down
1 change: 1 addition & 0 deletions agent/engine/dockerclient/versionsupport_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ func getAgentVersions() []DockerVersion {
Version_1_22,
Version_1_23,
Version_1_24,
Version_1_25,
}
}

Expand Down

0 comments on commit 86a2f33

Please sign in to comment.