Commit df1bccce authored by Thong Kuah's avatar Thong Kuah

Refactor to not copy from original method

Instead we can call the original method if the cluster is RBAC. The
original method already checks if helm is available, and that it is not
not_installable
parent 27843532
...@@ -17,11 +17,11 @@ module Clusters ...@@ -17,11 +17,11 @@ module Clusters
include ::Clusters::Concerns::ApplicationData include ::Clusters::Concerns::ApplicationData
include AfterCommitQueue include AfterCommitQueue
alias_method :original_set_initial_status, :set_initial_status
def set_initial_status def set_initial_status
return unless not_installable? return unless cluster&.platform_kubernetes_rbac?
return unless verify_cluster?
self.status = status_states[:installable] original_set_initial_status
end end
state_machine :status do state_machine :status do
...@@ -131,10 +131,6 @@ module Clusters ...@@ -131,10 +131,6 @@ module Clusters
[Gitlab::Kubernetes::KubectlCmd.delete("--ignore-not-found", "-f", METRICS_CONFIG)] [Gitlab::Kubernetes::KubectlCmd.delete("--ignore-not-found", "-f", METRICS_CONFIG)]
end end
def verify_cluster?
cluster&.application_helm_available? && cluster&.platform_kubernetes_rbac?
end
end end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment