diff options
Diffstat (limited to 'app/models/serverless/lookup_path.rb')
-rw-r--r-- | app/models/serverless/lookup_path.rb | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/app/models/serverless/lookup_path.rb b/app/models/serverless/lookup_path.rb new file mode 100644 index 00000000000..c09b3718651 --- /dev/null +++ b/app/models/serverless/lookup_path.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +module Serverless + class LookupPath + attr_reader :serverless_domain + + delegate :serverless_domain_cluster, to: :serverless_domain + delegate :knative, to: :serverless_domain_cluster + delegate :certificate, to: :serverless_domain_cluster + delegate :key, to: :serverless_domain_cluster + + def initialize(serverless_domain) + @serverless_domain = serverless_domain + end + + def source + { + type: 'serverless', + service: serverless_domain.knative_uri.host, + cluster: { + hostname: knative.hostname, + address: knative.external_ip, + port: 443, + cert: certificate, + key: key + } + } + end + end +end |