From 73d0cafbe4acf5a14ec196c3cfb38be4e84b67d9 Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Fri, 1 Sep 2017 12:58:22 +0200 Subject: Check if service active when using CI/CD kubernetes policy --- app/models/ci/pipeline.rb | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'app') 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? -- cgit v1.2.1