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
e3d1c3db
Commit
e3d1c3db
authored
Aug 02, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
aa63fcea
57e00e19
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
9 deletions
+17
-9
app/models/clusters/applications/knative.rb
app/models/clusters/applications/knative.rb
+7
-3
app/models/clusters/applications/prometheus.rb
app/models/clusters/applications/prometheus.rb
+7
-3
spec/models/clusters/applications/knative_spec.rb
spec/models/clusters/applications/knative_spec.rb
+2
-2
spec/models/clusters/applications/prometheus_spec.rb
spec/models/clusters/applications/prometheus_spec.rb
+1
-1
No files found.
app/models/clusters/applications/knative.rb
View file @
e3d1c3db
...
...
@@ -84,7 +84,7 @@ module Clusters
private
def
delete_knative_services_and_metrics
delete_knative_services
+
delete_knative_istio_metrics
.
to_a
delete_knative_services
+
delete_knative_istio_metrics
end
def
delete_knative_services
...
...
@@ -117,11 +117,15 @@ module Clusters
end
def
install_knative_metrics
[
"kubectl apply -f
#{
METRICS_CONFIG
}
"
]
if
cluster
.
application_prometheus_available?
return
[]
unless
cluster
.
application_prometheus_available?
[
"kubectl apply -f
#{
METRICS_CONFIG
}
"
]
end
def
delete_knative_istio_metrics
[
"kubectl delete --ignore-not-found -f
#{
METRICS_CONFIG
}
"
]
if
cluster
.
application_prometheus_available?
return
[]
unless
cluster
.
application_prometheus_available?
[
"kubectl delete --ignore-not-found -f
#{
METRICS_CONFIG
}
"
]
end
def
verify_cluster?
...
...
app/models/clusters/applications/prometheus.rb
View file @
e3d1c3db
...
...
@@ -64,7 +64,7 @@ module Clusters
name:
name
,
rbac:
cluster
.
platform_kubernetes_rbac?
,
files:
files
,
predelete:
delete_knative_istio_metrics
.
to_a
predelete:
delete_knative_istio_metrics
)
end
...
...
@@ -104,11 +104,15 @@ module Clusters
end
def
install_knative_metrics
[
"kubectl apply -f
#{
Clusters
::
Applications
::
Knative
::
METRICS_CONFIG
}
"
]
if
cluster
.
application_knative_available?
return
[]
unless
cluster
.
application_knative_available?
[
"kubectl apply -f
#{
Clusters
::
Applications
::
Knative
::
METRICS_CONFIG
}
"
]
end
def
delete_knative_istio_metrics
[
"kubectl delete -f
#{
Clusters
::
Applications
::
Knative
::
METRICS_CONFIG
}
"
]
if
cluster
.
application_knative_available?
return
[]
unless
cluster
.
application_knative_available?
[
"kubectl delete -f
#{
Clusters
::
Applications
::
Knative
::
METRICS_CONFIG
}
"
]
end
end
end
...
...
spec/models/clusters/applications/knative_spec.rb
View file @
e3d1c3db
...
...
@@ -91,7 +91,7 @@ describe Clusters::Applications::Knative do
end
it
'does not install metrics for prometheus'
do
expect
(
subject
.
postinstall
).
to
be_
nil
expect
(
subject
.
postinstall
).
to
be_
empty
end
context
'with prometheus installed'
do
...
...
@@ -101,7 +101,7 @@ describe Clusters::Applications::Knative do
subject
{
knative
.
install_command
}
it
'installs metrics'
do
expect
(
subject
.
postinstall
).
not_to
be_
nil
expect
(
subject
.
postinstall
).
not_to
be_
empty
expect
(
subject
.
postinstall
.
length
).
to
be
(
1
)
expect
(
subject
.
postinstall
[
0
]).
to
eql
(
"kubectl apply -f
#{
Clusters
::
Applications
::
Knative
::
METRICS_CONFIG
}
"
)
end
...
...
spec/models/clusters/applications/prometheus_spec.rb
View file @
e3d1c3db
...
...
@@ -142,7 +142,7 @@ describe Clusters::Applications::Prometheus do
end
it
'does not install knative metrics'
do
expect
(
subject
.
postinstall
).
to
be_
nil
expect
(
subject
.
postinstall
).
to
be_
empty
end
context
'with knative installed'
do
...
...
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