diff options
author | Clement Ho <clemmakesapps@gmail.com> | 2018-02-28 15:40:52 +0000 |
---|---|---|
committer | Clement Ho <clemmakesapps@gmail.com> | 2018-02-28 15:40:52 +0000 |
commit | b5b8dc83cc1bb271877c79532ecfb555540672a7 (patch) | |
tree | 190f6cd6991cbfbabbd670a7aac5ff36eb1a64bb /lib/api/helpers | |
parent | deef09cd1f0dbe5cab5095ff02f19a5c3588cb91 (diff) | |
parent | ff2f57da791890957fe97efd46f5c34f270a0c46 (diff) | |
download | gitlab-ce-dispatcher-cycle-analytics.tar.gz |
Merge branch 'master' into 'dispatcher-cycle-analytics'dispatcher-cycle-analytics
# Conflicts:
# config/webpack.config.js
Diffstat (limited to 'lib/api/helpers')
-rw-r--r-- | lib/api/helpers/runner.rb | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/api/helpers/runner.rb b/lib/api/helpers/runner.rb index fbe30192a16..35ac0b4cbca 100644 --- a/lib/api/helpers/runner.rb +++ b/lib/api/helpers/runner.rb @@ -9,16 +9,22 @@ module API Gitlab::CurrentSettings.runners_registration_token) end - def get_runner_version_from_params - return unless params['info'].present? + def authenticate_runner! + forbidden! unless current_runner - attributes_for_keys(%w(name version revision platform architecture), params['info']) + current_runner + .update_cached_info(get_runner_details_from_request) end - def authenticate_runner! - forbidden! unless current_runner + def get_runner_details_from_request + return get_runner_ip unless params['info'].present? + + attributes_for_keys(%w(name version revision platform architecture), params['info']) + .merge(get_runner_ip) + end - current_runner.update_cached_info(get_runner_version_from_params) + def get_runner_ip + { ip_address: request.ip } end def current_runner |