summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-05-05 13:08:17 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-05-19 22:01:53 +0200
commit83df6384558c27d3ff7282e6d66b06fa7e9c0c60 (patch)
tree57d1ad3cc992e99a24e4144045c8c6d091ab0661 /app/models
parent2aa57071947e562f302b3858a249339024ef7119 (diff)
downloadgitlab-ce-83df6384558c27d3ff7282e6d66b06fa7e9c0c60.tar.gz
Disallow runner to pick untagged build if configured
Diffstat (limited to 'app/models')
-rw-r--r--app/models/ci/build.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index 92327bdb08d..77a2dec4f72 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -290,6 +290,10 @@ module Ci
end
def can_be_served?(runner)
+ if tag_list.empty? && !runner.run_untagged?
+ return false
+ end
+
(tag_list - runner.tag_list).empty?
end