https://garden.io logo
#🌱|help-and-getting-started
Using `garden test` with a helm configmap
# 🌱|help-and-getting-started
f

famous-afternoon-28388

01/18/2023, 9:55 AM
I want to run simple unittests that use a configmap that's defined as a helm template I added this configuration to my garden helm module
Copy code
tests:
  - name: unit
    command: ["pytest", "tests"]
but the relevant file isn't on the pod. Is what I'm looking for possible, or do I need to find some workaround?
For context, this is the configmap template:
Copy code
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ .Release.Name }}-configmap
data:
  config.yaml: |
    {{ tpl (toYaml .Values.app) . | nindent 4 }}
I use helm templating, so I'm not sure if I'm able to do the same with Garden's configmap support
q

quaint-dress-831

01/23/2023, 2:01 PM
@famous-afternoon-28388 sorry for the delay: I've been on vacation and just returned to work today. You can see the templating capabilities we support at https://docs.garden.io/using-garden/variables-and-templating. We could perhaps be more explicit that our templating is not the same as Helm templating (we support our own implementation). All our helper functions are defined at https://docs.garden.io/reference/template-strings/functions. So you'd use our
yamlEncode
and
indent
helper functions to get your desired result.
f

famous-afternoon-28388

01/26/2023, 8:38 AM
Thanks, I'll give it a try 🙂
2 Views