98a14a498d
Builds that have deployments require Kubernetes resources to be created before the build can be deployed. These resources are no longer created when the cluster is created, which allows us to only create the resources required by each specific build.
33 lines
612 B
Ruby
33 lines
612 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Gitlab
|
|
module Ci
|
|
module Build
|
|
module Prerequisite
|
|
class Factory
|
|
attr_reader :build
|
|
|
|
def self.prerequisites
|
|
[KubernetesNamespace]
|
|
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
|