From 7284cfb40170a53ab639e2eb466e386039e3ea4e Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Wed, 9 Oct 2024 11:23:10 +0530 Subject: [PATCH] Cross check app in deployment request and auction record --- .../deploy/webapp/request_webapp_deployment.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/stack_orchestrator/deploy/webapp/request_webapp_deployment.py b/stack_orchestrator/deploy/webapp/request_webapp_deployment.py index 02653f82..0fb2cff1 100644 --- a/stack_orchestrator/deploy/webapp/request_webapp_deployment.py +++ b/stack_orchestrator/deploy/webapp/request_webapp_deployment.py @@ -109,6 +109,16 @@ def command( # noqa: C901 auction = None auction_winners = None if auction_id: + # Fetch auction record for given auction + auction_records_by_id = laconic.app_deployment_auctions({"auction": auction_id}) + if len(auction_records_by_id) == 0: + fatal(f"Unable to locate record for auction: {auction_id}") + + # Cross check app against application in the auction record + auction_app = auction_records_by_id[0].attributes.application + if auction_app != app: + fatal(f"Requested application {app} does not match application from auction record {auction_app}") + # Fetch auction details auction = laconic.get_auction(auction_id) if not auction: