diff --git a/cmd/run.go b/cmd/run.go index fb0ee1f..a96b5cc 100644 --- a/cmd/run.go +++ b/cmd/run.go @@ -11,7 +11,6 @@ import ( "github.com/metal-toolbox/flipflop/internal/model" "github.com/metal-toolbox/flipflop/internal/store" "github.com/metal-toolbox/flipflop/internal/version" - "github.com/metal-toolbox/rivets/events" "github.com/pkg/errors" "github.com/spf13/cobra" @@ -78,13 +77,7 @@ func runWorker(ctx context.Context) { theApp.Logger.Fatal(err) } - stream, err := events.NewStream(theApp.Config.Endpoints.Nats) - if err != nil { - theApp.Logger.Fatal(err) - } - ff := flipflop.New( - stream, inv, theApp.Logger, theApp.Config, diff --git a/internal/flipflop/flipflop.go b/internal/flipflop/flipflop.go index 7f881d7..ba0c107 100644 --- a/internal/flipflop/flipflop.go +++ b/internal/flipflop/flipflop.go @@ -10,7 +10,6 @@ import ( "github.com/metal-toolbox/flipflop/internal/store" "github.com/metal-toolbox/flipflop/internal/version" rctypes "github.com/metal-toolbox/rivets/condition" - "github.com/metal-toolbox/rivets/events" "github.com/sirupsen/logrus" "go.opentelemetry.io/otel" ) @@ -23,7 +22,6 @@ const ( type flipflop struct { logger *logrus.Logger cfg *app.Configuration - stream events.Stream store store.Repository name string } @@ -32,7 +30,6 @@ type flipflop struct { // // nolint:revive // unexported type is not annoying to use func New( - stream events.Stream, repository store.Repository, logger *logrus.Logger, cfg *app.Configuration, @@ -41,7 +38,6 @@ func New( return &flipflop{ name: name, - stream: stream, store: repository, cfg: cfg, logger: logger, @@ -91,7 +87,6 @@ func (f *flipflop) Run(ctx context.Context) { logger: loggerEntry, controllerID: nc.ID(), store: f.store, - stream: f.stream, } } diff --git a/internal/flipflop/handler.go b/internal/flipflop/handler.go index b5b819c..0c7c2c3 100644 --- a/internal/flipflop/handler.go +++ b/internal/flipflop/handler.go @@ -12,7 +12,6 @@ import ( "github.com/metal-toolbox/flipflop/internal/model" "github.com/metal-toolbox/flipflop/internal/store" rctypes "github.com/metal-toolbox/rivets/condition" - "github.com/metal-toolbox/rivets/events" "github.com/pkg/errors" "github.com/prometheus/client_golang/prometheus" "github.com/sirupsen/logrus" @@ -24,7 +23,6 @@ type ConditionTaskHandler struct { logger *logrus.Entry cfg *app.Configuration bmc device.Queryor - stream events.Stream store store.Repository publisher ctrl.Publisher server *model.Asset