Merge pull request #1307 from aluzzardi/engine-loadsecret

engine.#NewSecret support
This commit is contained in:
Andrea Luzzardi
2022-01-10 12:09:21 -08:00
committed by GitHub
6 changed files with 127 additions and 1 deletions

View File

@@ -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
}

View 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"
"""#,
]
}
}
}