Skip to content

Commit

Permalink
chore: update version to 2.9-2024.2.19-7f1e9b76a
Browse files Browse the repository at this point in the history
  • Loading branch information
pasha-codefresh committed Feb 19, 2024
1 parent 7f1e9b7 commit aabc4c1
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 103 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.9-2024.2.19-5d3b6792c
2.9-2024.2.19-7f1e9b76a
2 changes: 2 additions & 0 deletions changelog/CHANGELOG-2.9-2024.2.19-7f1e9b76a.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
### Features
- fix: revert 2.9-2024.2.4-fc84c8a9c due to cmp issue
6 changes: 0 additions & 6 deletions cmd/event-reporter-server/commands/event_reporter_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package commands
import (
"context"
"fmt"
"github.com/argoproj/argo-cd/v2/event_reporter/reporter"
"math"
"time"

Expand Down Expand Up @@ -177,11 +176,6 @@ func NewCommand() *cobra.Command {
BaseURL: codefreshUrl,
AuthToken: codefreshToken,
},
RateLimiterOpts: &reporter.RateLimiterOpts{
Enabled: rateLimiterEnabled,
Rate: rateLimiterDuration,
Capacity: rateLimiterBucketSize,
},
}

log.Infof("Starting event reporter server with grpc transport %v", useGrpc)
Expand Down
4 changes: 2 additions & 2 deletions event_reporter/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ type eventReporterController struct {
metricsServer *metrics.MetricsServer
}

func NewEventReporterController(appInformer cache.SharedIndexInformer, cache *servercache.Cache, settingsMgr *settings.SettingsManager, applicationServiceClient appclient.ApplicationClient, appLister applisters.ApplicationLister, codefreshConfig *codefresh.CodefreshConfig, metricsServer *metrics.MetricsServer, featureManager *reporter.FeatureManager, rateLimiterOpts *reporter.RateLimiterOpts) EventReporterController {
appBroadcaster := reporter.NewBroadcaster(featureManager, metricsServer, rateLimiterOpts)
func NewEventReporterController(appInformer cache.SharedIndexInformer, cache *servercache.Cache, settingsMgr *settings.SettingsManager, applicationServiceClient appclient.ApplicationClient, appLister applisters.ApplicationLister, codefreshConfig *codefresh.CodefreshConfig, metricsServer *metrics.MetricsServer, featureManager *reporter.FeatureManager) EventReporterController {
appBroadcaster := reporter.NewBroadcaster(featureManager, metricsServer)
appInformer.AddEventHandler(appBroadcaster)
return &eventReporterController{
appBroadcaster: appBroadcaster,
Expand Down
11 changes: 1 addition & 10 deletions event_reporter/reporter/broadcaster.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,15 @@ type broadcasterHandler struct {
filter sharding.ApplicationFilterFunction
featureManager *FeatureManager
metricsServer *metrics.MetricsServer
rateLimiter *RateLimiter
}

func NewBroadcaster(featureManager *FeatureManager, metricsServer *metrics.MetricsServer, rateLimiterOpts *RateLimiterOpts) Broadcaster {
func NewBroadcaster(featureManager *FeatureManager, metricsServer *metrics.MetricsServer) Broadcaster {
// todo: pass real value here
filter := getApplicationFilter("")
return &broadcasterHandler{
filter: filter,
featureManager: featureManager,
metricsServer: metricsServer,
rateLimiter: NewRateLimiter(rateLimiterOpts),
}
}

Expand Down Expand Up @@ -78,13 +76,6 @@ func (b *broadcasterHandler) notify(event *appv1.ApplicationWatchEvent) {
for _, s := range subscribers {
if s.matches(event) {

duration, err := b.rateLimiter.Limit(event.Application.Name)
if err != nil {
log.Infof("adding application '%s' to channel failed, due to rate limit, duration left %s", event.Application.Name, duration.String())
b.metricsServer.IncAppEventsCounter(event.Application.Name, false)
continue
}

select {
case s.ch <- event:
{
Expand Down
36 changes: 0 additions & 36 deletions event_reporter/reporter/rate_limiter.go

This file was deleted.

46 changes: 0 additions & 46 deletions event_reporter/reporter/rate_limiter_test.go

This file was deleted.

3 changes: 1 addition & 2 deletions event_reporter/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ type EventReporterServerOpts struct {
BaseHRef string
RootPath string
CodefreshConfig *codefresh.CodefreshConfig
RateLimiterOpts *reporter.RateLimiterOpts
}

type handlerSwitcher struct {
Expand Down Expand Up @@ -153,7 +152,7 @@ func (a *EventReporterServer) Init(ctx context.Context) {
}

func (a *EventReporterServer) RunController(ctx context.Context) {
controller := event_reporter.NewEventReporterController(a.appInformer, a.Cache, a.settingsMgr, a.ApplicationServiceClient, a.appLister, a.CodefreshConfig, a.serviceSet.MetricsServer, a.featureManager, a.RateLimiterOpts)
controller := event_reporter.NewEventReporterController(a.appInformer, a.Cache, a.settingsMgr, a.ApplicationServiceClient, a.appLister, a.CodefreshConfig, a.serviceSet.MetricsServer, a.featureManager)
go controller.Run(ctx)
}

Expand Down

0 comments on commit aabc4c1

Please sign in to comment.