Kubernetes doesn't recognise wildcard*

9/18/2019

I am trying to use wildcard on kubectl cp command however its failling to recognise wildcard.

$ kubectl cp mypod:/tmp/exampleFiles.* /tmp
tar: /tmp/exampleFiles.*: Cannot stat: No such file or directory
tar: Exiting with failure status due to previous errors

Although my Kubernetes is up to date (v1.15.2) and according to this git issue wildcard problem is fixed, but I am confused that why its not working for me. Is my syntax wrong? what do you think the problem is? please help!

-- Saber
kubernetes
linux

1 Answer

9/18/2019

From what I have researched this has not worked in any version of kubectl since wild card support was added.

kubectl cp --help has no examples or mentions about supporting wildcards either.

There are some examples showing the same problem past 1.14.0 when this was supposed be fixed/added.

Basing on all the info above Kubernetes does not support wildcards.

-- OhHiMark
Source: StackOverflow