summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2018-05-08 08:14:35 +0000
committerKamil Trzciński <ayufan@ayufan.eu>2018-05-08 08:14:35 +0000
commita0920df2918d5f36f9f3bfd470e0c3c396534527 (patch)
tree350894885ca4f5586199a21aee6a30fe45010a65
parent0a46bf70b658e0a63fe980b77d215c8a9f4f4dc5 (diff)
parented408034c090ce1a1a221c34bbacce1b3264ed95 (diff)
downloadgitlab-ce-a0920df2918d5f36f9f3bfd470e0c3c396534527.tar.gz
Merge branch 'feature-expose-runner-ip-to-api' into 'master'
Expose runner ip address to runners API Closes #46102 See merge request gitlab-org/gitlab-ce!18799
-rw-r--r--changelogs/unreleased/feature-expose-runner-ip-to-api.yml5
-rw-r--r--lib/api/entities.rb1
-rw-r--r--spec/requests/api/runners_spec.rb5
3 files changed, 11 insertions, 0 deletions
diff --git a/changelogs/unreleased/feature-expose-runner-ip-to-api.yml b/changelogs/unreleased/feature-expose-runner-ip-to-api.yml
new file mode 100644
index 00000000000..e755cf5f2d4
--- /dev/null
+++ b/changelogs/unreleased/feature-expose-runner-ip-to-api.yml
@@ -0,0 +1,5 @@
+---
+title: Expose runner ip address to runners API
+merge_request: 18799
+author: Lars Greiss
+type: changed
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index a9bab5c56cf..25d78fc761d 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -967,6 +967,7 @@ module API
class Runner < Grape::Entity
expose :id
expose :description
+ expose :ip_address
expose :active
expose :is_shared
expose :name
diff --git a/spec/requests/api/runners_spec.rb b/spec/requests/api/runners_spec.rb
index f22fec31514..981ac768e3a 100644
--- a/spec/requests/api/runners_spec.rb
+++ b/spec/requests/api/runners_spec.rb
@@ -46,6 +46,7 @@ describe API::Runners do
expect(response).to have_gitlab_http_status(200)
expect(response).to include_pagination_headers
expect(json_response).to be_an Array
+ expect(json_response[0]).to have_key('ip_address')
expect(descriptions).to contain_exactly(
'Project runner', 'Two projects runner'
)
@@ -59,6 +60,7 @@ describe API::Runners do
expect(response).to have_gitlab_http_status(200)
expect(response).to include_pagination_headers
expect(json_response).to be_an Array
+ expect(json_response[0]).to have_key('ip_address')
expect(shared).to be_falsey
end
@@ -87,6 +89,7 @@ describe API::Runners do
expect(response).to have_gitlab_http_status(200)
expect(response).to include_pagination_headers
expect(json_response).to be_an Array
+ expect(json_response[0]).to have_key('ip_address')
expect(shared).to be_truthy
end
end
@@ -106,6 +109,7 @@ describe API::Runners do
expect(response).to have_gitlab_http_status(200)
expect(response).to include_pagination_headers
expect(json_response).to be_an Array
+ expect(json_response[0]).to have_key('ip_address')
expect(shared).to be_falsey
end
@@ -515,6 +519,7 @@ describe API::Runners do
expect(response).to have_gitlab_http_status(200)
expect(response).to include_pagination_headers
expect(json_response).to be_an Array
+ expect(json_response[0]).to have_key('ip_address')
expect(shared).to be_truthy
end
end