diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-24 15:09:00 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-24 15:09:00 +0300 |
commit | ae78b85a25cb0c19c3d6a2e4e6c7ca91ed50787d (patch) | |
tree | c53ad0fcdab26725814f1dc5267f6a04ebe4cf73 /app/models | |
parent | 38149afcf95e7669a7a99828c579d185b70c04dc (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/serverless/lookup_path.rb | 30 | ||||
-rw-r--r-- | app/models/serverless/virtual_domain.rb | 22 |
2 files changed, 52 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 diff --git a/app/models/serverless/virtual_domain.rb b/app/models/serverless/virtual_domain.rb new file mode 100644 index 00000000000..d6a23a4c0ce --- /dev/null +++ b/app/models/serverless/virtual_domain.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Serverless + class VirtualDomain + attr_reader :serverless_domain + + delegate :serverless_domain_cluster, to: :serverless_domain + delegate :pages_domain, to: :serverless_domain_cluster + delegate :certificate, to: :pages_domain + delegate :key, to: :pages_domain + + def initialize(serverless_domain) + @serverless_domain = serverless_domain + end + + def lookup_paths + [ + ::Serverless::LookupPath.new(serverless_domain) + ] + end + end +end |