From e59ba48ec07d0fae4c533f83ff131073a36cfe57 Mon Sep 17 00:00:00 2001 From: Richard Jones Date: Thu, 13 Jan 2022 11:57:47 -0700 Subject: [PATCH] added dockerfile: field back to force evaluation of disjunction Signed-off-by: Richard Jones --- pkg/dagger.io/dagger/engine/image.cue | 2 +- plan/task/dockerfile.go | 4 ++-- tests/tasks/dockerfile/build_args.cue | 2 +- tests/tasks/dockerfile/dockerfile.cue | 1 + tests/tasks/dockerfile/dockerfile_path.cue | 2 +- tests/tasks/dockerfile/image_config.cue | 2 +- tests/tasks/dockerfile/inlined_dockerfile.cue | 2 +- tests/tasks/dockerfile/labels.cue | 2 +- tests/tasks/dockerfile/platform.cue | 2 +- 9 files changed, 10 insertions(+), 9 deletions(-) diff --git a/pkg/dagger.io/dagger/engine/image.cue b/pkg/dagger.io/dagger/engine/image.cue index 7d2c3a62..39e2fbb0 100644 --- a/pkg/dagger.io/dagger/engine/image.cue +++ b/pkg/dagger.io/dagger/engine/image.cue @@ -75,7 +75,7 @@ package engine // Source directory to build source: #FS - *{ + dockerfile: *{ path: string | *"Dockerfile" } | { contents: string diff --git a/plan/task/dockerfile.go b/plan/task/dockerfile.go index dae8d9a7..c9c4e5d0 100644 --- a/plan/task/dockerfile.go +++ b/plan/task/dockerfile.go @@ -60,7 +60,7 @@ func (t *dockerfileTask) Run(ctx context.Context, pctx *plancontext.Context, s s dockerfileDef := contextDef // Support inlined dockerfile - if dockerfile := v.Lookup("contents"); dockerfile.Exists() { + if dockerfile := v.Lookup("dockerfile.contents"); dockerfile.Exists() { contents, err := dockerfile.String() if err != nil { return nil, err @@ -133,7 +133,7 @@ func (t *dockerfileTask) Run(ctx context.Context, pctx *plancontext.Context, s s func (t *dockerfileTask) dockerBuildOpts(v *compiler.Value, pctx *plancontext.Context) (map[string]string, error) { opts := map[string]string{} - if dockerfilePath := v.Lookup("path"); dockerfilePath.Exists() { + if dockerfilePath := v.Lookup("dockerfile.path"); dockerfilePath.Exists() { filename, err := dockerfilePath.String() if err != nil { return nil, err diff --git a/tests/tasks/dockerfile/build_args.cue b/tests/tasks/dockerfile/build_args.cue index d99542b3..7a0fa1df 100644 --- a/tests/tasks/dockerfile/build_args.cue +++ b/tests/tasks/dockerfile/build_args.cue @@ -9,7 +9,7 @@ engine.#Plan & { actions: build: engine.#Dockerfile & { source: inputs.directories.testdata.contents - contents: """ + dockerfile: contents: """ FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d ARG TEST=foo RUN test "${TEST}" = "bar" diff --git a/tests/tasks/dockerfile/dockerfile.cue b/tests/tasks/dockerfile/dockerfile.cue index cdaa6cf9..576c4745 100644 --- a/tests/tasks/dockerfile/dockerfile.cue +++ b/tests/tasks/dockerfile/dockerfile.cue @@ -10,6 +10,7 @@ engine.#Plan & { actions: { build: engine.#Dockerfile & { source: inputs.directories.testdata.contents + // path: "Dockerfile" } verify: engine.#Exec & { diff --git a/tests/tasks/dockerfile/dockerfile_path.cue b/tests/tasks/dockerfile/dockerfile_path.cue index 42a121dc..c15a12fc 100644 --- a/tests/tasks/dockerfile/dockerfile_path.cue +++ b/tests/tasks/dockerfile/dockerfile_path.cue @@ -10,7 +10,7 @@ engine.#Plan & { actions: { build: engine.#Dockerfile & { source: inputs.directories.testdata.contents - path: "./dockerfilepath/Dockerfile.custom" + dockerfile: path: "./dockerfilepath/Dockerfile.custom" } verify: engine.#Exec & { diff --git a/tests/tasks/dockerfile/image_config.cue b/tests/tasks/dockerfile/image_config.cue index 668c0cca..a9d399ad 100644 --- a/tests/tasks/dockerfile/image_config.cue +++ b/tests/tasks/dockerfile/image_config.cue @@ -11,7 +11,7 @@ engine.#Plan & { // FIXME: this doesn't test anything beside not crashing build: engine.#Dockerfile & { source: inputs.directories.testdata.contents - contents: """ + dockerfile: contents: """ FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d ENV test foobar CMD /test-cmd diff --git a/tests/tasks/dockerfile/inlined_dockerfile.cue b/tests/tasks/dockerfile/inlined_dockerfile.cue index 0dab63d2..c14771fc 100644 --- a/tests/tasks/dockerfile/inlined_dockerfile.cue +++ b/tests/tasks/dockerfile/inlined_dockerfile.cue @@ -10,7 +10,7 @@ engine.#Plan & { actions: { build: engine.#Dockerfile & { source: inputs.directories.testdata.contents - contents: """ + dockerfile: contents: """ FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d RUN echo foobar > /output """ diff --git a/tests/tasks/dockerfile/labels.cue b/tests/tasks/dockerfile/labels.cue index dd3f921a..403314f9 100644 --- a/tests/tasks/dockerfile/labels.cue +++ b/tests/tasks/dockerfile/labels.cue @@ -11,7 +11,7 @@ engine.#Plan & { // FIXME: this doesn't test anything beside not crashing build: engine.#Dockerfile & { source: inputs.directories.testdata.contents - contents: """ + dockerfile: contents: """ FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d """ label: FOO: "bar" diff --git a/tests/tasks/dockerfile/platform.cue b/tests/tasks/dockerfile/platform.cue index 0fed8a60..eeddcb38 100644 --- a/tests/tasks/dockerfile/platform.cue +++ b/tests/tasks/dockerfile/platform.cue @@ -11,7 +11,7 @@ engine.#Plan & { // FIXME: this doesn't test anything beside not crashing build: engine.#Dockerfile & { source: inputs.directories.testdata.contents - contents: """ + dockerfile: contents: """ FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d """ platforms: ["linux/amd64"]