Skip to content
This repository has been archived by the owner on Oct 5, 2020. It is now read-only.

Commit

Permalink
Merge pull request #79 from rebuy-de/service-interceptors
Browse files Browse the repository at this point in the history
move interceptor config to service level
  • Loading branch information
svenwltr authored Sep 22, 2017
2 parents 4d9078c + 23f6071 commit fd06562
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/api/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,13 @@ func New(p *Parameters) (*App, error) {

app.Settings.Clean(p.Context)

return app, nil
}

func (app *App) StartInterceptors(service *settings.Service) {
app.Interceptors = interceptors.New()

interceptors := app.CurrentContext().Interceptors
interceptors := service.Interceptors

if interceptors.Waiter.Enabled == settings.Enabled {
log.WithFields(log.Fields{
Expand Down Expand Up @@ -100,8 +104,6 @@ func New(p *Parameters) (*App, error) {
app.Clients.Kubernetes,
))
}

return app, nil
}

func (app *App) CurrentContext() settings.Service {
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ func (app *App) Fetch(project, branchName string) (*FetchResult, error) {
return nil, errors.WithStack(err)
}

app.StartInterceptors(service)

err = app.Interceptors.PostFetch(branch)
if err != nil {
return nil, errors.WithStack(err)
Expand Down

0 comments on commit fd06562

Please sign in to comment.