Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-05-05 18:10:05 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-05-05 18:10:05 +0300
commitcf05fd7f3956f0b1a17caf313e89bb7b3315d947 (patch)
tree8d847ad538180a03a6a25e7ee81605d2f86358d5 /lib/gitlab/kas.rb
parent023e050d82ed11d9060ce5bdaec99c3871b98164 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/kas.rb')
-rw-r--r--lib/gitlab/kas.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/gitlab/kas.rb b/lib/gitlab/kas.rb
index 7a674cb5c21..7b2c792ebca 100644
--- a/lib/gitlab/kas.rb
+++ b/lib/gitlab/kas.rb
@@ -3,6 +3,7 @@
module Gitlab
module Kas
INTERNAL_API_REQUEST_HEADER = 'Gitlab-Kas-Api-Request'
+ VERSION_FILE = 'GITLAB_KAS_VERSION'
JWT_ISSUER = 'gitlab-kas'
include JwtAuthenticatable
@@ -29,6 +30,27 @@ module Gitlab
Feature.enabled?(:kubernetes_agent_on_gitlab_com, project, default_enabled: :yaml)
end
+
+ # Return GitLab KAS version
+ #
+ # @return [String] version
+ def version
+ @_version ||= Rails.root.join(VERSION_FILE).read.chomp
+ end
+
+ # Return GitLab KAS external_url
+ #
+ # @return [String] external_url
+ def external_url
+ Gitlab.config.gitlab_kas.external_url
+ end
+
+ # Return whether GitLab KAS is enabled
+ #
+ # @return [Boolean] external_url
+ def enabled?
+ !!Gitlab.config['gitlab_kas']&.fetch('enabled', false)
+ end
end
end
end