Class: Clusters::Applications::Runner

Inherits:
ApplicationRecord show all
Includes:
Concerns::ApplicationCore, Concerns::ApplicationData, Concerns::ApplicationStatus, Concerns::ApplicationVersion
Defined in:
app/models/clusters/applications/runner.rb

Constant Summary collapse

VERSION =
'0.20.1'

Instance Method Summary collapse

Methods included from Concerns::ApplicationData

#files, #uninstall_command

Methods included from Concerns::ApplicationVersion

#update_available?

Methods included from Concerns::ApplicationStatus

#available?, #status_states, #update_in_progress?, #updateable?

Methods inherited from ApplicationRecord

at_most, id_in, id_not_in, iid_in, pluck_primary_key, primary_key_in, safe_ensure_unique, safe_find_or_create_by, safe_find_or_create_by!, underscore, without_order

Instance Method Details

#chartObject


20
21
22
# File 'app/models/clusters/applications/runner.rb', line 20

def chart
  "#{name}/gitlab-runner"
end

#install_commandObject


32
33
34
35
36
37
38
39
40
41
# File 'app/models/clusters/applications/runner.rb', line 32

def install_command
  Gitlab::Kubernetes::Helm::InstallCommand.new(
    name: name,
    version: VERSION,
    rbac: cluster.platform_kubernetes_rbac?,
    chart: chart,
    files: files,
    repository: repository
  )
end

#post_uninstallObject


47
48
49
# File 'app/models/clusters/applications/runner.rb', line 47

def post_uninstall
  runner.destroy!
end

#prepare_uninstallObject


43
44
45
# File 'app/models/clusters/applications/runner.rb', line 43

def prepare_uninstall
  runner&.update!(active: false)
end

#repositoryObject


24
25
26
# File 'app/models/clusters/applications/runner.rb', line 24

def repository
  'https://charts.gitlab.io'
end

#valuesObject


28
29
30
# File 'app/models/clusters/applications/runner.rb', line 28

def values
  content_values.to_yaml
end