Skip to content

Commit

Permalink
fix Canary middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
zensh committed Apr 2, 2020
1 parent ca9743b commit 80978cf
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions pkg/middlewares/canary/canary.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,19 @@ func New(ctx context.Context, next http.Handler, cfg dynamic.Canary, name string
cfg.MaxCacheSize = defaultCacheSize
}

ls := NewLabelStore(logger, cfg, expiration, cacheCleanDuration)
return &Canary{name: name, product: cfg.Product, uidCookies: cfg.UIDCookies, loadLabels: cfg.Server != "",
addRequestID: cfg.AddRequestID, canaryResponseHeader: cfg.CanaryResponseHeader, ls: ls, next: next}, nil
c := &Canary{
name: name,
next: next,
product: cfg.Product,
uidCookies: cfg.UIDCookies,
loadLabels: cfg.Server != "",
addRequestID: cfg.AddRequestID,
canaryResponseHeader: cfg.CanaryResponseHeader,
}
if c.loadLabels {
c.ls = NewLabelStore(logger, cfg, expiration, cacheCleanDuration)
}
return c, nil
}

// GetTracingInformation implements Tracable interface
Expand Down

0 comments on commit 80978cf

Please sign in to comment.