-
Notifications
You must be signed in to change notification settings - Fork 457
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: avoid double-rendering mounts to docker-compose.tmp.yml (#669)
In certain code paths, such as in `tutor local quickstart`, `process_mount_points` is called more than once in the same process, causing mounts to be added to `COMPOSE_LOCAL[_JOBS]_TMP` redundantly. As a result, docker-compose[.jobs].tmp.yml was occasionally being rendered with duplicate volume specifiers. Some versions of Docker Compose ignored this; other versions warned or threw an error. In order to make `process_mount_points` tolerant to being called multiple times, we wrap its volume-adding callbacks within a new hooks context. This allows us to clear said hooks context every time `process_mount_points` is called, essentially making the function idempotent. Co-authored-by: Régis Behmo <regis@behmo.com>
- Loading branch information
1 parent
d27e8d5
commit 0ae59a8
Showing
4 changed files
with
83 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters