Skip to content

Commit

Permalink
add StartOptions EnableCertManager
Browse files Browse the repository at this point in the history
  • Loading branch information
tcarreira committed May 18, 2022
1 parent 377596c commit 36bc6b1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/web/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ type Api struct {
}

type APIServerStartOptions struct {
DiscardLogging bool
DiscardLogging bool
ConfigEnableCertManager bool
}

// New creates an api instance.
Expand Down Expand Up @@ -112,6 +113,10 @@ func (a *Api) startServerWithOptions(options APIServerStartOptions) error {
if options.DiscardLogging {
a.e.Logger.SetOutput(io.Discard)
}
if options.ConfigEnableCertManager {
conf.EnableCertManager = options.ConfigEnableCertManager
config.Set(conf)
}

if conf.TLSCertificate != "" && conf.TLSKey != "" {
return a.e.StartTLS(a.TLSAddress, conf.TLSCertificate, conf.TLSKey)
Expand Down

0 comments on commit 36bc6b1

Please sign in to comment.