Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send notification header identify requests as coming from the notification component. #84

Merged
merged 1 commit into from
Nov 19, 2020
Merged

Send notification header identify requests as coming from the notification component. #84

merged 1 commit into from
Nov 19, 2020

Conversation

bigkevmcd
Copy link
Contributor

Add support for sending a Notification-Controller header from the forwarder notifier.

This means that it can be identified in upstream requests.

@@ -40,7 +43,10 @@ func NewForwarder(hookURL string, proxyURL string) (*Forwarder, error) {
}

func (f *Forwarder) Post(event recorder.Event) error {
err := postMessage(f.URL, f.ProxyURL, event)
err := postMessage(f.URL, f.ProxyURL, event, func(req *retryablehttp.Request) {
req.Header.Set("Notification-Controller", event.ReportingController)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please extract the header name into a variable and rename it to gotk-component

This adds support for sending an HTTP header `gotk-component` with the
originating controller, this can be identifed in receiving servers.

Signed-off-by: Kevin McDermott <bigkevmcd@gmail.com>
Copy link
Member

@phillebaba phillebaba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks good, but I will let @stefanprodan have last say if he has any other comments.

@stefanprodan stefanprodan merged commit a1312dd into fluxcd:main Nov 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants