diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-09-01 12:58:22 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-09-01 12:58:22 +0200 |
commit | 73d0cafbe4acf5a14ec196c3cfb38be4e84b67d9 (patch) | |
tree | 27e4388bda4234b80832d31c715379ce2ddf05b7 /app | |
parent | dc4d938676414579ad8cfca9689439668c90b411 (diff) | |
download | gitlab-ce-73d0cafbe4acf5a14ec196c3cfb38be4e84b67d9.tar.gz |
Check if service active when using CI/CD kubernetes policy
Diffstat (limited to 'app')
-rw-r--r-- | app/models/ci/pipeline.rb | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb index 65e542106e3..46e5c344fdc 100644 --- a/app/models/ci/pipeline.rb +++ b/app/models/ci/pipeline.rb @@ -304,19 +304,8 @@ module Ci @stage_seeds ||= config_processor.stage_seeds(self) end - def context_variables - @context_variables ||= project.secret_variables_for(ref: ref).to_a - .map(&:to_runner_variable) + project.deployment_variables.to_a - end - - def has_kubernetes_available? - kubernetes_variables = context_variables.select do |variable| - variable.fetch(:key).in?(%w[KUBECONFIG KUBE_DOMAIN]) - end - - return false if kubernetes_variables.empty? - - kubernetes_variables.map { |var| var.fetch(:value).present? }.all? + def has_kubernetes_active? + project.kubernetes_service&.active? end def has_stage_seeds? |