reorder docker case
This commit is contained in:
1 parent
cd65488cbd
commit
5fb26367ed
3 files changed
+6
-6
No files matched your search
@@ -43,5 +43,5 @@ export const describeContainerBreach = (breach: DockerContainerBreach): string =
|
||||
if (breach.exitCode === undefined) {
|
||||
return `${breach.name}: stopped`;
|
||||
}
|
||||
return `${breach.name} stopped (exit code ${breach.exitCode})`;
|
||||
return `${breach.name}: stopped (exit code ${breach.exitCode})`;
|
||||
};
|
||||
@@ -107,16 +107,16 @@ export class IncidentService implements IIncidentService {
|
||||
};
|
||||
|
||||
private buildThresholdBreachMessage(monitor: Monitor, monitorStatusResponse?: MonitorStatusResponse): string {
|
||||
if (!monitorStatusResponse) {
|
||||
return "Threshold breach detected";
|
||||
}
|
||||
|
||||
if (monitor.type === "docker") {
|
||||
const containers = (monitorStatusResponse?.payload as DockerStatusPayload | undefined)?.containers ?? [];
|
||||
const breaches = findContainerBreaches(monitor, containers);
|
||||
return breaches.length > 0 ? breaches.map(describeContainerBreach).join(", ") : "Container alert";
|
||||
}
|
||||
|
||||
if (!monitorStatusResponse) {
|
||||
return "Threshold breach detected";
|
||||
}
|
||||
|
||||
const breaches = this.notificationMessageBuilder.extractThresholdBreaches(monitor, monitorStatusResponse);
|
||||
|
||||
if (breaches.length === 0) {
|
||||
|
||||
Reference in new issue
Block a user