Merge pull request #1307 from aluzzardi/engine-loadsecret
engine.#NewSecret support
This commit is contained in:
@@ -127,3 +127,9 @@ setup() {
|
||||
run "$DAGGER" --europa up ./tasks/httpfetch/not_exist.cue
|
||||
assert_failure
|
||||
}
|
||||
|
||||
@test "task: #NewSecret" {
|
||||
cd "$TESTDIR"/tasks/newsecret
|
||||
|
||||
"$DAGGER" --europa up ./newsecret.cue
|
||||
}
|
||||
|
37
tests/tasks/newsecret/newsecret.cue
Normal file
37
tests/tasks/newsecret/newsecret.cue
Normal file
@@ -0,0 +1,37 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"alpha.dagger.io/europa/dagger/engine"
|
||||
)
|
||||
|
||||
engine.#Plan & {
|
||||
actions: {
|
||||
image: engine.#Pull & {
|
||||
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
||||
}
|
||||
|
||||
generate: engine.#Exec & {
|
||||
input: image.output
|
||||
args: ["sh", "-c", "echo test > /secret"]
|
||||
}
|
||||
|
||||
load: engine.#NewSecret & {
|
||||
input: generate.output
|
||||
path: "/secret"
|
||||
}
|
||||
|
||||
verify: engine.#Exec & {
|
||||
input: image.output
|
||||
mounts: secret: {
|
||||
dest: "/run/secrets/test"
|
||||
contents: load.output
|
||||
}
|
||||
args: [
|
||||
"sh", "-c",
|
||||
#"""
|
||||
test "$(cat /run/secrets/test)" = "test"
|
||||
"""#,
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user