kubernetes #Resources definition now support secret kubeconfig
Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
This commit is contained in:
parent
7497b116ea
commit
1f5a9a9fa9
@ -65,7 +65,7 @@ import (
|
|||||||
version: dagger.#Input & {*"v1.19.9" | string}
|
version: dagger.#Input & {*"v1.19.9" | string}
|
||||||
|
|
||||||
// Kube config file
|
// Kube config file
|
||||||
kubeconfig: dagger.#Input & {string}
|
kubeconfig: dagger.#Input & {string | dagger.#Secret}
|
||||||
|
|
||||||
#code: #"""
|
#code: #"""
|
||||||
kubectl create namespace "$KUBE_NAMESPACE" > /dev/null 2>&1 || true
|
kubectl create namespace "$KUBE_NAMESPACE" > /dev/null 2>&1 || true
|
||||||
@ -89,11 +89,15 @@ import (
|
|||||||
dest: "/entrypoint.sh"
|
dest: "/entrypoint.sh"
|
||||||
content: #code
|
content: #code
|
||||||
},
|
},
|
||||||
op.#WriteFile & {
|
|
||||||
dest: "/kubeconfig"
|
if (kubeconfig & string) != _|_ {
|
||||||
content: kubeconfig
|
op.#WriteFile & {
|
||||||
mode: 0o600
|
dest: "/kubeconfig"
|
||||||
|
content: kubeconfig
|
||||||
|
mode: 0o600
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
if manifest != null {
|
if manifest != null {
|
||||||
op.#WriteFile & {
|
op.#WriteFile & {
|
||||||
dest: "/source"
|
dest: "/source"
|
||||||
@ -120,6 +124,9 @@ import (
|
|||||||
if manifest == null && source != null {
|
if manifest == null && source != null {
|
||||||
mount: "/source": from: source
|
mount: "/source": from: source
|
||||||
}
|
}
|
||||||
|
if (kubeconfig & dagger.#Secret) != _|_ {
|
||||||
|
mount: "/kubeconfig": secret: kubeconfig
|
||||||
|
}
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user