I am trying to copy all the files from an image to a volume. However, kubernetes seems to not interpret the wildcard correctly. So, when I use the following, it fails with “not found”:
initContainers:
- name: init-container-name
image: <image path>
command:
- cp
- /foo/bar/*
- /output
How can I get Kubernetes to interpret the * correctly? Is there a way to copy the contents without the surrounding bar
folder?
I can copy the whole folder:
initContainers:
- name: init-container-name
image: <image path>
command:
- cp
- -r
- /foo/bar
- /output
But this results in an /output/bar
when I just want the files themselves in output. I’ve also tried - "/foo/bar/*"
and - "/foo/bar/"*
but that doesn’t work either.