Skip to content

Commit 5c0ebe9

Browse files
authored
Merge pull request #93 from mahmednabil109/main
Remove the prometheus registry parameter
2 parents f00cb7d + a28b450 commit 5c0ebe9

File tree

4 files changed

+4
-7
lines changed

4 files changed

+4
-7
lines changed

pkg/api/listener.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ package api
77

88
import (
99
"github.com/linuxboot/contest/pkg/xcontext"
10-
"github.com/prometheus/client_golang/prometheus"
1110
)
1211

1312
// Listener defines the interface for an API listener. This is used to
@@ -18,5 +17,5 @@ type Listener interface {
1817
// The channel is used for cancellation, which can be called by the
1918
// JobManager and should be handled by the listener to do a graceful
2019
// shutdown.
21-
Serve(xcontext.Context, *API, *prometheus.Registry) error
20+
Serve(xcontext.Context, *API) error
2221
}

pkg/jobmanager/jobmanager.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ func (jm *JobManager) Run(ctx xcontext.Context, resumeJobs bool) error {
161161

162162
errCh := make(chan error, 1)
163163
go func() {
164-
lErr := jm.apiListener.Serve(apiCtx, a, nil)
164+
lErr := jm.apiListener.Serve(apiCtx, a)
165165
ctx.Infof("Listener shut down successfully.")
166166
errCh <- lErr
167167
close(errCh)

plugins/listeners/httplistener/httplistener.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import (
2121
"github.com/linuxboot/contest/pkg/storage"
2222
"github.com/linuxboot/contest/pkg/types"
2323
"github.com/linuxboot/contest/pkg/xcontext"
24-
"github.com/prometheus/client_golang/prometheus"
2524
)
2625

2726
// HTTPListener implements the api.Listener interface.
@@ -241,7 +240,7 @@ func listenWithCancellation(ctx xcontext.Context, s *http.Server) error {
241240

242241
// Serve implements the api.Listener.Serve interface method. It starts an HTTP
243242
// API listener and returns an api.Event channel that the caller can iterate on.
244-
func (h *HTTPListener) Serve(ctx xcontext.Context, a *api.API, promRegistry *prometheus.Registry) error {
243+
func (h *HTTPListener) Serve(ctx xcontext.Context, a *api.API) error {
245244
if a == nil {
246245
return errors.New("API object is nil")
247246
}

tests/integ/jobmanager/common.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ import (
4949
"github.com/linuxboot/contest/tests/plugins/teststeps/noreturn"
5050
readmetastep "github.com/linuxboot/contest/tests/plugins/teststeps/readmeta"
5151
"github.com/linuxboot/contest/tests/plugins/teststeps/slowecho"
52-
"github.com/prometheus/client_golang/prometheus"
5352
)
5453

5554
// Integration tests for the JobManager use an in-memory storage layer, which
@@ -93,7 +92,7 @@ type TestListener struct {
9392

9493
// Serve implements the main logic of a dummy listener which talks to the API
9594
// layer to trigger actions in the JobManager
96-
func (tl *TestListener) Serve(ctx xcontext.Context, contestApi *api.API, promRegistry *prometheus.Registry) error {
95+
func (tl *TestListener) Serve(ctx xcontext.Context, contestApi *api.API) error {
9796
ctx.Debugf("Serving mock listener")
9897
tl.api = contestApi
9998
for {

0 commit comments

Comments
 (0)