Skip to content

Commit

Permalink
add log messages if configuration used in bootstrapping portal missing
Browse files Browse the repository at this point in the history
Signed-off-by: Burak Sekili <buraksekili@gmail.com>
  • Loading branch information
buraksekili committed Nov 23, 2023
1 parent e228157 commit b1a45c6
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tyk/portal.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ import (

// BootstrapClassicPortal bootstraps Tyk Classic Portal.
func (s *Service) BootstrapClassicPortal() error {
if s.appArgs.Tyk.Admin.Auth == "" {
s.l.Warn("Missing Admin Auth configuration may cause Authorization failures on Tyk",
"If Tyk Dashboard bootstrapping is disabled, please provide Admin Auth through environment variables")
}

err := s.createPortalDefaultSettings()
if err != nil {
return err
Expand All @@ -40,6 +45,11 @@ func (s *Service) BootstrapClassicPortal() error {
func (s *Service) setPortalCname() error {
s.l.Debug("Setting portal cname")

if s.appArgs.Tyk.Org.Cname == "" {
s.l.Warn("Missing Organisation Cname configuration may cause failures on Tyk requests",
"Please provide Org Cname")
}

cnameReq := api.CnameReq{Cname: s.appArgs.Tyk.Org.Cname}

reqBody, err := json.Marshal(cnameReq)
Expand Down Expand Up @@ -75,6 +85,11 @@ func (s *Service) setPortalCname() error {
func (s *Service) initialiseCatalogue() error {
s.l.Debug("Initialising Catalogue")

if s.appArgs.Tyk.Org.ID == "" {
s.l.Warn("Missing Organisation ID configuration may cause failures on Tyk requests",
"Please provide Org ID")
}

initCatalog := api.InitCatalogReq{OrgId: s.appArgs.Tyk.Org.ID}

reqBody, err := json.Marshal(initCatalog)
Expand Down

0 comments on commit b1a45c6

Please sign in to comment.