Merge pull request #4813 from Infisical/relay-replace-fix

fix relays with same identity repalcing each other, throw error instead
This commit is contained in:
Andre
2025-11-05 14:00:30 -05:00
committed by GitHub

View File

@@ -996,7 +996,9 @@ export const relayServiceFactory = ({
);
if (existingRelay && (existingRelay.host !== host || existingRelay.name !== name)) {
return relayDAL.updateById(existingRelay.id, { host, name }, tx);
throw new BadRequestError({
message: `Machine identity already has an existing relay with the name "${existingRelay.name}" and host "${existingRelay.host}". Delete the existing relay or use a different machine identity.`
});
}
if (!existingRelay) {