2020-11-30 13:09:46 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class RolloutStatusEntity < Grape::Entity
|
|
|
|
include RequestAwareEntity
|
|
|
|
|
|
|
|
expose :status, as: :status
|
|
|
|
|
|
|
|
# To be removed in API v5
|
|
|
|
expose :has_legacy_app_label do |_rollout_status|
|
|
|
|
false
|
|
|
|
end
|
|
|
|
|
|
|
|
expose :instances, if: -> (rollout_status, _) { rollout_status.found? }
|
|
|
|
expose :completion, if: -> (rollout_status, _) { rollout_status.found? }
|
|
|
|
expose :complete?, as: :is_completed, if: -> (rollout_status, _) { rollout_status.found? }
|
|
|
|
expose :canary_ingress, using: RolloutStatuses::IngressEntity, expose_nil: false,
|
2022-08-02 02:10:49 -04:00
|
|
|
if: -> (rollout_status, _) { rollout_status.found? && rollout_status.canary_ingress_exists? }
|
2020-11-30 13:09:46 -05:00
|
|
|
end
|