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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
43c284b7
Commit
43c284b7
authored
Apr 12, 2019
by
Thong Kuah
Committed by
Stan Hu
Apr 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Teach Prometheus about #uninstall_command
Add specs
parent
44eec568
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
0 deletions
+36
-0
app/models/clusters/applications/prometheus.rb
app/models/clusters/applications/prometheus.rb
+8
-0
spec/models/clusters/applications/prometheus_spec.rb
spec/models/clusters/applications/prometheus_spec.rb
+28
-0
No files found.
app/models/clusters/applications/prometheus.rb
View file @
43c284b7
...
@@ -47,6 +47,14 @@ module Clusters
...
@@ -47,6 +47,14 @@ module Clusters
)
)
end
end
def
uninstall_command
Gitlab
::
Kubernetes
::
Helm
::
DeleteCommand
.
new
(
name:
name
,
rbac:
cluster
.
platform_kubernetes_rbac?
,
files:
files
)
end
def
upgrade_command
(
values
)
def
upgrade_command
(
values
)
::
Gitlab
::
Kubernetes
::
Helm
::
InstallCommand
.
new
(
::
Gitlab
::
Kubernetes
::
Helm
::
InstallCommand
.
new
(
name:
name
,
name:
name
,
...
...
spec/models/clusters/applications/prometheus_spec.rb
View file @
43c284b7
...
@@ -142,6 +142,34 @@ describe Clusters::Applications::Prometheus do
...
@@ -142,6 +142,34 @@ describe Clusters::Applications::Prometheus do
end
end
end
end
describe
'#uninstall_command'
do
let
(
:prometheus
)
{
create
(
:clusters_applications_prometheus
)
}
subject
{
prometheus
.
uninstall_command
}
it
{
is_expected
.
to
be_an_instance_of
(
Gitlab
::
Kubernetes
::
Helm
::
DeleteCommand
)
}
it
'has the application name'
do
expect
(
subject
.
name
).
to
eq
(
'prometheus'
)
end
it
'has files'
do
expect
(
subject
.
files
).
to
eq
(
prometheus
.
files
)
end
it
'is rbac'
do
expect
(
subject
).
to
be_rbac
end
context
'on a non rbac enabled cluster'
do
before
do
prometheus
.
cluster
.
platform_kubernetes
.
abac!
end
it
{
is_expected
.
not_to
be_rbac
}
end
end
describe
'#upgrade_command'
do
describe
'#upgrade_command'
do
let
(
:prometheus
)
{
build
(
:clusters_applications_prometheus
)
}
let
(
:prometheus
)
{
build
(
:clusters_applications_prometheus
)
}
let
(
:values
)
{
prometheus
.
values
}
let
(
:values
)
{
prometheus
.
values
}
...
...
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