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
518cb413
Commit
518cb413
authored
Jan 29, 2020
by
Adrien Kohlbecker
Committed by
Natalia Tepluhina
Jan 29, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove Elastic Stack cluster app feature flag
Enable the app by default
parent
6b832922
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
82 additions
and
218 deletions
+82
-218
app/assets/javascripts/clusters/components/applications.vue
app/assets/javascripts/clusters/components/applications.vue
+0
-4
app/controllers/clusters/clusters_controller.rb
app/controllers/clusters/clusters_controller.rb
+0
-3
app/services/clusters/applications/base_service.rb
app/services/clusters/applications/base_service.rb
+1
-5
changelogs/unreleased/ak-remove-es-ff.yml
changelogs/unreleased/ak-remove-es-ff.yml
+5
-0
doc/user/clusters/applications.md
doc/user/clusters/applications.md
+1
-12
ee/app/assets/javascripts/logs/components/environment_logs.vue
...p/assets/javascripts/logs/components/environment_logs.vue
+46
-54
ee/app/controllers/projects/logs_controller.rb
ee/app/controllers/projects/logs_controller.rb
+0
-3
ee/app/models/ee/clusters/platforms/kubernetes.rb
ee/app/models/ee/clusters/platforms/kubernetes.rb
+1
-1
ee/spec/frontend/logs/components/environment_logs_spec.js
ee/spec/frontend/logs/components/environment_logs_spec.js
+28
-132
ee/spec/models/ee/clusters/platforms/kubernetes_spec.rb
ee/spec/models/ee/clusters/platforms/kubernetes_spec.rb
+0
-1
spec/frontend/clusters/components/applications_spec.js
spec/frontend/clusters/components/applications_spec.js
+0
-3
No files found.
app/assets/javascripts/clusters/components/applications.vue
View file @
518cb413
...
...
@@ -129,9 +129,6 @@ export default {
crossplaneInstalled
()
{
return
this
.
applications
.
crossplane
.
status
===
APPLICATION_STATUS
.
INSTALLED
;
},
enableClusterApplicationElasticStack
()
{
return
gon
.
features
&&
gon
.
features
.
enableClusterApplicationElasticStack
;
},
ingressModSecurityDescription
()
{
const
escapedUrl
=
_
.
escape
(
this
.
ingressModSecurityHelpPath
);
...
...
@@ -655,7 +652,6 @@ Crossplane runs inside your Kubernetes cluster and supports secure connectivity
</div>
</application-row>
<application-row
v-if=
"enableClusterApplicationElasticStack"
id=
"elastic_stack"
:logo-url=
"elasticStackLogo"
:title=
"applications.elastic_stack.title"
...
...
app/controllers/clusters/clusters_controller.rb
View file @
518cb413
...
...
@@ -12,9 +12,6 @@ class Clusters::ClustersController < Clusters::BaseController
before_action
:authorize_update_cluster!
,
only:
[
:update
]
before_action
:authorize_admin_cluster!
,
only:
[
:destroy
,
:clear_cache
]
before_action
:update_applications_status
,
only:
[
:cluster_status
]
before_action
only:
[
:show
]
do
push_frontend_feature_flag
(
:enable_cluster_application_elastic_stack
)
end
helper_method
:token_in_session
...
...
app/services/clusters/applications/base_service.rb
View file @
518cb413
...
...
@@ -58,7 +58,7 @@ module Clusters
end
def
instantiate_application
raise_invalid_application_error
if
invalid
_application?
raise_invalid_application_error
if
unknown
_application?
builder
||
raise
(
InvalidApplicationError
,
"invalid application:
#{
application_name
}
"
)
end
...
...
@@ -67,10 +67,6 @@ module Clusters
raise
(
InvalidApplicationError
,
"invalid application:
#{
application_name
}
"
)
end
def
invalid_application?
unknown_application?
||
(
application_name
==
Applications
::
ElasticStack
.
application_name
&&
!
Feature
.
enabled?
(
:enable_cluster_application_elastic_stack
))
end
def
unknown_application?
Clusters
::
Cluster
::
APPLICATIONS
.
keys
.
exclude?
(
application_name
)
end
...
...
changelogs/unreleased/ak-remove-es-ff.yml
0 → 100644
View file @
518cb413
---
title
:
Add new Elastic Stack cluster application for pod log aggregation
merge_request
:
23058
author
:
type
:
added
doc/user/clusters/applications.md
View file @
518cb413
...
...
@@ -435,18 +435,7 @@ and you will have access to more advanced querying capabilities.
Log data is automatically deleted after 15 days using
[
Curator
](
https://www.elastic.co/guide/en/elasticsearch/client/curator/5.5/about.html
)
.
This is a preliminary release of Elastic Stack as a GitLab-managed application. By default,
the ability to install it is disabled.
To allow installation of Elastic Stack as a GitLab-managed application, ask a GitLab
administrator to run following command within a Rails console:
```
ruby
Feature
.
enable
(
:enable_cluster_application_elastic_stack
)
```
Once the feature flag is set, to enable log shipping, install Elastic Stack into the cluster with the
**Install**
button.
To enable log shipping, install Elastic Stack into the cluster with the
**Install**
button.
NOTE:
**Note:**
The
[
`stable/elastic-stack`
](
https://github.com/helm/charts/tree/master/stable/elastic-stack
)
...
...
ee/app/assets/javascripts/logs/components/environment_logs.vue
View file @
518cb413
...
...
@@ -46,21 +46,20 @@ export default {
showLoader
()
{
return
this
.
logs
.
isLoading
||
!
this
.
logs
.
isComplete
;
},
featureElasticEnabled
()
{
return
gon
.
features
&&
gon
.
features
.
enableClusterApplicationElasticStack
;
},
advancedFeaturesEnabled
()
{
const
environment
=
this
.
environments
.
options
.
find
(
({
name
})
=>
name
===
this
.
environments
.
current
,
);
return
this
.
featureElasticEnabled
&&
environment
&&
environment
.
enable_advanced_logs_querying
;
return
environment
&&
environment
.
enable_advanced_logs_querying
;
},
disableAdvancedControls
()
{
return
this
.
environments
.
isLoading
||
!
this
.
advancedFeaturesEnabled
;
},
shouldShowElasticStackCallout
()
{
return
(
!
this
.
isElasticStackCalloutDismissed
&&
!
this
.
environments
.
isLoading
&&
!
this
.
logs
.
isLoading
&&
!
this
.
advancedFeaturesEnabled
!
this
.
disableAdvancedControls
);
},
},
...
...
@@ -119,8 +118,7 @@ export default {
:label=
"s__('Environments|Environment')"
label-size=
"sm"
label-for=
"environments-dropdown"
class=
"px-1"
:class=
"featureElasticEnabled ? 'col-3' : 'col-6'"
class=
"col-3 px-1"
>
<gl-dropdown
id=
"environments-dropdown"
...
...
@@ -143,8 +141,7 @@ export default {
:label=
"s__('Environments|Pod logs from')"
label-size=
"sm"
label-for=
"pods-dropdown"
class=
"px-1"
:class=
"featureElasticEnabled ? 'col-3' : 'col-6'"
class=
"col-3 px-1"
>
<gl-dropdown
id=
"pods-dropdown"
...
...
@@ -162,8 +159,6 @@ export default {
</gl-dropdown-item>
</gl-dropdown>
</gl-form-group>
<template
v-if=
"featureElasticEnabled"
>
<gl-form-group
id=
"dates-fg"
:label=
"s__('Environments|Show last')"
...
...
@@ -174,7 +169,7 @@ export default {
<gl-dropdown
id=
"time-window-dropdown"
ref=
"time-window-dropdown"
:disabled=
"environments.isLoading || !advancedFeaturesEnabled
"
:disabled=
"disableAdvancedControls
"
:text=
"timeWindow.options[timeWindow.current].label"
class=
"d-flex gl-h-32"
toggle-class=
"dropdown-menu-toggle"
...
...
@@ -197,17 +192,14 @@ export default {
>
<gl-search-box-by-click
v-model.trim=
"searchQuery"
:disabled=
"environments.isLoading || !advancedFeaturesEnabled
"
:disabled=
"disableAdvancedControls
"
:placeholder=
"s__('Environments|Search')"
class=
"js-logs-search"
type=
"search"
autofocus
@
submit=
"
(environments.isLoading || !advancedFeaturesEnabled) && setSearch(searchQuery)
"
@
submit=
"disableAdvancedControls && setSearch(searchQuery)"
/>
</gl-form-group>
</
template
>
</div>
<log-control-buttons
...
...
ee/app/controllers/projects/logs_controller.rb
View file @
518cb413
...
...
@@ -4,9 +4,6 @@ module Projects
class
LogsController
<
Projects
::
ApplicationController
before_action
:authorize_read_pod_logs!
before_action
:environment
before_action
do
push_frontend_feature_flag
(
:enable_cluster_application_elastic_stack
)
end
def
index
if
environment
.
nil?
...
...
ee/app/models/ee/clusters/platforms/kubernetes.rb
View file @
518cb413
...
...
@@ -92,7 +92,7 @@ module EE
end
def
elastic_stack_available?
::
Feature
.
enabled?
(
:enable_cluster_application_elastic_stack
)
&&
!!
cluster
.
application_elastic_stack
!!
cluster
.
application_elastic_stack
end
private
...
...
ee/spec/frontend/logs/components/environment_logs_spec.js
View file @
518cb413
...
...
@@ -114,15 +114,13 @@ describe('EnvironmentLogs', () => {
expect
(
findPodsDropdown
().
is
(
GlDropdown
)).
toBe
(
true
);
expect
(
findLogControlButtons
().
exists
()).
toBe
(
true
);
expect
(
findSearchBar
().
exists
()).
toBe
(
false
);
// behind ff
expect
(
findTimeWindowDropdown
().
exists
()).
toBe
(
false
);
// behind ff
expect
(
findSearchBar
().
exists
()).
toBe
(
true
);
expect
(
findSearchBar
().
is
(
GlSearchBoxByClick
)).
toBe
(
true
);
expect
(
findTimeWindowDropdown
().
exists
()).
toBe
(
true
);
expect
(
findTimeWindowDropdown
().
is
(
GlDropdown
)).
toBe
(
true
);
// log trace
expect
(
findLogTrace
().
isEmpty
()).
toBe
(
false
);
// layout
expect
(
wrapper
.
find
(
'
#environments-dropdown-fg
'
).
attributes
(
'
class
'
)).
toMatch
(
'
col-6
'
);
expect
(
wrapper
.
find
(
'
#pods-dropdown-fg
'
).
attributes
(
'
class
'
)).
toMatch
(
'
col-6
'
);
});
it
(
'
mounted inits data
'
,
()
=>
{
...
...
@@ -156,15 +154,24 @@ describe('EnvironmentLogs', () => {
});
it
(
'
displays a disabled environments dropdown
'
,
()
=>
{
expect
(
findEnvironmentsDropdown
().
attributes
(
'
disabled
'
)).
to
Equal
(
'
true
'
);
expect
(
findEnvironmentsDropdown
().
attributes
(
'
disabled
'
)).
to
Be
(
'
true
'
);
expect
(
findEnvironmentsDropdown
().
findAll
(
GlDropdownItem
).
length
).
toBe
(
0
);
});
it
(
'
displays a disabled pods dropdown
'
,
()
=>
{
expect
(
findPodsDropdown
().
attributes
(
'
disabled
'
)).
to
Equal
(
'
true
'
);
expect
(
findPodsDropdown
().
attributes
(
'
disabled
'
)).
to
Be
(
'
true
'
);
expect
(
findPodsDropdown
().
findAll
(
GlDropdownItem
).
length
).
toBe
(
0
);
});
it
(
'
displays a disabled search bar
'
,
()
=>
{
expect
(
findSearchBar
().
exists
()).
toBe
(
true
);
expect
(
findSearchBar
().
attributes
(
'
disabled
'
)).
toBe
(
'
true
'
);
});
it
(
'
displays a disabled time window dropdown
'
,
()
=>
{
expect
(
findTimeWindowDropdown
().
attributes
(
'
disabled
'
)).
toBe
(
'
true
'
);
});
it
(
'
does not update buttons state
'
,
()
=>
{
expect
(
updateControlBtnsMock
).
not
.
toHaveBeenCalled
();
});
...
...
@@ -179,22 +186,7 @@ describe('EnvironmentLogs', () => {
});
});
describe
(
'
elastic stack disabled
'
,
()
=>
{
beforeEach
(()
=>
{
gon
.
features
=
gon
.
features
||
{};
gon
.
features
.
enableClusterApplicationElasticStack
=
false
;
initWrapper
();
});
it
(
"
doesn't display the search bar
"
,
()
=>
{
expect
(
findSearchBar
().
exists
()).
toEqual
(
false
);
expect
(
wrapper
.
find
(
'
#environments-dropdown-fg
'
).
attributes
(
'
class
'
)).
toEqual
(
'
px-1 col-6
'
);
expect
(
wrapper
.
find
(
'
#pods-dropdown-fg
'
).
attributes
(
'
class
'
)).
toEqual
(
'
px-1 col-6
'
);
});
});
describe
(
'
ES enabled and legacy environment
'
,
()
=>
{
describe
(
'
legacy environment
'
,
()
=>
{
beforeEach
(()
=>
{
state
.
pods
.
options
=
[];
...
...
@@ -209,15 +201,13 @@ describe('EnvironmentLogs', () => {
isLoading
:
false
,
};
gon
.
features
=
gon
.
features
||
{};
gon
.
features
.
enableClusterApplicationElasticStack
=
true
;
initWrapper
();
});
it
(
'
displays a disabled search bar
'
,
()
=>
{
expect
(
findSearchBar
().
exists
()).
toEqual
(
true
);
expect
(
findSearchBar
().
attributes
(
'
disabled
'
)).
toEqual
(
'
true
'
);
it
(
'
displays a disabled search bar and time window dropdown
'
,
()
=>
{
expect
(
findSearchBar
().
exists
()).
toBe
(
true
);
expect
(
findSearchBar
().
attributes
(
'
disabled
'
)).
toBe
(
'
true
'
);
expect
(
findTimeWindowDropdown
().
attributes
(
'
disabled
'
)).
toBe
(
'
true
'
);
});
});
...
...
@@ -227,9 +217,6 @@ describe('EnvironmentLogs', () => {
actionMocks
.
showPodLogs
.
mockImplementation
(
mockShowPodLogs
);
actionMocks
.
fetchEnvironments
.
mockImplementation
(
mockFetchEnvs
);
gon
.
features
=
gon
.
features
||
{};
gon
.
features
.
enableClusterApplicationElasticStack
=
true
;
initWrapper
();
});
...
...
@@ -242,6 +229,14 @@ describe('EnvironmentLogs', () => {
actionMocks
.
fetchEnvironments
.
mockReset
();
});
it
(
'
displays an enabled search bar
'
,
()
=>
{
expect
(
findSearchBar
().
attributes
(
'
disabled
'
)).
toBeFalsy
();
});
it
(
'
displays an enabled time window dropdown
'
,
()
=>
{
expect
(
findTimeWindowDropdown
().
attributes
(
'
disabled
'
)).
toBeFalsy
();
});
it
(
'
populates environments dropdown
'
,
()
=>
{
const
items
=
findEnvironmentsDropdown
().
findAll
(
GlDropdownItem
);
expect
(
findEnvironmentsDropdown
().
props
(
'
text
'
)).
toBe
(
mockEnvName
);
...
...
@@ -312,103 +307,4 @@ describe('EnvironmentLogs', () => {
});
});
});
describe
(
'
when feature flag enable_cluster_application_elastic_stack is enabled
'
,
()
=>
{
let
originalGon
;
beforeEach
(()
=>
{
originalGon
=
window
.
gon
;
window
.
gon
=
{
features
:
{
enableClusterApplicationElasticStack
:
true
}
};
});
afterEach
(()
=>
{
window
.
gon
=
originalGon
;
});
it
(
'
displays UI elements
'
,
()
=>
{
initWrapper
();
// elements
expect
(
findSearchBar
().
exists
()).
toBe
(
true
);
expect
(
findSearchBar
().
is
(
GlSearchBoxByClick
)).
toBe
(
true
);
expect
(
findTimeWindowDropdown
().
exists
()).
toBe
(
true
);
expect
(
findTimeWindowDropdown
().
is
(
GlDropdown
)).
toBe
(
true
);
// layout
expect
(
wrapper
.
find
(
'
#environments-dropdown-fg
'
).
attributes
(
'
class
'
)).
toMatch
(
'
col-3
'
);
expect
(
wrapper
.
find
(
'
#pods-dropdown-fg
'
).
attributes
(
'
class
'
)).
toMatch
(
'
col-3
'
);
expect
(
wrapper
.
find
(
'
#dates-fg
'
).
attributes
(
'
class
'
)).
toMatch
(
'
col-3
'
);
expect
(
wrapper
.
find
(
'
#search-fg
'
).
attributes
(
'
class
'
)).
toMatch
(
'
col-3
'
);
});
describe
(
'
loading state
'
,
()
=>
{
beforeEach
(()
=>
{
state
.
pods
.
options
=
[];
state
.
logs
=
{
lines
:
[],
isLoading
:
true
,
};
state
.
environments
=
{
options
:
[],
isLoading
:
true
,
};
initWrapper
();
});
it
(
'
displays a disabled search bar
'
,
()
=>
{
expect
(
findSearchBar
().
exists
()).
toEqual
(
true
);
expect
(
findSearchBar
().
attributes
(
'
disabled
'
)).
toEqual
(
'
true
'
);
});
it
(
'
displays a disabled time window dropdown
'
,
()
=>
{
expect
(
findTimeWindowDropdown
().
attributes
(
'
disabled
'
)).
toEqual
(
'
true
'
);
});
});
describe
(
'
when advanced querying is disabled
'
,
()
=>
{
beforeEach
(()
=>
{
state
.
pods
.
options
=
[];
state
.
logs
=
{
lines
:
[],
isLoading
:
false
,
};
state
.
environments
=
{
options
:
[],
isLoading
:
false
,
};
state
.
enableAdvancedQuerying
=
false
;
initWrapper
();
});
it
(
'
search bar and time window dropdown are disabled
'
,
()
=>
{
expect
(
findSearchBar
().
attributes
(
'
disabled
'
)).
toEqual
(
'
true
'
);
expect
(
findTimeWindowDropdown
().
attributes
(
'
disabled
'
)).
toEqual
(
'
true
'
);
});
});
describe
(
'
state with data
'
,
()
=>
{
beforeEach
(()
=>
{
actionMocks
.
setInitData
.
mockImplementation
(
mockSetInitData
);
actionMocks
.
showPodLogs
.
mockImplementation
(
mockShowPodLogs
);
actionMocks
.
fetchEnvironments
.
mockImplementation
(
mockFetchEnvs
);
initWrapper
();
});
it
(
'
displays an enabled search bar
'
,
()
=>
{
expect
(
findSearchBar
().
attributes
(
'
disabled
'
)).
toBeFalsy
();
});
it
(
'
displays an enabled time window dropdown
'
,
()
=>
{
expect
(
findTimeWindowDropdown
().
attributes
(
'
disabled
'
)).
toBeFalsy
();
});
});
});
});
ee/spec/models/ee/clusters/platforms/kubernetes_spec.rb
View file @
518cb413
...
...
@@ -179,7 +179,6 @@ describe Clusters::Platforms::Kubernetes do
before
do
expect_any_instance_of
(
::
Clusters
::
Applications
::
ElasticStack
).
to
receive
(
:elasticsearch_client
).
at_least
(
:once
).
and_return
(
Elasticsearch
::
Transport
::
Client
.
new
)
expect_any_instance_of
(
::
Gitlab
::
Elasticsearch
::
Logs
).
to
receive
(
:pod_logs
).
and_return
(
expected_logs
)
stub_feature_flags
(
enable_cluster_application_elastic_stack:
true
)
end
include_examples
'successful log request'
...
...
spec/frontend/clusters/components/applications_spec.js
View file @
518cb413
...
...
@@ -14,9 +14,6 @@ describe('Applications', () => {
beforeEach
(()
=>
{
Applications
=
Vue
.
extend
(
applications
);
gon
.
features
=
gon
.
features
||
{};
gon
.
features
.
enableClusterApplicationElasticStack
=
true
;
});
afterEach
(()
=>
{
...
...
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