This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
dagger/stdlib/.dagger/env/os-container/plan/main.cue
Solomon Hykes aa6335246b os.#Container: mount secrets with a more consistent API
Signed-off-by: Solomon Hykes <solomon@dagger.io>
2021-06-23 13:35:15 +02:00

28 lines
552 B
CUE

package main
import (
"dagger.io/dagger"
"dagger.io/os"
)
// Test secret mount
SimpleSecret: {
// 'encrypted' and 'cleartext' must be set from identical values
encrypted: dagger.#Secret @dagger(input)
cleartext: string @dagger(input)
ctr: os.#Container & {
secret: "/secret-in": encrypted
command: "cat /secret-in > /secret-out"
}
// Decrypted secret
decrypted: (os.#File & {
from: ctr
path: "/secret-out"
}).contents @dagger(output)
// Assertion: decrypted value must match original cleartext
decrypted: cleartext
}