it happens when copy directory to pod and the directory path ends with '/'. for example: kubectl cp /XX/XX/ XX-POD:/XX/XX modified: pkg/kubectl/cmd/cp.go modified: pkg/kubectl/cmd/cp_test.go