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
188dece9
Commit
188dece9
authored
Mar 29, 2021
by
Thong Kuah
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show cluster agents UI only when enabled on GitLab.com
No change for self-managed
parent
a853e5ad
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
15 deletions
+34
-15
config/feature_flags/development/cluster_agent_list.yml
config/feature_flags/development/cluster_agent_list.yml
+0
-8
ee/app/helpers/ee/clusters_helper.rb
ee/app/helpers/ee/clusters_helper.rb
+6
-2
ee/changelogs/unreleased/show_project_kubernetes_agent_on_gitlab_com_state.yml
...sed/show_project_kubernetes_agent_on_gitlab_com_state.yml
+5
-0
ee/spec/helpers/ee/clusters_helper_spec.rb
ee/spec/helpers/ee/clusters_helper_spec.rb
+22
-4
lib/gitlab/kas.rb
lib/gitlab/kas.rb
+1
-1
No files found.
config/feature_flags/development/cluster_agent_list.yml
deleted
100644 → 0
View file @
a853e5ad
---
name
:
cluster_agent_list
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/42115
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/249596
milestone
:
'
13.5'
type
:
development
group
:
group::configure
default_enabled
:
true
ee/app/helpers/ee/clusters_helper.rb
View file @
188dece9
...
...
@@ -6,9 +6,13 @@ module EE
override
:display_cluster_agents?
def
display_cluster_agents?
(
clusterable
)
return
unless
::
Feature
.
enabled?
(
:cluster_agent_list
,
default_enabled:
true
)
clusterable
.
is_a?
(
Project
)
&&
clusterable
.
feature_available?
(
:cluster_agents
)
&&
included_in_gitlab_com_rollout?
(
clusterable
)
end
private
clusterable
.
is_a?
(
Project
)
&&
clusterable
.
feature_available?
(
:cluster_agents
)
def
included_in_gitlab_com_rollout?
(
project
)
::
Gitlab
::
Kas
.
included_in_gitlab_com_rollout?
(
project
)
end
end
end
ee/changelogs/unreleased/show_project_kubernetes_agent_on_gitlab_com_state.yml
0 → 100644
View file @
188dece9
---
title
:
Hide cluster agent UI if not enabled on GitLab.com
merge_request
:
57668
author
:
type
:
changed
ee/spec/helpers/ee/clusters_helper_spec.rb
View file @
188dece9
...
...
@@ -16,6 +16,8 @@ RSpec.describe ClustersHelper do
context
'with premium license'
do
before
do
allow
(
Gitlab
).
to
receive
(
:com?
).
and_return
(
false
)
stub_licensed_features
(
cluster_agents:
true
)
end
...
...
@@ -33,15 +35,31 @@ RSpec.describe ClustersHelper do
end
end
context
'when cluster_agent_list feature flag is disabled'
do
context
'GitLab.com'
do
before
do
allow
(
Gitlab
).
to
receive
(
:com?
).
and_return
(
true
)
end
context
'when kubernetes_agent_on_gitlab_com feature flag is disabled'
do
before
do
stub_feature_flags
(
cluster_agent_list
:
false
)
stub_feature_flags
(
kubernetes_agent_on_gitlab_com
:
false
)
end
it
'does not allows agents to display'
do
expect
(
subject
).
to
be_falsey
end
end
context
'kubernetes_agent_on_gitlab_com feature flag enabled'
do
before
do
stub_feature_flags
(
kubernetes_agent_on_gitlab_com:
clusterable
)
end
it
'allows agents to display'
do
expect
(
subject
).
to
be_truthy
end
end
end
end
end
end
lib/gitlab/kas.rb
View file @
188dece9
...
...
@@ -27,7 +27,7 @@ module Gitlab
def
included_in_gitlab_com_rollout?
(
project
)
return
true
unless
::
Gitlab
.
com?
Feature
.
enabled?
(
:kubernetes_agent_on_gitlab_com
,
project
)
Feature
.
enabled?
(
:kubernetes_agent_on_gitlab_com
,
project
,
default_enabled: :yaml
)
end
end
end
...
...
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