devspace sync uploads unmodified files #1177
Labels
area/sync
Issues related to the real-time code synchronization
kind/enhancement
Enhancement of an existing feature / improvement
What happened?
When running
devspace dev
, it starts a container, and immediatly restarts it because the sync process thinks some files have changed and need to be uploaded, even tho the docker image was just built.The reason seems to be that the file modification time in the docker image differs from the time on the local file system: this is possible, because docker build layer caching actually checks the content of the files: if only the timestamp changed, docker build will just use the cached layer, and that cached layer obviously has the old modification time. Devspace sync then sees the different modification time, and decides to upload the unmodified file anyway.
What did you expect to happen instead?
I expect a freshly built container with the proper
excludePaths
defined indevspace.yaml
to not require an immediate restart when there have been no actual changes to any files.I expect the sync process to actually check if a file's content has changed before uploading it, and not just look at the file modification time, in the same way that eg. git or the Docker layer caching do this.
How can we reproduce the bug? (as minimally and precisely as possible)
https://github.com/ComaVN/devspace-sync-poc
Local Environment:
Kubernetes Cluster:
Anything else we need to know?
The main reason this is problematic for us, is because we're re-compiling our golang code (using delve) every time the container (re)starts.
/kind bug
The text was updated successfully, but these errors were encountered: