mirror of
https://github.com/fluxcd/flagger.git
synced 2026-04-15 06:57:34 +00:00
Add alerting http proxy option
Signed-off-by: Léopold Jacquot <leopold.jacquot@infomaniak.com>
This commit is contained in:
@@ -149,9 +149,13 @@ func (c *Controller) alert(canary *flaggerv1.Canary, message string, metadata bo
|
||||
if provider.Spec.Channel != "" {
|
||||
channel = provider.Spec.Channel
|
||||
}
|
||||
proxy := ""
|
||||
if provider.Spec.Proxy != "" {
|
||||
proxy = provider.Spec.Proxy
|
||||
}
|
||||
|
||||
// create notifier based on provider type
|
||||
f := notifier.NewFactory(url, username, channel)
|
||||
f := notifier.NewFactory(url, proxy, username, channel)
|
||||
n, err := f.Notifier(provider.Spec.Type)
|
||||
if err != nil {
|
||||
c.logger.With("canary", fmt.Sprintf("%s.%s", canary.Name, canary.Namespace)).
|
||||
|
||||
@@ -61,7 +61,10 @@ func callWebhook(webhook string, payload interface{}, timeout string) error {
|
||||
ctx, cancel := context.WithTimeout(req.Context(), t)
|
||||
defer cancel()
|
||||
|
||||
r, err := http.DefaultClient.Do(req.WithContext(ctx))
|
||||
httpClient := http.DefaultClient
|
||||
httpClient.Transport = http.DefaultTransport
|
||||
|
||||
r, err := httpClient.Do(req.WithContext(ctx))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user