#6562·tilt

Opt-in to `no-preserve` in Live Update

Author: rblaine95Created Jun 3, 2025Updated Sep 24, 2026
Labelsenhancement

Describe the Feature You Want

live_update is a fancy kubectl cp src dst. kubectl cp has a --no-preserve flag:

--no-preserve=false:
  The copied file/directory's ownership and permissions will not be preserved in the container

It would be nice to be able to opt in to skipping the chown part of the live update as, in some projects, it isn't necessary.

Current Behavior

Tilt live update tries to chown copied files even when it's not necessary, leading to an error in tilt even though everything is working perfectly fine:

Will copy 1 file(s) to container: [tails-server-b6b9f4569-qkcvk/tails-server]
- '/Users/robbie/didx/acapy-cloud/tails/main.py' --> '/tails/main.py'
tar: tails/main.py: Cannot change ownership to uid 0, gid 50: Operation not permitted
tar: Exiting with failure status due to previous errors
Build Failed: Updating pod tails-server-b6b9f4569-qkcvk: command terminated with exit code 2
This usually means the container filesystem denied access. Please check:
  1) That the container image has writable files
  2) That the container image default user has write access to the files
  3) That the Pod spec doesn't have a SecurityContext that would block writes
LiveUpdate "tails-server:localhost:5001_tails-server" UpdateFailed: Updating pod tails-server-b6b9f4569-qkcvk: command terminated with exit code 2
This usually means the container filesystem denied access. Please check:
  1) That the container image has writable files
  2) That the container image default user has write access to the files
  3) That the Pod spec doesn't have a SecurityContext that would block writes
2025-06-03 09:35:48,097 uvicorn.error WARNING StatReload detected changes in 'main.py'. Reloading... # <--- Even though chown failed, the reload successfully triggered
2025-06-03 09:35:48,160 uvicorn.access INFO 127.0.0.6:36809 - "GET /health/ready HTTP/1.1" 200 OK
2025-06-03 09:35:48,160 uvicorn.error INFO Shutting down
2025-06-03 09:35:48,262 uvicorn.error INFO Waiting for application shutdown.
2025-06-03 09:35:48,262 uvicorn.error INFO Application shutdown complete.
2025-06-03 09:35:48,263 uvicorn.error INFO Finished server process [17]
2025-06-03 09:35:48.810 | INFO     | tails.main:<module>:32 | Tails Service startup | 
2025-06-03 09:35:48,812 uvicorn.error INFO Started server process [35]
2025-06-03 09:35:48,812 uvicorn.error INFO Waiting for application startup.
2025-06-03 09:35:48,812 uvicorn.error INFO Application startup complete

Why Do You Want This?

We use Tilt for kubernetes native local development, the live update feature has sped things up greatly. Due to the attempt to chown files copied, Tilt reports an error which makes the developer think something is wrong. Triggering a second live update causes Tilt to restart the affected pod, slowing down development as the developer has to wait for it to start back up again.

Additional context In helm we are passing the following for local development:

yaml
podSecurityContext:
  fsGroup: 65534
securityContext:
  capabilities:
    drop:
    - ALL
  readOnlyRootFilesystem: false
  runAsNonRoot: false
  runAsUser: 0

Image

$ kubectl exec -ti tails-server-7b6859dff7-tsrc5 -- bash
root@tails-server-7b6859dff7-tsrc5:/tails# whoami
root
root@tails-server-7b6859dff7-tsrc5:/tails# id
uid=0(root) gid=0(root) groups=0(root),65534(nogroup)
root@tails-server-7b6859dff7-tsrc5:/tails# ls -la
total 280
drwxr-xr-x 1 root root   4096 Jun  3 11:57 .
drwxr-xr-x 1 root root   4096 Jun  3 11:57 ..
-rw-r--r-- 1 root root      0 May 30 11:53 __init__.py
drwxr-xr-x 2 root root   4096 Jun  3 11:57 __pycache__
-rw-r--r-- 1 root root   1483 Jun  3 11:38 main.py
-rw-r--r-- 1 root root 252288 Jun  2 12:40 poetry.lock
-rw-r--r-- 1 root root   2065 Jun  2 12:40 pyproject.toml
drwxr-xr-x 1 root root   4096 Jun  3 11:57 routers
drwxr-xr-x 2 root root   4096 Jun  3 11:33 tests
root@tails-server-7b6859dff7-tsrc5:/tails# echo test > test.txt
root@tails-server-7b6859dff7-tsrc5:/tails# cat test.txt
test
root@tails-server-7b6859dff7-tsrc5:/tails# echo foo >> main.py 
root@tails-server-7b6859dff7-tsrc5:/tails# tail -n 2 main.py
        return {"status": "unhealthy", "error": str(e)}
foo