-
Notifications
You must be signed in to change notification settings - Fork 883
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
feat: allow hostname override for notifiers #994
feat: allow hostname override for notifiers #994
Conversation
As it currently stands all notifiers utilise `os.Hostname` to populate their titles/subjects. When utilising Docker with a bridged network if you set the hostname for a container to an external DNS hostname Docker's internal DNS resolver will override said hostname for all containers within the bridged network. This change allows a user to specify what hostname should be represented in the email notifications without having to change the `os.Hostname`.
Codecov Report
@@ Coverage Diff @@
## main #994 +/- ##
==========================================
+ Coverage 56.15% 56.22% +0.06%
==========================================
Files 25 25
Lines 1453 1462 +9
==========================================
+ Hits 816 822 +6
- Misses 567 568 +1
- Partials 70 72 +2
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The title isn't tied to email anymore (hence why it's in pkg/notifications/notifier.go
). It should not be too difficult to set the notification hostname either to the flag value, or if empty, os.Hostname
.
There are more places to change than the one below obviously though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was fast!
The way it's implemented here is probably the simplest (in a good way). A larger overhaul of the notification flag handling should probably be done at a later stage anyway.
Just one comment:
As it currently stands all notifiers utilise
os.Hostname
to populate their titles/subjects.When utilising Docker with a bridged network if you set the hostname for a container to an external DNS hostname Docker's internal DNS resolver will override said hostname for all containers within the bridged network.
This change allows a user to specify what hostname should be represented in the notifications without having to change the
os.Hostname
.