Open SizZiKe opened 2 years ago
Thanks for the bug @SizZiKe. Someone from the team will take a look. Lets us know if you are interested in contributing and we can get a team member to help you!
I currently have a large amount of unstaged files. Whenever a pod restarts I have to restart skaffold. As of late that's not even working because skaffold detects that the image is available in docker's cache and therefore just starts an old container with none of my changes, so I have to ssh into minikube to purge the cache. Are there any workarounds? Can I force skaffold to sync all files?
@tejal29 I'm also experiencing the same issue. It would be nice if Skaffold triggers a resync of changed or created files after the pod restarts. I'm using a manual sync in my scenario, but I have the same symptoms. After pods are redeployed, I need to "update" all the files again to trigger a sync. In any case, a user would expect the files to remain in sync locally, similar to how the bind mount in docker-compose works. I'm happy to help with the implementation of this.
Same here, as @stefanhenseler mentioned, the only way I found to make it work is to re-update manually all of the files to trigger the sync again. I think this is crucial for anyone using the sync functionality.
Any news on this?
I use this as a workaround:
function sync_changed() {
pod_name=$(find_pod_by_app_name "my-app")
changed_files=$(git diff --name-only origin/master -- src/)
force_sync=<some files that need to be synced every time>
echo $changed_files $always_sync | xargs tar -cvf - | \
kubectl exec -i ${pod_name} -- bash -c "tar -xvf - -C /app/"
}
It does the trick but it is not perfect since it doesn't implement the same logic as skaffold
Expected behavior
Skaffold resyncs files after a breaking change causes a pod to redeploy
Actual behavior
Skaffold doesn't do anything - it will continue to sync files to the new pod when changes are made but previous changes are ignored. I understand the files are synced to the pod rather than the container, but this requires skaffold dev to be restarted if the pod ever crashes.
Information
Steps to reproduce the behavior