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

fix windows drive volume mounting #1571

Merged
merged 1 commit into from
Sep 14, 2018
Merged

Conversation

fenxiong
Copy link
Contributor

@fenxiong fenxiong commented Sep 12, 2018

Summary

For windows volume task, the agent fails to support a mounting from drive to drive, because when the container path is a bare drive like 'D:', the agent changes it to 'd:.' in the getCanonicalPath function, which is no longer supported by Docker because that is a directory, but container path can only be either a directory in C drive, or another drive. This pr is to fix this issue.

Implementation details

Treat the bare drive path specially in getCanonicalPath.

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:
unit test added; manual test is performed to verify that this fixes the issue; functional test is not added because it seems to be nontrivial to add another drive.

Description for the changelog

Licensing

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

@@ -73,8 +73,23 @@ func (task *Task) downcaseAllVolumePaths() {
}
}

func isBareDrive(path string) bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I tend to prefer having the caller function above the callee function (so getCanonicalPath above isBareDrive) as I find it easier to read (I can understand why the function exists before reading the body of it).

@fenxiong
Copy link
Contributor Author

moved isBareDrive to be under getCanonicalPath and rebased.

@fenxiong fenxiong merged commit 20c98cc into aws:dev Sep 14, 2018
@fenxiong fenxiong deleted the fix-windows-volume branch September 14, 2018 16:30
@fenxiong fenxiong modified the milestones: 1.21.0, 1.20.4 Sep 25, 2018
@sharanyad sharanyad modified the milestones: 1.20.4, 1.21.0 Oct 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants