Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
d14e37d3
Commit
d14e37d3
authored
May 03, 2019
by
James Fargher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert instance level clusters enabled to class method
parent
b2d18ab0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
7 deletions
+3
-7
app/models/clusters/instance.rb
app/models/clusters/instance.rb
+1
-1
app/models/concerns/deployment_platform.rb
app/models/concerns/deployment_platform.rb
+1
-5
app/policies/clusters/instance_policy.rb
app/policies/clusters/instance_policy.rb
+1
-1
No files found.
app/models/clusters/instance.rb
View file @
d14e37d3
...
...
@@ -10,7 +10,7 @@ module Clusters
::
Feature
.
enabled?
(
feature
,
default_enabled:
true
)
end
def
instance_clusters_
enabled?
def
self
.
enabled?
::
Feature
.
enabled?
(
:instance_clusters
,
default_enabled:
true
)
end
end
...
...
app/models/concerns/deployment_platform.rb
View file @
d14e37d3
...
...
@@ -38,7 +38,7 @@ module DeploymentPlatform
end
def
find_instance_cluster_platform_kubernetes_with_feature_guard
(
environment:
nil
)
return
unless
instance_clusters_
enabled?
return
unless
Clusters
::
Instance
.
enabled?
find_instance_cluster_platform_kubernetes
(
environment:
environment
)
end
...
...
@@ -49,10 +49,6 @@ module DeploymentPlatform
.
first
&
.
platform_kubernetes
end
def
instance_clusters_enabled?
Feature
.
enabled?
(
:instance_clusters
,
default_enabled:
true
)
end
def
find_kubernetes_service_integration
services
.
deployment
.
reorder
(
nil
).
find_by
(
active:
true
)
end
...
...
app/policies/clusters/instance_policy.rb
View file @
d14e37d3
...
...
@@ -6,7 +6,7 @@ module Clusters
condition
(
:has_clusters
,
scope: :subject
)
{
clusterable_has_clusters?
}
condition
(
:can_have_multiple_clusters
)
{
multiple_clusters_available?
}
condition
(
:instance_clusters_enabled
,
scope: :subject
)
{
@subject
.
instance_clusters_
enabled?
}
condition
(
:instance_clusters_enabled
)
{
Instance
.
enabled?
}
rule
{
admin
&
instance_clusters_enabled
}.
policy
do
enable
:read_cluster
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment