From 7f2ebdb46ba216502333cdabb9884c37a4faede5 Mon Sep 17 00:00:00 2001 From: Dhiraj Bokde Date: Wed, 22 Jan 2025 21:38:36 -0800 Subject: [PATCH] ignore missing catalogs-path by default Signed-off-by: Dhiraj Bokde --- cmd/proxy.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cmd/proxy.go b/cmd/proxy.go index fb61acbd..9dd1820a 100644 --- a/cmd/proxy.go +++ b/cmd/proxy.go @@ -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) @@ -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))