Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-08-18 11:17:02 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-08-18 11:17:02 +0300
commitb39512ed755239198a9c294b6a45e65c05900235 (patch)
treed234a3efade1de67c46b9e5a38ce813627726aa7 /app/services/ci/runners/unassign_runner_service.rb
parentd31474cf3b17ece37939d20082b07f6657cc79a9 (diff)
Add latest changes from gitlab-org/gitlab@15-3-stable-eev15.3.0-rc42
Diffstat (limited to 'app/services/ci/runners/unassign_runner_service.rb')
-rw-r--r--app/services/ci/runners/unassign_runner_service.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/app/services/ci/runners/unassign_runner_service.rb b/app/services/ci/runners/unassign_runner_service.rb
index 1e46cf6add8..c40e5e0d44e 100644
--- a/app/services/ci/runners/unassign_runner_service.rb
+++ b/app/services/ci/runners/unassign_runner_service.rb
@@ -13,9 +13,15 @@ module Ci
end
def execute
- return false unless @user.present? && @user.can?(:assign_runner, @runner)
+ unless @user.present? && @user.can?(:assign_runner, @runner)
+ return ServiceResponse.error(message: 'user not allowed to assign runner')
+ end
- @runner_project.destroy
+ if @runner_project.destroy
+ ServiceResponse.success
+ else
+ ServiceResponse.error(message: 'failed to destroy runner project')
+ end
end
private