Update helm and kubernetes tests to use new dagger.#Secret definition

Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
This commit is contained in:
Tom Chauveau
2021-06-03 16:28:03 +02:00
parent ce65a65ede
commit 2c6e67cb7d
7 changed files with 42 additions and 54 deletions

View File

@@ -14,7 +14,7 @@ import (
name: string @dagger(input)
// Helm chart to install from source
chartSource: dagger.#Artifact @dagger(input)
chartSource?: dagger.#Artifact @dagger(input)
// Helm chart to install from repository
chart?: string @dagger(input)
@@ -84,11 +84,6 @@ import (
dest: "/entrypoint.sh"
content: #code
},
op.#WriteFile & {
dest: "/kubeconfig"
content: kubeconfig
mode: 0o600
},
if chart != _|_ {
op.#WriteFile & {
dest: "/helm/chart"
@@ -126,6 +121,7 @@ import (
if chartSource != _|_ && chart == _|_ {
"/helm/chart": from: chartSource
}
"/kubeconfig": secret: kubeconfig
}
},
]

View File

@@ -59,8 +59,7 @@ import (
version: *"v1.19.9" | string @dagger(input)
// Kube config file
// FIXME: should be `dagger.#Secret`
kubeconfig: string @dagger(input)
kubeconfig: dagger.#Secret @dagger(input)
#code: #"""
kubectl create namespace "$KUBE_NAMESPACE" > /dev/null 2>&1 || true
@@ -75,11 +74,7 @@ import (
dest: "/entrypoint.sh"
content: #code
},
op.#WriteFile & {
dest: "/kubeconfig"
content: kubeconfig
mode: 0o600
},
if manifest != _|_ {
op.#WriteFile & {
dest: "/source"
@@ -103,6 +98,7 @@ import (
if manifest == _|_ {
mount: "/source": from: source
}
mount: "/kubeconfig": secret: kubeconfig
},
]
}