Supposed I have the following condition in the template:
{{- if (lookup "apps/v1" "Deployment" "argocd" "argocd-server") }}
How can I mock this while testing a chart using helm-unittest tool?
Haven't used it myself for Helm unit testing but I think that's a good use-case for KUTTL they even have a dedicated documentation for Helm testing
I assume a TestSuite
would be rather short e.g. like the following where the commando
blocks just bring in all the required resources:
apiVersion: kuttl.dev/v1beta1
kind: TestSuite
commands:
- command: kubectl create namespace argocd
- command: kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
testDirs:
- ./test/integration
startKIND: true
kindNodeCache: true