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

[19.03 backport] fix panic on single-character volumes #2471

Merged

Commits on Apr 28, 2020

  1. fix panic on single-character volumes

    Before this change, this would cause a panic:
    
        docker run -it --rm -v 1:/1 alpine
        panic: runtime error: index out of range
    
        goroutine 1 [running]:
        github.com/docker/cli/cli/compose/loader.isFilePath(0xc42027e058, 0x1, 0x557dcb978c20)
        ...
    
    After this change, a correct error is returned:
    
        docker run -it --rm -v 1:/1 alpine
        docker: Error response from daemon: create 1: volume name is too short, names should be at least two alphanumeric characters.
    
    Signed-off-by: Sebastiaan van Stijn <[email protected]>
    (cherry picked from commit 11869fa)
    Signed-off-by: Sebastiaan van Stijn <[email protected]>
    thaJeztah committed Apr 28, 2020
    Configuration menu
    Copy the full SHA
    4ad65fc View commit details
    Browse the repository at this point in the history