mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 05:27:48 +00:00
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:
@@ -996,7 +996,9 @@ export const relayServiceFactory = ({
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (existingRelay && (existingRelay.host !== host || existingRelay.name !== name)) {
|
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) {
|
if (!existingRelay) {
|
||||||
|
|||||||
Reference in New Issue
Block a user