Skip to content

Commit

Permalink
fix unused arg, log err
Browse files Browse the repository at this point in the history
  • Loading branch information
djeebus committed Feb 26, 2024
1 parent a40c17e commit bb38dfb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 3 additions & 2 deletions cmd/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ import (
func newContainer(ctx context.Context, cfg config.ServerConfig) (container.Container, error) {
var err error

ctr := container.Container{}
ctr.Config = cfg
var ctr = container.Container{
Config: cfg,
}

switch cfg.VcsType {
case "gitlab":
Expand Down
7 changes: 5 additions & 2 deletions pkg/app_watcher/app_watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ func NewApplicationWatcher(vcsToArgoMap appdir.VcsToArgoMap) (*ApplicationWatche

ctrl := ApplicationWatcher{
applicationClientset: appClient,
vcsToArgoMap: vcsToArgoMap,
}

appInformer, appLister := ctrl.newApplicationInformerAndLister(time.Second * 30)
Expand Down Expand Up @@ -126,13 +127,15 @@ func (ctrl *ApplicationWatcher) newApplicationInformerAndLister(refreshTimeout t
)

lister := applisters.NewApplicationLister(informer.GetIndexer())
informer.AddEventHandler(
if _, err := informer.AddEventHandler(
cache.ResourceEventHandlerFuncs{
AddFunc: ctrl.onApplicationAdded,
UpdateFunc: ctrl.onApplicationUpdated,
DeleteFunc: ctrl.onApplicationDeleted,
},
)
); err != nil {
log.Error().Err(err).Msg("failed to add event handlers")
}
return informer, lister
}

Expand Down

0 comments on commit bb38dfb

Please sign in to comment.