Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions internal/workshop/lxd/lxd_backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ func (s *Backend) Workshop(ctx context.Context, name string) (*workshop.Workshop
cnames, _ = unmarshalDnsmasq(network.Config["raw.dnsmasq"])
}
if cnames == nil {
// Tell loadWorkshop to add the hostname-not-found note.
// Tell loadWorkshop to add the hostname-missing note.
cnames = []cname{}
}

Expand Down Expand Up @@ -959,7 +959,7 @@ func (s *Backend) hostname(name string, p workshop.Project, format sdk.Revision,
hostname.Domain = cnames[idx].friendly()
hostname.Note = cnames[idx].Note
} else if running && format.N > 3 {
hostname.Note = "hostname-not-found"
hostname.Note = "hostname-missing"
}

return hostname
Expand Down
4 changes: 2 additions & 2 deletions internal/workshop/lxd/lxd_backend_dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func generateCNAME(cnames []cname, projects []workshop.Project, projectId string

projectAlias, err := idna.Lookup.ToASCII(projectName)
if err != nil {
result.Note = "invalid-project-name"
result.Note = "hostname-fallback"
return result, nil //nolint:nilerr
}

Expand All @@ -162,7 +162,7 @@ func generateCNAME(cnames []cname, projects []workshop.Project, projectId string
return strings.EqualFold(c.ProjectId, projectAlias) || strings.EqualFold(c.ProjectAlias, projectAlias)
})
if conflict {
result.Note = "project-name-in-use"
result.Note = "hostname-fallback"
return result, nil
}

Expand Down
6 changes: 3 additions & 3 deletions internal/workshop/lxd/lxd_backend_dns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func (s *dnsSuite) TestGenerateCNAMEValidation(c *check.C) {
ProjectId: "42424242",
ProjectName: "42424242",
ProjectAlias: "42424242",
Note: "invalid-project-name",
Note: "hostname-fallback",
}
replaced := lxdbackend.CNAME{
Workshop: "dev",
Expand Down Expand Up @@ -160,7 +160,7 @@ func (s *dnsSuite) TestGenerateCNAMETakenByID(c *check.C) {
ProjectId: "42424242",
ProjectName: "42424242",
ProjectAlias: "42424242",
Note: "project-name-in-use",
Note: "hostname-fallback",
})
}

Expand All @@ -182,7 +182,7 @@ func (s *dnsSuite) TestGenerateCNAMETakenByName(c *check.C) {
ProjectId: "42424242",
ProjectName: "42424242",
ProjectAlias: "42424242",
Note: "project-name-in-use",
Note: "hostname-fallback",
})
}

Expand Down
4 changes: 2 additions & 2 deletions internal/workshop/lxd/tests/integration/workshop_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1334,7 +1334,7 @@ cname=other.24242424.wp,other.testprj.wp,other-24242424.wp,0
c.Assert(err, check.IsNil)
want = `
cname=other.24242424.wp,other.testprj.wp,other-24242424.wp,0
cname=test.42424242.wp,test-42424242.wp,0 # project-name-in-use
cname=test.42424242.wp,test-42424242.wp,0 # hostname-fallback
# fake custom config line
# fake custom config line 2
`[1:]
Expand All @@ -1349,7 +1349,7 @@ cname=test.42424242.wp,test-42424242.wp,0 # project-name-in-use
network, _, err = conn.GetNetwork(network.Name)
c.Assert(err, check.IsNil)
want = `
cname=test.42424242.wp,test-42424242.wp,0 # project-name-in-use
cname=test.42424242.wp,test-42424242.wp,0 # hostname-fallback
# fake custom config line
# fake custom config line 2
`[1:]
Expand Down
Loading