Move random string generation to his own file to avoid replication in tests.
Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
This commit is contained in:
@@ -2,8 +2,6 @@ package helm
|
||||
|
||||
import (
|
||||
"dagger.io/dagger"
|
||||
"dagger.io/dagger/op"
|
||||
"dagger.io/alpine"
|
||||
"dagger.io/file"
|
||||
"dagger.io/kubernetes/helm"
|
||||
)
|
||||
@@ -18,20 +16,6 @@ config: file.#Read & {
|
||||
from: kubeconfig
|
||||
}
|
||||
|
||||
// Generate random string
|
||||
random: {
|
||||
string
|
||||
#up: [
|
||||
op.#Load & {from: alpine.#Image},
|
||||
op.#Exec & {
|
||||
args: ["sh", "-c", "cat /dev/urandom | tr -dc 'a-z' | fold -w 10 | head -n 1 | tr -d '\n' > /rand"]
|
||||
},
|
||||
op.#Export & {
|
||||
source: "/rand"
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
// Deploy user local chart
|
||||
TestHelmSimpleChart: {
|
||||
// Deploy chart
|
||||
|
20
tests/stdlib/kubernetes/helm/random.cue
Normal file
20
tests/stdlib/kubernetes/helm/random.cue
Normal file
@@ -0,0 +1,20 @@
|
||||
package helm
|
||||
|
||||
import (
|
||||
"dagger.io/alpine"
|
||||
"dagger.io/dagger/op"
|
||||
)
|
||||
|
||||
// Generate a random number
|
||||
random: {
|
||||
string
|
||||
#up: [
|
||||
op.#Load & {from: alpine.#Image},
|
||||
op.#Exec & {
|
||||
args: ["sh", "-c", "cat /dev/urandom | tr -dc 'a-z' | fold -w 10 | head -n 1 | tr -d '\n' > /rand"]
|
||||
},
|
||||
op.#Export & {
|
||||
source: "/rand"
|
||||
},
|
||||
]
|
||||
}
|
Reference in New Issue
Block a user