Skip to content

Commit 98f2597

Browse files
committed
More comments in generic.bats, config.go should warn about additional config
1 parent b23b3db commit 98f2597

2 files changed

Lines changed: 21 additions & 6 deletions

File tree

docs/tests/generic.bats

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ EOF
5050
assert_output "FULLURL https://${PROJNAME}.ddev.site"
5151
assert_success
5252

53-
echo "#" >&3
54-
run docker exec ddev-router curl -sI http://ddev-my-generic-site-web:8000
55-
echo "# === curl from inside router (php-server) ===" >&3
56-
printf '%s\n' "$output" | sed 's/^/# /' >&3
57-
assert_line --partial "200 OK"
53+
#echo "#" >&3
54+
# run docker exec ddev-router curl -sI http://ddev-my-generic-site-web:8000
55+
# echo "# === curl from inside router (php-server) ===" >&3
56+
# printf '%s\n' "$output" | sed 's/^/# /' >&3
57+
# assert_line --partial "200 OK"
5858

59-
echo "#" >&3
59+
# echo "#" >&3
6060
# Diagnostic: show traefik config files in volume
6161
# run docker exec ddev-router ls -la /mnt/ddev-global-cache/traefik/config/
6262
# echo "# === Traefik config files (router volume) ===" >&3

pkg/ddevapp/config.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,21 @@ func (app *DdevApp) CheckCustomConfig() {
741741
util.Warning("Using custom Traefik configuration (use `docker logs ddev-router` for troubleshooting): %v", mainProjectTraefikFile)
742742
customConfig = true
743743
}
744+
traefikProjectConfigPath := app.GetConfigPath("traefik/config")
745+
if _, err := os.Stat(traefikProjectConfigPath); err == nil {
746+
traefikFiles, err := filepath.Glob(filepath.Join(traefikProjectConfigPath, "*.yaml"))
747+
util.CheckErr(err)
748+
// Remove the main project traefik file from the list
749+
traefikFiles = slices.DeleteFunc(traefikFiles, func(f string) bool {
750+
return filepath.Base(f) == app.Name+".yaml"
751+
})
752+
extraTraefikFiles := filterCustomConfigFiles(traefikFiles)
753+
// Warn if there are extra config files in project .ddev/traefik/config
754+
if len(extraTraefikFiles) > 0 {
755+
printableFiles, _ := util.ArrayToReadableOutput(extraTraefikFiles)
756+
util.Warning("Extra project traefik config files found in .ddev/traefik/config: %v", printableFiles)
757+
}
758+
}
744759

745760
nginxFullConfigPath := app.GetConfigPath("nginx_full/nginx-site.conf")
746761
if isCustomConfigFile(nginxFullConfigPath) && app.WebserverType == nodeps.WebserverNginxFPM {

0 commit comments

Comments
 (0)