kubernetes: kubectl cp can't copy filenames with ":" in them

What happened:

kubectl cp  admin/mysql-util-6d6fb9895c-9zmj5:/lark/data/food2019-01-02-22:34.sql.gz .
error: Filespec must match the canonical format: [[namespace/]pod:]file/path

What you expected to happen: Expected it to copy.

How to reproduce it (as minimally and precisely as possible): Try to kubectl cp anything with a colon in the filename

Anything else we need to know?: No.

Environment:

  • Kubernetes version (use kubectl version):
kubectl version
Client Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.1", GitCommit:"eec55b9ba98609a46fee712359c7b5b365bdd920", GitTreeState:"clean", BuildDate:"2018-12-13T10:39:04Z", GoVersion:"go1.11.2", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"

/kind bug

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 6
  • Comments: 19 (4 by maintainers)

Most upvoted comments

I am seeing this issue with with v1.21.3

Got it! make sure you filenames does not include :