diff options
Diffstat (limited to 'app/finders/serverless_domain_finder.rb')
-rw-r--r-- | app/finders/serverless_domain_finder.rb | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/app/finders/serverless_domain_finder.rb b/app/finders/serverless_domain_finder.rb deleted file mode 100644 index 661cd0ca363..00000000000 --- a/app/finders/serverless_domain_finder.rb +++ /dev/null @@ -1,35 +0,0 @@ -# frozen_string_literal: true - -class ServerlessDomainFinder - attr_reader :match, :serverless_domain_cluster, :environment - - def initialize(uri) - @match = ::Serverless::Domain::REGEXP.match(uri) - end - - def execute - return unless serverless? - - @serverless_domain_cluster = ::Serverless::DomainCluster.for_uuid(serverless_domain_cluster_uuid) - return unless serverless_domain_cluster&.knative&.external_ip - - @environment = ::Environment.for_id_and_slug(match[:environment_id].to_i(16), match[:environment_slug]) - return unless environment - - ::Serverless::Domain.new( - function_name: match[:function_name], - serverless_domain_cluster: serverless_domain_cluster, - environment: environment - ) - end - - def serverless_domain_cluster_uuid - return unless serverless? - - match[:cluster_left] + match[:cluster_middle] + match[:cluster_right] - end - - def serverless? - !!match - end -end |