Class: Gitlab::Ci::Build::Policy::Kubernetes

Inherits:
Specification show all
Defined in:
lib/gitlab/ci/build/policy/kubernetes.rb

Constant Summary

Constants inherited from Specification

Specification::UnknownPolicyError

Instance Method Summary collapse

Constructor Details

#initialize(spec) ⇒ Kubernetes

Returns a new instance of Kubernetes.


8
9
10
11
12
# File 'lib/gitlab/ci/build/policy/kubernetes.rb', line 8

def initialize(spec)
  unless spec.to_sym == :active
    raise UnknownPolicyError
  end
end

Instance Method Details

#satisfied_by?(pipeline, context = nil) ⇒ Boolean

Returns:

  • (Boolean)

14
15
16
# File 'lib/gitlab/ci/build/policy/kubernetes.rb', line 14

def satisfied_by?(pipeline, context = nil)
  pipeline.has_kubernetes_active?
end