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
2e2317a7
Commit
2e2317a7
authored
Aug 13, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
97775de3
35994fe0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
app/models/clusters/applications/helm.rb
app/models/clusters/applications/helm.rb
+1
-1
spec/models/clusters/applications/helm_spec.rb
spec/models/clusters/applications/helm_spec.rb
+9
-1
No files found.
app/models/clusters/applications/helm.rb
View file @
2e2317a7
...
@@ -41,7 +41,7 @@ module Clusters
...
@@ -41,7 +41,7 @@ module Clusters
extra_apps
=
Clusters
::
Applications
::
Helm
.
where
(
'EXISTS (?)'
,
klass
.
select
(
1
).
where
(
cluster_id:
cluster_id
))
extra_apps
=
Clusters
::
Applications
::
Helm
.
where
(
'EXISTS (?)'
,
klass
.
select
(
1
).
where
(
cluster_id:
cluster_id
))
applications
=
applications
.
present?
?
applications
.
or
(
extra_apps
)
:
extra_apps
applications
=
applications
?
applications
.
or
(
extra_apps
)
:
extra_apps
end
end
!
applications
.
exists?
!
applications
.
exists?
...
...
spec/models/clusters/applications/helm_spec.rb
View file @
2e2317a7
...
@@ -23,7 +23,7 @@ describe Clusters::Applications::Helm do
...
@@ -23,7 +23,7 @@ describe Clusters::Applications::Helm do
Clusters
::
Cluster
::
APPLICATIONS
.
keys
.
each
do
|
application_name
|
Clusters
::
Cluster
::
APPLICATIONS
.
keys
.
each
do
|
application_name
|
next
if
application_name
==
'helm'
next
if
application_name
==
'helm'
it
do
it
"is false when
#{
application_name
}
is installed"
do
cluster_application
=
create
(
"clusters_applications_
#{
application_name
}
"
.
to_sym
)
cluster_application
=
create
(
"clusters_applications_
#{
application_name
}
"
.
to_sym
)
helm
=
cluster_application
.
cluster
.
application_helm
helm
=
cluster_application
.
cluster
.
application_helm
...
@@ -31,6 +31,14 @@ describe Clusters::Applications::Helm do
...
@@ -31,6 +31,14 @@ describe Clusters::Applications::Helm do
expect
(
helm
.
allowed_to_uninstall?
).
to
be_falsy
expect
(
helm
.
allowed_to_uninstall?
).
to
be_falsy
end
end
end
end
it
'executes a single query only'
do
cluster_application
=
create
(
:clusters_applications_ingress
)
helm
=
cluster_application
.
cluster
.
application_helm
query_count
=
ActiveRecord
::
QueryRecorder
.
new
{
helm
.
allowed_to_uninstall?
}.
count
expect
(
query_count
).
to
eq
(
1
)
end
end
end
context
"without other existing applications"
do
context
"without other existing applications"
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