dockerfile: allow required flag to take value
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>docker-19.03
parent
4eb6eef150
commit
add2c8db8a
|
@ -29,7 +29,7 @@ func testSecretFileParams(t *testing.T, sb integration.Sandbox) {
|
|||
|
||||
dockerfile := []byte(`
|
||||
FROM busybox
|
||||
RUN --mount=type=secret,mode=741,uid=100,gid=102,target=/mysecret [ "$(stat -c "%u %g %f" /mysecret)" = "100 102 81e1" ]
|
||||
RUN --mount=type=secret,required=false,mode=741,uid=100,gid=102,target=/mysecret [ "$(stat -c "%u %g %f" /mysecret)" = "100 102 81e1" ]
|
||||
`)
|
||||
|
||||
dir, err := tmpdir(
|
||||
|
|
|
@ -176,6 +176,14 @@ func parseMount(value string) (*Mount, error) {
|
|||
}
|
||||
m.ReadOnly = !rw
|
||||
roAuto = false
|
||||
case "required":
|
||||
if m.Type == "secret" || m.Type == "ssh" {
|
||||
v, err := strconv.ParseBool(value)
|
||||
if err != nil {
|
||||
return nil, errors.Errorf("invalid value for %s: %s", key, value)
|
||||
}
|
||||
m.Required = v
|
||||
}
|
||||
case "id":
|
||||
m.CacheID = value
|
||||
case "sharing":
|
||||
|
|
Loading…
Reference in New Issue