Skip to content

Commit

Permalink
ignore missing catalogs-path by default
Browse files Browse the repository at this point in the history
Signed-off-by: Dhiraj Bokde <[email protected]>
  • Loading branch information
dhirajsb committed Jan 23, 2025
1 parent 6e4068f commit 7f2ebdb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cmd/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,8 @@ func runProxyServer(cmd *cobra.Command, args []string) error {
return fmt.Errorf("invalid disable-service: %v", disableService)
}

if disableService != CatalogService {
if disableService != CatalogService && len(proxyCfg.CatalogsConfigPath) != 0 {

if len(proxyCfg.CatalogsConfigPath) == 0 {
return fmt.Errorf("missing option catalogs-path for catalog config file")
}
sources, err := catalog.LoadCatalogSources(proxyCfg.CatalogsConfigPath)
if err != nil {
return fmt.Errorf("error loading catalog sources: %v", err)
Expand Down Expand Up @@ -89,6 +86,10 @@ func runProxyServer(cmd *cobra.Command, args []string) error {

}

if len(routers) == 0 {
return fmt.Errorf("all services disabled")
}

router := openapi.NewRouter(routers...)

glog.Fatal(http.ListenAndServe(fmt.Sprintf("%s:%d", cfg.Hostname, cfg.Port), router))
Expand Down

0 comments on commit 7f2ebdb

Please sign in to comment.