2019-03-03 18:56:20 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Gitlab
|
|
|
|
module Ci
|
|
|
|
module Build
|
|
|
|
module Prerequisite
|
|
|
|
class Factory
|
|
|
|
attr_reader :build
|
|
|
|
|
|
|
|
def self.prerequisites
|
2019-03-03 19:00:40 -05:00
|
|
|
[KubernetesNamespace]
|
2019-03-03 18:56:20 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def initialize(build)
|
|
|
|
@build = build
|
|
|
|
end
|
|
|
|
|
|
|
|
def unmet
|
|
|
|
build_prerequisites.select(&:unmet?)
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def build_prerequisites
|
|
|
|
self.class.prerequisites.map do |prerequisite|
|
|
|
|
prerequisite.new(build)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|