Skip to content
Snippets Groups Projects
Commit 00ac1460 authored by Nick Thomas's avatar Nick Thomas
Browse files

Merge branch 'fix-multiple-config' into 'master'

Fix reading configuration for multiple custom domains

See merge request !27
parents 9851a84c 829176ac
No related branches found
No related tags found
1 merge request!27Fix reading configuration for multiple custom domains
Pipeline #
Loading
Loading
@@ -44,8 +44,9 @@ func (d domains) readProjectConfig(rootDomain, group, project string) (err error
}
 
for _, domainConfig := range config.Domains {
config := domainConfig // domainConfig is reused for each loop iteration
if domainConfig.Valid(rootDomain) {
d.addDomain(rootDomain, group, project, &domainConfig)
d.addDomain(rootDomain, group, project, &config)
}
}
return
Loading
Loading
Loading
Loading
@@ -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() {
Loading
Loading
Loading
Loading
@@ -9,7 +9,7 @@
{
"Domain": "other.domain.com",
"Certificate": "test",
"Certificate": "key"
"Key": "key"
}
]
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment