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
afed7fd1
Commit
afed7fd1
authored
Oct 02, 2019
by
João Cunha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ignore non-existing metrics when uninstalling
parent
38c88bbe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletion
+18
-1
app/models/clusters/applications/prometheus.rb
app/models/clusters/applications/prometheus.rb
+6
-1
spec/models/clusters/applications/prometheus_spec.rb
spec/models/clusters/applications/prometheus_spec.rb
+12
-0
No files found.
app/models/clusters/applications/prometheus.rb
View file @
afed7fd1
...
...
@@ -112,7 +112,12 @@ module Clusters
def
delete_knative_istio_metrics
return
[]
unless
cluster
.
application_knative_available?
[
Gitlab
::
Kubernetes
::
KubectlCmd
.
delete
(
"-f"
,
Clusters
::
Applications
::
Knative
::
METRICS_CONFIG
)]
[
Gitlab
::
Kubernetes
::
KubectlCmd
.
delete
(
"-f"
,
Clusters
::
Applications
::
Knative
::
METRICS_CONFIG
,
"--ignore-not-found"
)
]
end
end
end
...
...
spec/models/clusters/applications/prometheus_spec.rb
View file @
afed7fd1
...
...
@@ -175,6 +175,18 @@ describe Clusters::Applications::Prometheus do
expect
(
subject
).
to
be_rbac
end
describe
'#predelete'
do
let
(
:knative
)
{
create
(
:clusters_applications_knative
,
:updated
)
}
let
(
:prometheus
)
{
create
(
:clusters_applications_prometheus
,
cluster:
knative
.
cluster
)
}
subject
{
prometheus
.
uninstall_command
.
predelete
}
it
'deletes knative metrics'
do
metrics_config
=
Clusters
::
Applications
::
Knative
::
METRICS_CONFIG
is_expected
.
to
include
(
"kubectl delete -f
#{
metrics_config
}
--ignore-not-found"
)
end
end
context
'on a non rbac enabled cluster'
do
before
do
prometheus
.
cluster
.
platform_kubernetes
.
abac!
...
...
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