Fix conflicting hostname problem by making list unique, fixes #789 #825
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 Problem/Issue/Bug:
OP #789: Since we introduced the additional_hostnames feature, there have been a few reports of people accidentally introducing conflicting hostnames. The most common is probably where the project name is "myname", adding "myname" again in the additional_hostnames. This causes the ddev-router to freak out and fail to preprocess its nginx configs.
How this PR Solves The Problem:
Make sure that the list of hostnames provided to docker-compose.yaml (and thus to ddev-router) is unique.
This PR does not solve the problem of multiple projects competing for one hostname.
Manual Testing Instructions:
For a project named "junk", add "junk" in additional_hostnames config. When you
ddev start
things should work. This should go down in flames in earlier versions of ddev.Automated Testing Overview:
This adds the broken case to TestDdevStartMultipleHostnames(), so a regression should be caught there.
Related Issue Link(s):
OP #789
Related: Make ddev-router more transparent about failures: #774