fix(traefik): Attempt to fix possible fsnotify problems with traefik and config#8116
Merged
Conversation
|
Download the artifacts for this pull request:
See Testing a PR. |
…y issues Instead of using a temporary container to copy Traefik configuration files into a Docker volume (which the router container watches), copy files directly to the running router container using CopyIntoContainer. This solves fsnotify propagation issues where Traefik doesn't reliably detect configuration changes written by a different container, particularly on Rancher Desktop and sometimes Docker Desktop. By copying directly to the router, file changes happen inside the container that's watching, ensuring Traefik's fsnotify reliably detects the changes. Benefits: - Fixes intermittent test failures on Rancher Desktop - More reliable across all Docker providers - Faster (no temporary container creation/destruction) - Simpler (no need for marker files, sleep delays, or API polling) Falls back to the volume copy approach if the router isn't running yet. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…ts are used When port conflicts occur (common on Lima-based Docker providers like Rancher Desktop, Colima), DDEV allocates ephemeral ports instead of standard 80/443. This test assumes standard ports when modifying Traefik configuration, so it should skip when non-standard ports are detected. The test now checks the actual router ports after starting the app and skips if they're not 80/443, avoiding failures when port conflicts force ephemeral port allocation. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
stasadev
approved these changes
Feb 9, 2026
stasadev
left a comment
Member
There was a problem hiding this comment.
Looks good to me, I tested it with Podman locally (because it's sensitive to UID permissions).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Issue
Since DDEV v1.25.0, Traefik configuration changes were not reliably detected on Rancher Desktop and occasionally on other Docker providers, causing intermittent test failures. The root may have been cross-container fsnotify propagation issues: when a temporary container copied files into a Docker volume that the router container was watching, Traefik's fsnotify would not reliably detect the changes.
How This PR Solves The Issue
1. Direct Copy to Router Container
Instead of using a temporary container to copy Traefik configuration files into a Docker volume, this PR copies files directly to the running router container using
CopyIntoContainer(). This ensures file changes happen inside the container that's watching, making Traefik's fsnotify reliably detect the changes.2. Test Improvements
Enhanced
TestCustomProjectTraefikConfigto handle port conflict situation, as in https://buildkite.com/ddev/macos-rancher-desktop/builds/2220#019c35c7-6a58-4806-87ee-7811d76558bf/L12162PowerOff()before test to ensure clean port state4. Test Renaming
Renamed test from
TestCustomProjectConfigtoTestCustomProjectTraefikConfigfor clarity.Automated Testing Overview
Modified Tests:
TestCustomProjectTraefikConfig- Now handles port conflicts gracefully with PowerOff() and port detection