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
089d8b5d
Commit
089d8b5d
authored
Dec 19, 2018
by
Thong Kuah
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
EE: Remove code ported to CE from ee/
Also removes prepend as the prepended EE module is now empty
parent
24ddf702
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
0 additions
and
149 deletions
+0
-149
app/services/clusters/applications/base_helm_service.rb
app/services/clusters/applications/base_helm_service.rb
+0
-2
ee/app/models/ee/clusters/applications/prometheus.rb
ee/app/models/ee/clusters/applications/prometheus.rb
+0
-30
ee/app/services/ee/clusters/applications/base_helm_service.rb
...pp/services/ee/clusters/applications/base_helm_service.rb
+0
-15
ee/spec/models/ee/clusters/applications/prometheus_spec.rb
ee/spec/models/ee/clusters/applications/prometheus_spec.rb
+0
-102
No files found.
app/services/clusters/applications/base_helm_service.rb
View file @
089d8b5d
...
...
@@ -52,5 +52,3 @@ module Clusters
end
end
end
Clusters
::
Applications
::
BaseHelmService
.
prepend
(
EE
::
Clusters
::
Applications
::
BaseHelmService
)
ee/app/models/ee/clusters/applications/prometheus.rb
View file @
089d8b5d
...
...
@@ -21,42 +21,12 @@ module EE
end
end
def
ready_status
super
+
[
:updating
,
:updated
,
:update_errored
]
end
def
updated_since?
(
timestamp
)
last_update_started_at
&&
last_update_started_at
>
timestamp
&&
!
update_errored?
end
def
update_in_progress?
status_name
==
:updating
end
def
update_errored?
status_name
==
:update_errored
end
def
upgrade_command
(
values
)
::
Gitlab
::
Kubernetes
::
Helm
::
UpgradeCommand
.
new
(
name
,
version:
self
.
class
.
const_get
(
:VERSION
),
chart:
chart
,
rbac:
cluster
.
platform_kubernetes_rbac?
,
files:
files_with_replaced_values
(
values
)
)
end
# Returns a copy of files where the values of 'values.yaml'
# are replaced by the argument.
#
# See #values for the data format required
def
files_with_replaced_values
(
replaced_values
)
files
.
merge
(
'values.yaml'
:
replaced_values
)
end
def
generate_alert_manager_token!
unless
alert_manager_token
.
present?
update!
(
alert_manager_token:
generate_token
)
...
...
ee/app/services/ee/clusters/applications/base_helm_service.rb
deleted
100644 → 0
View file @
24ddf702
# frozen_string_literal: true
module
EE
module
Clusters
module
Applications
module
BaseHelmService
protected
def
upgrade_command
(
new_values
=
""
)
@upgrade_command
||=
app
.
upgrade_command
(
new_values
)
end
end
end
end
end
ee/spec/models/ee/clusters/applications/prometheus_spec.rb
View file @
089d8b5d
...
...
@@ -26,29 +26,6 @@ describe Clusters::Applications::Prometheus do
end
end
describe
'#ready'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:cluster
)
{
create
(
:cluster
,
projects:
[
project
])
}
it
'returns true when updating'
do
application
=
build
(
:clusters_applications_prometheus
,
:updating
,
cluster:
cluster
)
expect
(
application
).
to
be_ready
end
it
'returns true when updated'
do
application
=
build
(
:clusters_applications_prometheus
,
:updated
,
cluster:
cluster
)
expect
(
application
).
to
be_ready
end
it
'returns true when errored'
do
application
=
build
(
:clusters_applications_prometheus
,
:update_errored
,
cluster:
cluster
)
expect
(
application
).
to
be_ready
end
end
context
'#updated_since?'
do
let
(
:cluster
)
{
create
(
:cluster
)
}
let
(
:prometheus_app
)
{
build
(
:clusters_applications_prometheus
,
cluster:
cluster
)
}
...
...
@@ -81,85 +58,6 @@ describe Clusters::Applications::Prometheus do
end
end
describe
'#update_in_progress?'
do
context
'when app is updating'
do
it
'returns true'
do
cluster
=
create
(
:cluster
)
prometheus_app
=
build
(
:clusters_applications_prometheus
,
:updating
,
cluster:
cluster
)
expect
(
prometheus_app
.
update_in_progress?
).
to
be
true
end
end
end
describe
'#update_errored?'
do
context
'when app errored'
do
it
'returns true'
do
cluster
=
create
(
:cluster
)
prometheus_app
=
build
(
:clusters_applications_prometheus
,
:update_errored
,
cluster:
cluster
)
expect
(
prometheus_app
.
update_errored?
).
to
be
true
end
end
end
describe
'#upgrade_command'
do
let
(
:prometheus
)
{
build
(
:clusters_applications_prometheus
)
}
let
(
:values
)
{
prometheus
.
values
}
it
'returns an instance of Gitlab::Kubernetes::Helm::GetCommand'
do
expect
(
prometheus
.
upgrade_command
(
values
)).
to
be_an_instance_of
(
::
Gitlab
::
Kubernetes
::
Helm
::
UpgradeCommand
)
end
it
'should be initialized with 3 arguments'
do
command
=
prometheus
.
upgrade_command
(
values
)
expect
(
command
.
name
).
to
eq
(
'prometheus'
)
expect
(
command
.
chart
).
to
eq
(
'stable/prometheus'
)
expect
(
command
.
version
).
to
eq
(
'6.7.3'
)
expect
(
command
.
files
).
to
eq
(
prometheus
.
files
)
end
end
describe
'#files_with_replaced_values'
do
let
(
:application
)
{
build
(
:clusters_applications_prometheus
)
}
let
(
:files
)
{
application
.
files
}
subject
{
application
.
files_with_replaced_values
({
hello: :world
})
}
it
'does not modify #files'
do
expect
(
subject
[
:'values.yaml'
]).
not_to
eq
(
files
)
expect
(
files
[
:'values.yaml'
]).
to
eq
(
application
.
values
)
end
it
'returns values.yaml with replaced values'
do
expect
(
subject
[
:'values.yaml'
]).
to
eq
({
hello: :world
})
end
it
'should include cert files'
do
expect
(
subject
[
:'ca.pem'
]).
to
be_present
expect
(
subject
[
:'ca.pem'
]).
to
eq
(
application
.
cluster
.
application_helm
.
ca_cert
)
expect
(
subject
[
:'cert.pem'
]).
to
be_present
expect
(
subject
[
:'key.pem'
]).
to
be_present
cert
=
OpenSSL
::
X509
::
Certificate
.
new
(
subject
[
:'cert.pem'
])
expect
(
cert
.
not_after
).
to
be
<
60
.
minutes
.
from_now
end
context
'when the helm application does not have a ca_cert'
do
before
do
application
.
cluster
.
application_helm
.
ca_cert
=
nil
end
it
'should not include cert files'
do
expect
(
subject
[
:'ca.pem'
]).
not_to
be_present
expect
(
subject
[
:'cert.pem'
]).
not_to
be_present
expect
(
subject
[
:'key.pem'
]).
not_to
be_present
end
end
end
describe
'alert manager token'
do
subject
{
create
(
:clusters_applications_prometheus
)
}
...
...
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