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.
|
// registerLocalDirectories scans the context for local imports.
|
||||||
// BuildKit requires to known the list of directories ahead of time.
|
// BuildKit requires to known the list of directories ahead of time.
|
||||||
func (p *Plan) registerLocalDirs() error {
|
func (p *Plan) registerLocalDirs() error {
|
||||||
imports, err := p.source.Lookup("input.directories").Fields()
|
imports, err := p.source.Lookup("inputs.directories").Fields()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@ package engine
|
|||||||
// A deployment plan executed by `dagger up`
|
// A deployment plan executed by `dagger up`
|
||||||
#Plan: {
|
#Plan: {
|
||||||
// Receive inputs from the client
|
// Receive inputs from the client
|
||||||
input: {
|
inputs: {
|
||||||
// Receive directories
|
// Receive directories
|
||||||
directories: [string]: _#inputDirectory
|
directories: [string]: _#inputDirectory
|
||||||
// Securely receive secrets
|
// Securely receive secrets
|
||||||
|
@ -7,7 +7,7 @@ package engine
|
|||||||
// A special kind of program which `dagger` can execute.
|
// A special kind of program which `dagger` can execute.
|
||||||
#DAG: {
|
#DAG: {
|
||||||
// Receive inputs from the client
|
// Receive inputs from the client
|
||||||
input: {
|
inputs: {
|
||||||
// Receive directories
|
// Receive directories
|
||||||
directories: [name=string]: _#inputDirectory
|
directories: [name=string]: _#inputDirectory
|
||||||
// Securely receive secrets
|
// Securely receive secrets
|
||||||
@ -17,7 +17,7 @@ package engine
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Send outputs to the client
|
// Send outputs to the client
|
||||||
output: {
|
outputs: {
|
||||||
directories: [name=string]: _#outputDirectory
|
directories: [name=string]: _#outputDirectory
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,3 +43,10 @@ setup() {
|
|||||||
cd "$TESTDIR"
|
cd "$TESTDIR"
|
||||||
"$DAGGER" --europa up ./plan/inputs/directories/exists.cue
|
"$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
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"alpha.dagger.io/europa/dagger"
|
|
||||||
"alpha.dagger.io/europa/dagger/engine"
|
"alpha.dagger.io/europa/dagger/engine"
|
||||||
)
|
)
|
||||||
|
|
||||||
dagger.#Plan & {
|
engine.#Plan & {
|
||||||
input: directories: test: path: "./plan/inputs/directories"
|
inputs: directories: test: path: "./plan/inputs/directories"
|
||||||
actions: verify: engine.#ReadFile & {
|
actions: verify: engine.#ReadFile & {
|
||||||
input: input.directories.test.contents
|
input: inputs.directories.test.contents
|
||||||
path: "test.txt"
|
path: "test.txt"
|
||||||
} & {
|
} & {
|
||||||
contents: "local directory\n"
|
contents: "local directory"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user