Skip to content

Commit 8a254a7

Browse files
committed
Adds a test that checks to ensure that empty arg is passed to env
Signed-off-by: Talon Bowler <[email protected]>
1 parent 2ec1338 commit 8a254a7

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

frontend/dockerfile/dockerfile_lint_test.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -786,6 +786,20 @@ ENV PATH=$PAHT:/tmp/bin
786786
},
787787
},
788788
})
789+
790+
dockerfile = []byte(`
791+
FROM alpine
792+
ARG FOO
793+
ARG BAR=
794+
RUN env | grep 'BAR='
795+
RUN env | grep 'FOO='
796+
`)
797+
checkLinterWarnings(t, sb, &lintTestParams{
798+
Dockerfile: dockerfile,
799+
StreamBuildErr: `failed to solve: process "/bin/sh -c env | grep 'FOO='" did not complete successfully: exit code: 1`,
800+
UnmarshalBuildErr: `process "/bin/sh -c env | grep 'FOO='" did not complete successfully: exit code: 1`,
801+
BuildErrLocation: 6,
802+
})
789803
}
790804

791805
func testMultipleInstructionsDisallowed(t *testing.T, sb integration.Sandbox) {

0 commit comments

Comments
 (0)