From 54efed62ee27649ba10807e75b3ebbee49ac3ee2 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Wed, 22 Mar 2017 14:47:34 -0400 Subject: [PATCH] Make sure `start_build` cannot be called for app repos --- endpoints/building.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/endpoints/building.py b/endpoints/building.py index 9ad61f8a1..a1e17897d 100644 --- a/endpoints/building.py +++ b/endpoints/building.py @@ -29,6 +29,9 @@ class MaximumBuildsQueuedException(Exception): def start_build(repository, prepared_build, pull_robot_name=None): + if repository.kind.name != 'image': + raise Exception('Attempt to start a build for application repository %s' % repository.id) + if MAX_BUILD_QUEUE_RATE_ITEMS > 0 and MAX_BUILD_QUEUE_RATE_SECS > 0: queue_item_canonical_name = [repository.namespace_user.username, repository.name] now = datetime.utcnow()