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

dockerapi: Migrated ContainerRemove to Docker SDK #1481

Merged
merged 1 commit into from
Jul 27, 2018
Merged

dockerapi: Migrated ContainerRemove to Docker SDK #1481

merged 1 commit into from
Jul 27, 2018

Conversation

voorka
Copy link
Contributor

@voorka voorka commented Jul 27, 2018

Summary

Migration for ContainerRemove to the Docker SDK

Implementation details

Changes were implemented by swapping API calls to new SDK Client. All changes could be done under the DockerClient interface making this migration fairly straightforward.

There were no previous tests for ContainerRemove so some were added to test normal function and timeouts.

  • RemoveLinks is false as this is a deprecated feature and the default boolean is false.
  • Force is false to perform same functionality as under the go-dockerclient function for removing containers.
  • RemoveVolumes is true to perform same functionality as under the go-dockerclient function for removing containers.

Testing

  • Builds on Linux (make release)
  • Builds on Windows (go build -out amazon-ecs-agent.exe ./agent)
  • Unit tests on Linux (make test) pass
  • Unit tests on Windows (go test -timeout=25s ./agent/...) pass
  • Integration tests on Linux (make run-integ-tests) pass
  • Integration tests on Windows (.\scripts\run-integ-tests.ps1) pass
  • Functional tests on Linux (make run-functional-tests) pass
  • Functional tests on Windows (.\scripts\run-functional-tests.ps1) pass

New tests cover the changes: yes

Description for the changelog

Enhancement - ContainerRemove migrated to Docker SDK

Licensing

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@voorka voorka requested a review from a team July 27, 2018 19:13
_, mockDockerSDK, client, _, _, _, done := dockerClientSetup(t)
defer done()

gomock.InOrder(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gomock.InOrder is unnecessary.

defer cancel()

err := client.RemoveContainer(ctx, "id", xContainerShortTimeout)
assert.NotNil(t, err, "Expected error for pull timeout")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: assert.Error(t, err, "Expected error for remove timeout")

@voorka voorka merged commit aa9574a into aws:moby Jul 27, 2018
@voorka voorka deleted the remove branch August 7, 2018 01:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants