With a kubernetes-pod test action, how can I mount...
# 🤖|ask-kapa
g
@microscopic-river-74022 With a kubernetes-pod test action, how can I mount in local files required by the tests?
m
Please stand by @glamorous-kangaroo-20427 as I search the knowledge base. I normally take about 15 seconds or so. :wave:
---------------------- To mount local files required by tests in a kubernetes-pod test action, you have a couple of options: 1. Using `spec.files`: You can use the
spec.files
field to specify POSIX-style paths to YAML files containing manifests for your test pod. These files can include Garden template strings, which will be resolved before the manifests are processed. This allows you to include local files in your test pod configuration.
Copy code
yaml
   spec:
     files:
       - path/to/your/test-manifest.yaml
Reference: kubernetes-pod Test Configuration () 2. Using
spec.volumes
with `hostPath`: Although it's generally discouraged due to potential compatibility issues across platforms and providers, you can use
hostPath
to mount local directories or files into your test container.
Copy code
yaml
   spec:
     volumes:
       - hostPath: "/path/to/local/files"
Reference: container Test Configuration () It's important to note that using
hostPath
is not recommended for portability reasons. Some providers may not support it at all. For a more reliable and recommended approach to handling data in tests, consider using Garden's artifact system or persistent volume claims. You can generate files via a Run action, store them as artifacts, and then access them in your tests. Alternatively, you can use the
persistentvolumeclaim
action type to store and share data across actions. FAQ: Volumes and Data () ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
message has been deleted
5 Views