- }
-}
-
-func (srv *Server) init(ctx context.Context) {
- if srv.RunOptions.Logger == nil {
- srv.RunOptions.Logger = ctxlog.FromContext(ctx)
- }
-
- srv.Logger = srv.RunOptions.Logger
- srv.Dumper = srv.RunOptions.Dumper
-
- if srv.Cluster.ManagementToken == "" {
- srv.httpHandler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- http.Error(w, "Management API authentication is not configured", http.StatusForbidden)
- })