Skip to content

Commit 386e488

Browse files
fix: failing tests
1 parent 3e7ea27 commit 386e488

File tree

6 files changed

+18
-41
lines changed

6 files changed

+18
-41
lines changed

coderd/apidoc/docs.go

Lines changed: 1 addition & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/apidoc/swagger.json

Lines changed: 1 addition & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/notifications/dispatch/smtp.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,10 @@ import (
3434
)
3535

3636
var (
37-
ValidationNoFromAddressErr = xerrors.New("no 'from' address defined")
38-
ValidationNoToAddressErr = xerrors.New("no 'to' address(es) defined")
39-
ValidationNoSmarthostHostErr = xerrors.New("smarthost 'host' is not defined, or is invalid")
40-
ValidationNoSmarthostPortErr = xerrors.New("smarthost 'port' is not defined, or is invalid")
41-
ValidationNoHelloErr = xerrors.New("'hello' not defined")
37+
ValidationNoFromAddressErr = xerrors.New("no 'from' address defined")
38+
ValidationNoToAddressErr = xerrors.New("no 'to' address(es) defined")
39+
ValidationNoSmarthostErr = xerrors.New("no 'smarthost' defined")
40+
ValidationNoHelloErr = xerrors.New("'hello' not defined")
4241

4342
//go:embed smtp/html.gotmpl
4443
htmlTemplate string
@@ -521,6 +520,10 @@ func (s *SMTPHandler) validateToAddrs(to string) ([]string, error) {
521520
// Does not allow overriding.
522521
// nolint:revive // documented.
523522
func (s *SMTPHandler) smarthost() (string, string, error) {
523+
if s.cfg.Smarthost.String() == "" {
524+
return "", "", ValidationNoSmarthostErr
525+
}
526+
524527
host, port, err := net.SplitHostPort(s.cfg.Smarthost.String())
525528
if err != nil {
526529
return "", "", fmt.Errorf("split host port: %w", err)

docs/reference/api/general.md

Lines changed: 1 addition & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/api/schemas.md

Lines changed: 5 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/cli/server.md

Lines changed: 2 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)