inline initLoadingAPI
apiErr is always nil in this case, so the error-handling branch will never
be executed.
@@ -106,10 +106,7 @@ func NewRunner(ctx context.Context, logger log.Logger, options Options) (*Runner
} else {
logger.Infof("no valid kube config found, initializing loading API")
// Initialize the API
- apiService, apiErr = r.initLoadingAPI(ctx, logger, options)
- if apiErr != nil {
- return nil, fmt.Errorf("failed to start loading api: %w", err)
- }
+ apiService = api.NewLoadingAPI(ctx, api.PathPrefix, r.actionManager, r.websocketClientManager, logger)
}
d, err := newDash(options.Listener, options.Namespace, options.FrontendURL, options.BrowserPath, apiService, pluginService, logger)
@@ -171,12 +168,6 @@ func (r *Runner) Start(ctx context.Context, logger log.Logger, options Options,
return nil
}
-func (r *Runner) initLoadingAPI(ctx context.Context, logger log.Logger, _ Options) (*api.LoadingAPI, error) {
- apiService := api.NewLoadingAPI(ctx, api.PathPrefix, r.actionManager, r.websocketClientManager, logger)
-
- return apiService, nil
-}
-
func (r *Runner) initAPI(ctx context.Context, logger log.Logger, options Options) (*api.API, *pluginAPI.GRPCService, error) {
frontendProxy := pluginAPI.FrontendProxy{}
