mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
Better logs
This commit is contained in:
@@ -66,11 +66,12 @@ export const dnsMadeEasyDeleteTxtRecord = async (
|
|||||||
credentials: { apiKey, secretKey }
|
credentials: { apiKey, secretKey }
|
||||||
} = connection;
|
} = connection;
|
||||||
|
|
||||||
logger.info({ hostedZoneId, domain }, "Deleting TXT record for DNS Made Easy");
|
logger.info({ zoneId: hostedZoneId, domain }, "Deleting TXT record for DNS Made Easy");
|
||||||
try {
|
try {
|
||||||
const dnsRecords = await listDNSMadeEasyRecords(connection, { zoneId: hostedZoneId, type: "TXT", name: domain });
|
const dnsRecords = await listDNSMadeEasyRecords(connection, { zoneId: hostedZoneId, type: "TXT", name: domain });
|
||||||
|
|
||||||
if (Array.isArray(dnsRecords) && dnsRecords.length > 0) {
|
let foundRecord = false;
|
||||||
|
if (dnsRecords.length > 0) {
|
||||||
const recordToDelete = dnsRecords.find(
|
const recordToDelete = dnsRecords.find(
|
||||||
(record) => record.type === "TXT" && record.name === domain && JSON.parse(record.value) === value
|
(record) => record.type === "TXT" && record.name === domain && JSON.parse(record.value) === value
|
||||||
);
|
);
|
||||||
@@ -85,10 +86,12 @@ export const dnsMadeEasyDeleteTxtRecord = async (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
} else {
|
foundRecord = true;
|
||||||
logger.warn({ domain, value }, `Record to delete not found for domain: ${domain} and value: ${value}`);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!foundRecord) {
|
||||||
|
logger.warn({ zoneId: hostedZoneId, domain, value }, "Record to delete not found");
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (axios.isAxiosError(error)) {
|
if (axios.isAxiosError(error)) {
|
||||||
const errorMessage =
|
const errorMessage =
|
||||||
|
|||||||
Reference in New Issue
Block a user