Fix reading configuration for multiple custom domains
Without this patch, the different domains end up with pointers to the same domainsConfig struct, as go re-uses the same region of memory on each iteration of a for loop.
Rework of !26 (closed) with added tests.
Merge request reports
Activity
Thanks for !26 (closed) @jpap !
This MR is basically the same, but uses the explicit copy idiom rather than indexing, and introduces a test that will prevent regressions in the future.
@nick.thomas, the only thing this doesn't carry across is that my MR removed an extra copy of the domain configuration on each loop iteration; that copy is back in your new patch. I figured you're passing it by reference to
addDomain
, so why not do it all the way?Otherwise looks good and can't wait to see it in production! Unrelated, are you able to look at !25 (merged)?
Thanks. I think on balance I prefer to keep the extra copy. It's not a large cost and the behaviour is easier to reason about in the event of any weird modification bugs. I think this whole area is due some refactoring though. I'll merge this version and try to get it into a patch release ASAP.
I'll look at !25 (merged) soon, it's a feature I know quite a few people have been looking for, but bugs take priority
🎱 mentioned in commit 00ac1460
mentioned in merge request !26 (closed)