@@ -406,14 +406,7 @@ func createHeadlampHandler(config *HeadlampConfig) http.Handler {
406406
407407 config .StaticPluginDir = os .Getenv ("HEADLAMP_STATIC_PLUGINS_DIR" )
408408
409- logger .Log (logger .LevelInfo , nil , nil , "Creating Headlamp handler" )
410- logger .Log (logger .LevelInfo , nil , nil , "Listen address: " + fmt .Sprintf ("%s:%d" , config .ListenAddr , config .Port ))
411- logger .Log (logger .LevelInfo , nil , nil , "Kubeconfig path: " + kubeConfigPath )
412- logger .Log (logger .LevelInfo , nil , nil , "Static plugin dir: " + config .StaticPluginDir )
413- logger .Log (logger .LevelInfo , nil , nil , "Plugins dir: " + config .PluginDir )
414- logger .Log (logger .LevelInfo , nil , nil , "Dynamic clusters support: " + fmt .Sprint (config .EnableDynamicClusters ))
415- logger .Log (logger .LevelInfo , nil , nil , "Helm support: " + fmt .Sprint (config .EnableHelm ))
416- logger .Log (logger .LevelInfo , nil , nil , "Proxy URLs: " + fmt .Sprint (config .ProxyURLs ))
409+ logStartupInfo (config );
417410
418411 plugins .PopulatePluginsCache (config .StaticPluginDir , config .PluginDir , config .cache )
419412
@@ -838,6 +831,18 @@ func createHeadlampHandler(config *HeadlampConfig) http.Handler {
838831 return r
839832}
840833
834+ // logStartupInfo logs config information of the Headlamp server.
835+ func logStartupInfo (config * HeadlampConfig ) {
836+ logger .Log (logger .LevelInfo , nil , nil , "Creating Headlamp handler" )
837+ logger .Log (logger .LevelInfo , nil , nil , "Listen address: " + fmt .Sprintf ("%s:%d" , config .ListenAddr , config .Port ))
838+ logger .Log (logger .LevelInfo , nil , nil , "Kubeconfig path: " + config .KubeConfigPath )
839+ logger .Log (logger .LevelInfo , nil , nil , "Static plugin dir: " + config .StaticPluginDir )
840+ logger .Log (logger .LevelInfo , nil , nil , "Plugins dir: " + config .PluginDir )
841+ logger .Log (logger .LevelInfo , nil , nil , "Dynamic clusters support: " + fmt .Sprint (config .EnableDynamicClusters ))
842+ logger .Log (logger .LevelInfo , nil , nil , "Helm support: " + fmt .Sprint (config .EnableHelm ))
843+ logger .Log (logger .LevelInfo , nil , nil , "Proxy URLs: " + fmt .Sprint (config .ProxyURLs ))
844+ }
845+
841846func parseClusterAndToken (r * http.Request ) (string , string ) {
842847 cluster := ""
843848 re := regexp .MustCompile (`^/clusters/([^/]+)/.*` )
0 commit comments