input to inputs
Signed-off-by: Richard Jones <richard@dagger.io>
This commit is contained in:
parent
3c0d9c5acc
commit
03a740ff1e
@ -59,7 +59,7 @@ func (p *Plan) Source() *compiler.Value {
|
||||
// registerLocalDirectories scans the context for local imports.
|
||||
// BuildKit requires to known the list of directories ahead of time.
|
||||
func (p *Plan) registerLocalDirs() error {
|
||||
imports, err := p.source.Lookup("input.directories").Fields()
|
||||
imports, err := p.source.Lookup("inputs.directories").Fields()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -3,7 +3,7 @@ package engine
|
||||
// A deployment plan executed by `dagger up`
|
||||
#Plan: {
|
||||
// Receive inputs from the client
|
||||
input: {
|
||||
inputs: {
|
||||
// Receive directories
|
||||
directories: [string]: _#inputDirectory
|
||||
// Securely receive secrets
|
||||
|
@ -7,7 +7,7 @@ package engine
|
||||
// A special kind of program which `dagger` can execute.
|
||||
#DAG: {
|
||||
// Receive inputs from the client
|
||||
input: {
|
||||
inputs: {
|
||||
// Receive directories
|
||||
directories: [name=string]: _#inputDirectory
|
||||
// Securely receive secrets
|
||||
@ -17,7 +17,7 @@ package engine
|
||||
}
|
||||
|
||||
// Send outputs to the client
|
||||
output: {
|
||||
outputs: {
|
||||
directories: [name=string]: _#outputDirectory
|
||||
}
|
||||
|
||||
|
@ -42,4 +42,11 @@ setup() {
|
||||
@test "plan/inputs/directories exists" {
|
||||
cd "$TESTDIR"
|
||||
"$DAGGER" --europa up ./plan/inputs/directories/exists.cue
|
||||
}
|
||||
|
||||
@test "plan/inputs/directories conflicting values" {
|
||||
cd "$TESTDIR"
|
||||
run "$DAGGER" --europa up ./plan/inputs/directories/conflicting_values.cue
|
||||
assert_failure
|
||||
assert_output --partial 'failed to up environment: actions.verify.contents: conflicting values "local directory" and "local dfsadf"'
|
||||
}
|
15
tests/plan/inputs/directories/conflicting_values.cue
Normal file
15
tests/plan/inputs/directories/conflicting_values.cue
Normal file
@ -0,0 +1,15 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"alpha.dagger.io/europa/dagger/engine"
|
||||
)
|
||||
|
||||
engine.#Plan & {
|
||||
inputs: directories: test: path: "./plan/inputs/directories"
|
||||
actions: verify: engine.#ReadFile & {
|
||||
input: inputs.directories.test.contents
|
||||
path: "test.txt"
|
||||
} & {
|
||||
contents: "local dfsadf" // should fail with conflicting values
|
||||
}
|
||||
}
|
@ -1,16 +1,15 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"alpha.dagger.io/europa/dagger"
|
||||
"alpha.dagger.io/europa/dagger/engine"
|
||||
)
|
||||
|
||||
dagger.#Plan & {
|
||||
input: directories: test: path: "./plan/inputs/directories"
|
||||
engine.#Plan & {
|
||||
inputs: directories: test: path: "./plan/inputs/directories"
|
||||
actions: verify: engine.#ReadFile & {
|
||||
input: input.directories.test.contents
|
||||
input: inputs.directories.test.contents
|
||||
path: "test.txt"
|
||||
} & {
|
||||
contents: "local directory\n"
|
||||
contents: "local directory"
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user