Description
When DoSync updates a service's image tag, it overwrites manual changes made to compose.yaml since DoSync started. This appears to be a caching issue where DoSync uses stale file content when modifying the compose file.
Steps to Reproduce
- Start DoSync with a compose.yaml that has 2 volume mounts for a service
- While DoSync is running, add a new volume mount to compose.yaml manually
- Verify the compose.yaml on disk has 3 volume mounts
- Wait for DoSync to detect a new image tag and update the container
- Check the container - it only has 2 volume mounts (the new one is missing)
- Check compose.yaml - the new volume mount line has been removed
Expected Behavior
DoSync should read the current compose.yaml content immediately before modifying the image tag, preserving any manual changes made to the file since DoSync started.
Actual Behavior
DoSync appears to cache the compose file content (possibly at startup or first read) and uses this cached version when updating the image tag. This overwrites any manual changes made to the file.
Environment
- DoSync version: v0.3.27
- Docker version: Latest
- OS: Ubuntu (DigitalOcean droplet)
Workaround
After making manual changes to compose.yaml, run a full restart to refresh DoSync's cache:
docker compose down && docker compose up -d
Suggested Fix
In the UpdateDockerComposeAndRestart function (or wherever the compose file is modified), always read the current file content from disk immediately before making modifications, rather than using any cached version.
Description
When DoSync updates a service's image tag, it overwrites manual changes made to compose.yaml since DoSync started. This appears to be a caching issue where DoSync uses stale file content when modifying the compose file.
Steps to Reproduce
Expected Behavior
DoSync should read the current compose.yaml content immediately before modifying the image tag, preserving any manual changes made to the file since DoSync started.
Actual Behavior
DoSync appears to cache the compose file content (possibly at startup or first read) and uses this cached version when updating the image tag. This overwrites any manual changes made to the file.
Environment
Workaround
After making manual changes to compose.yaml, run a full restart to refresh DoSync's cache:
docker compose down && docker compose up -dSuggested Fix
In the
UpdateDockerComposeAndRestartfunction (or wherever the compose file is modified), always read the current file content from disk immediately before making modifications, rather than using any cached version.