added check for empty source in bind mount#824
Merged
dnephin merged 1 commit intodocker:masterfrom Feb 21, 2018
Merged
Conversation
8c3ab9d to
a4f863b
Compare
Codecov Report
@@ Coverage Diff @@
## master #824 +/- ##
=========================================
- Coverage 52.95% 51.7% -1.26%
=========================================
Files 244 244
Lines 15828 15827 -1
=========================================
- Hits 8382 8183 -199
- Misses 6892 7100 +208
+ Partials 554 544 -10 |
a4f863b to
28b7d94
Compare
| } | ||
|
|
||
| if volume.Source == "" { | ||
| return errors.New("invalid mount config for type \"bind\": field Source must not be empty") |
Contributor
There was a problem hiding this comment.
return errors.New(`invalid mount config for type "bind": field Source must not be empty`)is simpler 😄
| - type: bind | ||
| target: /app | ||
| `) | ||
| require.Error(t, err) |
Contributor
There was a problem hiding this comment.
require.EqualError(t, err, `invalid mount config for type "bind": field Source must not be empty`)28b7d94 to
1bafe67
Compare
Signed-off-by: Ethan Haynes <ethanhaynes@alumni.harvard.edu> fixed error by removing punctuation Signed-off-by: Ethan Haynes <ethanhaynes@alumni.harvard.edu> removed period Signed-off-by: Ethan Haynes <ethanhaynes@alumni.harvard.edu> backtick string to escape double quotes in error messages Signed-off-by: Ethan Haynes <ethanhaynes@alumni.harvard.edu> simplified test for bind no source error message Signed-off-by: Ethan Haynes <ethanhaynes@alumni.harvard.edu>
1bafe67 to
e76d8c9
Compare
dnephin
approved these changes
Feb 21, 2018
nobiit
pushed a commit
to nobidev/docker-cli
that referenced
this pull request
Nov 19, 2025
…-missing-error added check for empty source in bind mount Upstream-commit: cea4d37 Component: cli
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Provides a fix for #820
fixes #820
- What I did
Fixed the bug that allowed a user to use a bind mount without a source in the compose file. Without providing a source the loader would add the path of the compose file.
- How I did it
Added error handing and explicit check for empty source in compose file. The loader now throws an error if it detects a bind mount without a source.
- How to verify it
1: make a docker-compose.yml file
2: run stack deploy commands
The output should be the following error:
invalid mount config for type "bind": field Source must not be empty