Revert kubernetes/helm packages and tests from secret to str type, needed for docs

Signed-off-by: Guillaume de Rouville <guillaume.derouville@gmail.com>
This commit is contained in:
Guillaume de Rouville
2021-06-17 03:06:39 +02:00
parent f8d8a68a5e
commit ce41d25c52
9 changed files with 30 additions and 15 deletions

View File

@@ -18,7 +18,7 @@ setup() {
"$DAGGER" init
dagger_new_with_plan kubernetes "$TESTDIR"/stdlib/kubernetes/
run "$DAGGER" input -e "kubernetes" secret kubeconfig -f ~/.kube/config
run "$DAGGER" input -e "kubernetes" text kubeconfig -f ~/.kube/config
assert_success
run "$DAGGER" up -e "kubernetes"
@@ -40,7 +40,7 @@ setup() {
"$DAGGER" init
dagger_new_with_plan helm "$TESTDIR"/stdlib/kubernetes/helm
run "$DAGGER" input -e "helm" secret kubeconfig -f ~/.kube/config
run "$DAGGER" input -e "helm" text kubeconfig -f ~/.kube/config
assert_success
cp -R "$TESTDIR"/stdlib/kubernetes/helm/testdata/mychart "$DAGGER_WORKSPACE"/testdata

View File

@@ -8,7 +8,7 @@ import (
// We assume that a kinD cluster is running locally
// To deploy a local KinD cluster, follow this link : https://kind.sigs.k8s.io/docs/user/quick-start/
kubeconfig: dagger.#Secret @dagger(input)
kubeconfig: string @dagger(input)
// Deploy user local chart
TestHelmSimpleChart: {

View File

@@ -26,6 +26,12 @@ import (
content: #getHelmPods
},
op.#WriteFile & {
dest: "/kubeconfig"
content: kubeconfig
mode: 0o600
},
op.#Exec & {
always: true
args: [
@@ -40,7 +46,6 @@ import (
KUBECONFIG: "/kubeconfig"
KUBE_NAMESPACE: namespace
}
mount: "/kubeconfig": secret: kubeconfig
},
]
}

View File

@@ -2,14 +2,13 @@ package main
import (
"encoding/yaml"
"dagger.io/dagger"
"dagger.io/kubernetes"
"dagger.io/random"
)
// We assume that a kinD cluster is running locally
// To deploy a local KinD cluster, follow this link : https://kind.sigs.k8s.io/docs/user/quick-start/
kubeconfig: dagger.#Secret @dagger(input)
kubeconfig: string @dagger(input)
TestKubeApply: {
suffix: random.#String & {

View File

@@ -27,6 +27,12 @@ import (
from: kubernetes.#Kubectl
},
op.#WriteFile & {
dest: "/kubeconfig"
content: kubeconfig
mode: 0o600
},
op.#WriteFile & {
dest: "/getPods.sh"
content: #GetPods
@@ -47,7 +53,6 @@ import (
KUBECONFIG: "/kubeconfig"
KUBE_NAMESPACE: namespace
}
mount: "/kubeconfig": secret: kubeconfig
},
op.#WriteFile & {
@@ -69,7 +74,6 @@ import (
KUBECONFIG: "/kubeconfig"
KUBE_NAMESPACE: namespace
}
mount: "/kubeconfig": secret: kubeconfig
},
]
}