diff options
author | James Fargher <proglottis@gmail.com> | 2019-04-10 05:13:43 +0300 |
---|---|---|
committer | James Fargher <proglottis@gmail.com> | 2019-05-06 23:37:03 +0300 |
commit | 733da6d6a015e8c951dcc02250cfe1fab87789c0 (patch) | |
tree | 6be40311a4753767d7219f2cff21c4eccbe18a5f /app/models | |
parent | 863f2bcfb6ef7c6d3ce5726fa1a602e12f05ef57 (diff) |
Instance level kubernetes clusters admin
Instance level clusters were already mostly supported, this change adds
admin area controllers for cluster CRUD
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/clusters/applications/runner.rb | 6 | ||||
-rw-r--r-- | app/models/clusters/cluster.rb | 4 | ||||
-rw-r--r-- | app/models/clusters/instance.rb | 11 |
3 files changed, 19 insertions, 2 deletions
diff --git a/app/models/clusters/applications/runner.rb b/app/models/clusters/applications/runner.rb index af648db3708..ceecd931bba 100644 --- a/app/models/clusters/applications/runner.rb +++ b/app/models/clusters/applications/runner.rb @@ -69,10 +69,12 @@ module Clusters } if cluster.group_type? - attributes.merge(groups: [group]) + attributes[:groups] = [group] elsif cluster.project_type? - attributes.merge(projects: [project]) + attributes[:projects] = [project] end + + attributes end def gitlab_url diff --git a/app/models/clusters/cluster.rb b/app/models/clusters/cluster.rb index d2b1adacbfb..7220159ac95 100644 --- a/app/models/clusters/cluster.rb +++ b/app/models/clusters/cluster.rb @@ -177,6 +177,10 @@ module Clusters end alias_method :group, :first_group + def instance + Instance.new if instance_type? + end + def kubeclient platform_kubernetes.kubeclient if kubernetes? end diff --git a/app/models/clusters/instance.rb b/app/models/clusters/instance.rb new file mode 100644 index 00000000000..fde83c5a8ad --- /dev/null +++ b/app/models/clusters/instance.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class Clusters::Instance + def clusters + Clusters::Cluster.instance_type + end + + def feature_available?(feature) + ::Feature.enabled?(feature, default_enabled: true) + end +end |