summaryrefslogtreecommitdiff
path: root/app/serializers
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2016-11-22 19:55:56 +0000
committerNick Thomas <nick@gitlab.com>2016-12-19 19:53:04 +0000
commitc3d972f4e861059312c2708dacb57999416fcc70 (patch)
tree977d60c01a81da4157aa1961b244e9967c9168ee /app/serializers
parent5378302763e1a461bab5213aa379d5b9e6dc322c (diff)
downloadgitlab-ce-c3d972f4e861059312c2708dacb57999416fcc70.tar.gz
Add terminals to the Kubernetes deployment service
Diffstat (limited to 'app/serializers')
-rw-r--r--app/serializers/environment_entity.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/serializers/environment_entity.rb b/app/serializers/environment_entity.rb
index 7e0fc9c071e..e7ef01258ef 100644
--- a/app/serializers/environment_entity.rb
+++ b/app/serializers/environment_entity.rb
@@ -8,6 +8,7 @@ class EnvironmentEntity < Grape::Entity
expose :environment_type
expose :last_deployment, using: DeploymentEntity
expose :stoppable?
+ expose :has_terminals?, as: :has_terminals
expose :environment_path do |environment|
namespace_project_environment_path(
@@ -23,5 +24,12 @@ class EnvironmentEntity < Grape::Entity
environment)
end
+ expose :terminal_path, if: ->(environment, _) { environment.has_terminals? } do |environment|
+ terminal_namespace_project_environment_path(
+ environment.project.namespace,
+ environment.project,
+ environment)
+ end
+
expose :created_at, :updated_at
end