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.
There were already attempts to remove duplicates in the past ... but the unique index doesn't work with
NULL
ports, which is used for when a default port is used (80 or 443) ... which is almost every pod. PostgreSQL >= 15 would now have an index that also handlesNULL
values correctly (withNULLS NOT DISTINCT
), but not all podmins have PostgreSQL 15 yet and there is also still MySQL which has the same problem.So I now use
-1
as value for when a default port is used, as this also works with unique indexes everywhere, and I didn't find a better solution that works with MySQL. We maybe can revert that back tonil
once we drop MySQL (or even drop PostgreSQL < 15). I thought about using the actual port (80/443), but then we have the problem that it a pod could exist with both of them, that's why I rejected this idea again.There were also duplicates because the hostname wasn't normalized to lowercase, so the same hostname with mixed case could exist multiple times, so I also fixed that as a drive-by.
If pods use a non-default port I also added the port in the overview, so two pods with different pods don't look like duplicates.