add dockerTlsKey to context for docker type monitors
This commit is contained in:
1 parent
c7626c669a
commit
449e96d842
1 file changed
+9
-1
@@ -36,6 +36,12 @@ export class CheckProducer implements ICheckProducer {
|
|||||||
return windows.some((w) => isWindowActive(w, now));
|
return windows.some((w) => isWindowActive(w, now));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async resolveDockerTlsKey(monitor: Monitor): Promise<string | undefined> {
|
||||||
|
if (monitor.type !== "docker" || !monitor.dockerTlsKeySet || !monitor.id) return undefined;
|
||||||
|
const dockerTlsKey = await this.monitorsRepository.findDockerTlsKeyById(monitor.id);
|
||||||
|
return dockerTlsKey ?? undefined;
|
||||||
|
}
|
||||||
|
|
||||||
produce = async (monitor: Monitor) => {
|
produce = async (monitor: Monitor) => {
|
||||||
if (!monitor.id) {
|
if (!monitor.id) {
|
||||||
throw new AppError({ message: "No monitor id", service: SERVICE_NAME, method: "produce" });
|
throw new AppError({ message: "No monitor id", service: SERVICE_NAME, method: "produce" });
|
||||||
@@ -61,7 +67,9 @@ export class CheckProducer implements ICheckProducer {
|
|||||||
|
|
||||||
// Step 1b: Acquire status
|
// Step 1b: Acquire status
|
||||||
const proxyUrl = await this.proxyResolver.resolve(monitor);
|
const proxyUrl = await this.proxyResolver.resolve(monitor);
|
||||||
const status = await this.networkService.requestStatus(monitor, { proxyUrl });
|
const dockerTlsKey = await this.resolveDockerTlsKey(monitor);
|
||||||
|
|
||||||
|
const status = await this.networkService.requestStatus(monitor, { proxyUrl, dockerTlsKey });
|
||||||
if (!status) {
|
if (!status) {
|
||||||
throw new Error("No network response");
|
throw new Error("No network response");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user