summaryrefslogtreecommitdiff
path: root/app/models/clusters/applications
diff options
context:
space:
mode:
authorChris Baumbauer <cab@cabnetworks.net>2018-12-13 07:39:44 -0800
committerChris Baumbauer <cab@cabnetworks.net>2019-01-04 14:53:39 -0800
commit47cb5a2641e840bca4f7fc15d93d78b2a6fca306 (patch)
tree06c84ec084ff71d952cb44582ad8a15bf1723c30 /app/models/clusters/applications
parentb97b85c37e77e5d37705cb2d3a60161896585420 (diff)
downloadgitlab-ce-47cb5a2641e840bca4f7fc15d93d78b2a6fca306.tar.gz
Require Knative to be installed only on an RBAC kubernetes cluster
Diffstat (limited to 'app/models/clusters/applications')
-rw-r--r--app/models/clusters/applications/knative.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/models/clusters/applications/knative.rb b/app/models/clusters/applications/knative.rb
index 0a3168afe68..c572c8bff44 100644
--- a/app/models/clusters/applications/knative.rb
+++ b/app/models/clusters/applications/knative.rb
@@ -19,6 +19,13 @@ module Clusters
self.reactive_cache_key = ->(knative) { [knative.class.model_name.singular, knative.id] }
+ def set_initial_status
+ return unless not_installable?
+ return unless verify_cluster?
+
+ self.status = 'installable'
+ end
+
state_machine :status do
after_transition any => [:installed] do |application|
application.run_after_commit do
@@ -99,6 +106,10 @@ module Clusters
def install_knative_metrics
["kubectl apply -f #{METRICS_CONFIG}"] if cluster.application_prometheus_available?
end
+
+ def verify_cluster?
+ cluster&.application_helm_available? && cluster&.platform_kubernetes_rbac?
+ end
end
end
end