mirror of
https://github.com/docker/docs.git
synced 2026-03-30 07:48:52 +07:00
Merge pull request #10108 from tiborvass/carry-9989
[Carry] Fix a panic where RUN [] would be supplied
This commit is contained in:
@@ -22,6 +22,25 @@ import (
|
||||
"github.com/docker/docker/pkg/archive"
|
||||
)
|
||||
|
||||
func TestBuildJSONEmptyRun(t *testing.T) {
|
||||
name := "testbuildjsonemptyrun"
|
||||
defer deleteImages(name)
|
||||
|
||||
_, err := buildImage(
|
||||
name,
|
||||
`
|
||||
FROM busybox
|
||||
RUN []
|
||||
`,
|
||||
true)
|
||||
|
||||
if err != nil {
|
||||
t.Fatal("error when dealing with a RUN statement with empty JSON array")
|
||||
}
|
||||
|
||||
logDone("build - RUN with an empty array should not panic")
|
||||
}
|
||||
|
||||
func TestBuildEmptyWhitespace(t *testing.T) {
|
||||
name := "testbuildemptywhitespace"
|
||||
defer deleteImages(name)
|
||||
|
||||
Reference in New Issue
Block a user