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
0aeef733
Commit
0aeef733
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
c40a99a0
Changes
3
Hide 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 @
0aeef733
...
@@ -10,7 +10,7 @@ module Clusters
...
@@ -10,7 +10,7 @@ module Clusters
::
Feature
.
enabled?
(
feature
,
default_enabled:
true
)
::
Feature
.
enabled?
(
feature
,
default_enabled:
true
)
end
end
def
instance_clusters_
enabled?
def
self
.
enabled?
::
Feature
.
enabled?
(
:instance_clusters
,
default_enabled:
true
)
::
Feature
.
enabled?
(
:instance_clusters
,
default_enabled:
true
)
end
end
end
end
...
...
app/models/concerns/deployment_platform.rb
View file @
0aeef733
...
@@ -38,7 +38,7 @@ module DeploymentPlatform
...
@@ -38,7 +38,7 @@ module DeploymentPlatform
end
end
def
find_instance_cluster_platform_kubernetes_with_feature_guard
(
environment:
nil
)
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
)
find_instance_cluster_platform_kubernetes
(
environment:
environment
)
end
end
...
@@ -49,10 +49,6 @@ module DeploymentPlatform
...
@@ -49,10 +49,6 @@ module DeploymentPlatform
.
first
&
.
platform_kubernetes
.
first
&
.
platform_kubernetes
end
end
def
instance_clusters_enabled?
Feature
.
enabled?
(
:instance_clusters
,
default_enabled:
true
)
end
def
find_kubernetes_service_integration
def
find_kubernetes_service_integration
services
.
deployment
.
reorder
(
nil
).
find_by
(
active:
true
)
services
.
deployment
.
reorder
(
nil
).
find_by
(
active:
true
)
end
end
...
...
app/policies/clusters/instance_policy.rb
View file @
0aeef733
...
@@ -6,7 +6,7 @@ module Clusters
...
@@ -6,7 +6,7 @@ module Clusters
condition
(
:has_clusters
,
scope: :subject
)
{
clusterable_has_clusters?
}
condition
(
:has_clusters
,
scope: :subject
)
{
clusterable_has_clusters?
}
condition
(
:can_have_multiple_clusters
)
{
multiple_clusters_available?
}
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
rule
{
admin
&
instance_clusters_enabled
}.
policy
do
enable
:read_cluster
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