2019-11-17 22:06:28 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Clusters
|
|
|
|
module Applications
|
2021-02-16 04:09:36 -05:00
|
|
|
# DEPRECATED for removal in %14.0
|
|
|
|
# See https://gitlab.com/groups/gitlab-org/-/epics/4280
|
2019-11-17 22:06:28 -05:00
|
|
|
class Crossplane < ApplicationRecord
|
|
|
|
VERSION = '0.4.1'
|
|
|
|
|
|
|
|
self.table_name = 'clusters_applications_crossplane'
|
|
|
|
|
|
|
|
include ::Clusters::Concerns::ApplicationCore
|
|
|
|
include ::Clusters::Concerns::ApplicationStatus
|
|
|
|
include ::Clusters::Concerns::ApplicationVersion
|
|
|
|
include ::Clusters::Concerns::ApplicationData
|
|
|
|
|
|
|
|
default_value_for :version, VERSION
|
|
|
|
|
|
|
|
default_value_for :stack do |crossplane|
|
|
|
|
''
|
|
|
|
end
|
|
|
|
|
|
|
|
validates :stack, presence: true
|
|
|
|
|
|
|
|
def chart
|
|
|
|
'crossplane/crossplane'
|
|
|
|
end
|
|
|
|
|
|
|
|
def repository
|
|
|
|
'https://charts.crossplane.io/alpha'
|
|
|
|
end
|
|
|
|
|
|
|
|
def install_command
|
2020-11-05 04:09:00 -05:00
|
|
|
helm_command_module::InstallCommand.new(
|
2019-11-17 22:06:28 -05:00
|
|
|
name: 'crossplane',
|
|
|
|
repository: repository,
|
|
|
|
version: VERSION,
|
|
|
|
rbac: cluster.platform_kubernetes_rbac?,
|
|
|
|
chart: chart,
|
2020-08-09 23:09:44 -04:00
|
|
|
files: files
|
2019-11-17 22:06:28 -05:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
def values
|
|
|
|
crossplane_values.to_yaml
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def crossplane_values
|
|
|
|
{
|
|
|
|
"clusterStacks" => {
|
|
|
|
self.stack => {
|
2020-03-15 20:09:20 -04:00
|
|
|
"deploy" => true
|
2019-11-17 22:06:28 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|