diff options
author | Nick Thomas <nick@gitlab.com> | 2017-04-24 19:31:28 +0300 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2017-04-24 19:36:52 +0300 |
commit | 829176ac76c1dc25373800824602261940fca121 (patch) | |
tree | abb862b0ab1466be47c28d51d65e43bc5a53dd69 /domains_test.go | |
parent | 9851a84c2af522d982ce4a1f1b6521503b11c512 (diff) |
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.
Diffstat (limited to 'domains_test.go')
-rw-r--r-- | domains_test.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/domains_test.go b/domains_test.go index 5a2882d6..6ce11f5f 100644 --- a/domains_test.go +++ b/domains_test.go @@ -40,6 +40,13 @@ func TestReadProjects(t *testing.T) { for _, actual := range domains { assert.Contains(t, expectedDomains, actual) } + + // Check that multiple domains in the same project are recorded faithfully + exp1 := &domainConfig{Domain: "test.domain.com"} + assert.Equal(t, exp1, d["test.domain.com"].Config) + + exp2 := &domainConfig{Domain: "other.domain.com", Certificate: "test", Key: "key"} + assert.Equal(t, exp2, d["other.domain.com"].Config) } func writeRandomTimestamp() { |