diff options
Diffstat (limited to 'app/models/clusters/concerns')
-rw-r--r-- | app/models/clusters/concerns/application_core.rb | 11 | ||||
-rw-r--r-- | app/models/clusters/concerns/application_data.rb | 2 |
2 files changed, 12 insertions, 1 deletions
diff --git a/app/models/clusters/concerns/application_core.rb b/app/models/clusters/concerns/application_core.rb index 760576ea1eb..b82b1887308 100644 --- a/app/models/clusters/concerns/application_core.rb +++ b/app/models/clusters/concerns/application_core.rb @@ -12,6 +12,17 @@ module Clusters after_initialize :set_initial_status + def helm_command_module + case cluster.helm_major_version + when 3 + Gitlab::Kubernetes::Helm::V3 + when 2 + Gitlab::Kubernetes::Helm::V2 + else + raise "Invalid Helm major version" + end + end + def set_initial_status return unless not_installable? diff --git a/app/models/clusters/concerns/application_data.rb b/app/models/clusters/concerns/application_data.rb index 22e597e9747..00aeb7669ad 100644 --- a/app/models/clusters/concerns/application_data.rb +++ b/app/models/clusters/concerns/application_data.rb @@ -4,7 +4,7 @@ module Clusters module Concerns module ApplicationData def uninstall_command - Gitlab::Kubernetes::Helm::DeleteCommand.new( + helm_command_module::DeleteCommand.new( name: name, rbac: cluster.platform_kubernetes_rbac?, files: files |