Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kubectl cp command over writes the running process executable without warning #78892

VinodKumarGoku opened this issue Jun 11, 2019 · 2 comments


None yet
3 participants
Copy link

commented Jun 11, 2019

What happened: While performing kubectl cp of an executable from host to a container in pod. It copied successfully and modified all the permission of the existing file. The running process crashed.

What you expected to happen: kubectl cp should not perform direct copy of running executable files in usage from some other process. Instead it should report error for the same.

How to reproduce it (as minimally and precisely as possible):

  1. Run an instance of a program i.e run a process in a container in a kubernetes pod. While the proocess is still running. Perform a kubectl cp of the executable from the host to the conatiner.
  2. Check whether the process is still running.

Anything else we need to know?: usually cp command reports error when a copy is performed on a running executable file. It prevents direct copy.


  • Kubernetes version (use kubectl version): 1.12
  • Cloud provider or hardware configuration:
  • OS (e.g: cat /etc/os-release): rhel 7.2
  • Kernel (e.g. uname -a): Linux 5.0.2-1.el7.elrepo.x86_64
  • Install tools: kubernetes cluster
  • Network plugin and version (if this is a network-related bug):
  • Others:

This comment has been minimized.

Copy link

commented Jun 11, 2019

@VinodKumarGoku: There are no sig labels on this issue. Please add a sig label by either:

  1. mentioning a sig: @kubernetes/sig-<group-name>-<group-suffix>
    e.g., @kubernetes/sig-contributor-experience-<group-suffix> to notify the contributor experience sig, OR

  2. specifying the label manually: /sig <group-name>
    e.g., /sig scalability to apply the sig/scalability label

Note: Method 1 will trigger an email to the group. See the group list.
The <group-suffix> in method 1 has to be replaced with one of these: bugs, feature-requests, pr-reviews, test-failures, proposals.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.


This comment has been minimized.

Copy link

commented Jun 12, 2019

kubectl cp uses tar under the covers. I would be surprised if tar detected/handled that scenario the way you are requesting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.