summaryrefslogtreecommitdiffstats
path: root/controller-server
diff options
context:
space:
mode:
authorMartin Polden <mpolden@mpolden.no>2022-04-07 18:14:16 +0200
committerGitHub <noreply@github.com>2022-04-07 18:14:16 +0200
commitc574abb1fe5cefeb37f41fcc0d76132f87854466 (patch)
tree23a3d6c2927c76964328fe0603277efd4d95e473 /controller-server
parente1f4898e7ae646ddaa9eb845b2918f56548f48e4 (diff)
parentdf58f3c91957109158443d92e3fc7b44d7b60e30 (diff)
Merge pull request #22019 from vespa-engine/ean/reduce-mails-sent
Limit email notification to prodution only
Diffstat (limited to 'controller-server')
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/notify/Notifier.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/notify/Notifier.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/notify/Notifier.java
index e186541c85c..594908a3bc1 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/notify/Notifier.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/notify/Notifier.java
@@ -38,6 +38,9 @@ public class Notifier {
if (notifications.isEmpty()) {
return;
}
+ if (skipSource(source)) {
+ return;
+ }
var tenant = curatorDb.readTenant(source.tenant());
tenant.stream().forEach(t -> {
if (t instanceof CloudTenant) {
@@ -51,6 +54,11 @@ public class Notifier {
});
}
+ private boolean skipSource(NotificationSource source) {
+ // Limit sources to production systems only. Dev and test systems cause too much noise at the moment.
+ return source.jobType().map(t -> !t.isProduction()).orElse(false);
+ }
+
public void dispatch(Notification notification) {
dispatch(List.of(notification), notification.source());
}