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
e25bacf5
Commit
e25bacf5
authored
Jul 31, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
10939212
af9b1ffa
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
0 additions
and
85 deletions
+0
-85
app/models/clusters/cluster.rb
app/models/clusters/cluster.rb
+0
-16
app/models/project.rb
app/models/project.rb
+0
-6
spec/models/clusters/cluster_spec.rb
spec/models/clusters/cluster_spec.rb
+0
-45
spec/models/project_spec.rb
spec/models/project_spec.rb
+0
-18
No files found.
app/models/clusters/cluster.rb
View file @
e25bacf5
...
...
@@ -100,12 +100,6 @@ module Clusters
scope
:default_environment
,
->
{
where
(
environment_scope:
DEFAULT_ENVIRONMENT
)
}
scope
:missing_kubernetes_namespace
,
->
(
kubernetes_namespaces
)
do
subquery
=
kubernetes_namespaces
.
select
(
'1'
).
where
(
'clusters_kubernetes_namespaces.cluster_id = clusters.id'
)
where
(
'NOT EXISTS (?)'
,
subquery
)
end
scope
:with_knative_installed
,
->
{
joins
(
:application_knative
).
merge
(
Clusters
::
Applications
::
Knative
.
available
)
}
scope
:preload_knative
,
->
{
...
...
@@ -161,16 +155,6 @@ module Clusters
return
platform_kubernetes
if
kubernetes?
end
def
all_projects
if
project_type?
projects
elsif
group_type?
first_group
.
all_projects
else
Project
.
none
end
end
def
first_project
strong_memoize
(
:first_project
)
do
projects
.
first
...
...
app/models/project.rb
View file @
e25bacf5
...
...
@@ -415,12 +415,6 @@ class Project < ApplicationRecord
.
where
(
project_ci_cd_settings:
{
group_runners_enabled:
true
})
end
scope
:missing_kubernetes_namespace
,
->
(
kubernetes_namespaces
)
do
subquery
=
kubernetes_namespaces
.
select
(
'1'
).
where
(
'clusters_kubernetes_namespaces.project_id = projects.id'
)
where
(
'NOT EXISTS (?)'
,
subquery
)
end
enum
auto_cancel_pending_pipelines:
{
disabled:
0
,
enabled:
1
}
chronic_duration_attr
:build_timeout_human_readable
,
:build_timeout
,
...
...
spec/models/clusters/cluster_spec.rb
View file @
e25bacf5
...
...
@@ -121,26 +121,6 @@ describe Clusters::Cluster, :use_clean_rails_memory_store_caching do
end
end
describe
'.missing_kubernetes_namespace'
do
let!
(
:cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
:project
)
}
let
(
:project
)
{
cluster
.
project
}
let
(
:kubernetes_namespaces
)
{
project
.
kubernetes_namespaces
}
subject
do
described_class
.
joins
(
:projects
).
where
(
projects:
{
id:
project
.
id
}).
missing_kubernetes_namespace
(
kubernetes_namespaces
)
end
it
{
is_expected
.
to
contain_exactly
(
cluster
)
}
context
'kubernetes namespace exists'
do
before
do
create
(
:cluster_kubernetes_namespace
,
project:
project
,
cluster:
cluster
)
end
it
{
is_expected
.
to
be_empty
}
end
end
describe
'validations'
do
subject
{
cluster
.
valid?
}
...
...
@@ -423,31 +403,6 @@ describe Clusters::Cluster, :use_clean_rails_memory_store_caching do
end
end
describe
'#all_projects'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:cluster
)
{
create
(
:cluster
,
projects:
[
project
])
}
subject
{
cluster
.
all_projects
}
context
'project cluster'
do
it
'returns project'
do
is_expected
.
to
eq
([
project
])
end
end
context
'group cluster'
do
let
(
:cluster
)
{
create
(
:cluster
,
:group
)
}
let
(
:group
)
{
cluster
.
group
}
let
(
:project
)
{
create
(
:project
,
group:
group
)
}
let
(
:subgroup
)
{
create
(
:group
,
parent:
group
)
}
let
(
:subproject
)
{
create
(
:project
,
group:
subgroup
)
}
it
'returns all projects for group'
do
is_expected
.
to
contain_exactly
(
project
,
subproject
)
end
end
end
describe
'#first_project'
do
subject
{
cluster
.
first_project
}
...
...
spec/models/project_spec.rb
View file @
e25bacf5
...
...
@@ -173,24 +173,6 @@ describe Project do
it
{
is_expected
.
to
include_module
(
Sortable
)
}
end
describe
'.missing_kubernetes_namespace'
do
let!
(
:project
)
{
create
(
:project
)
}
let!
(
:cluster
)
{
create
(
:cluster
,
:provided_by_user
,
:group
)
}
let
(
:kubernetes_namespaces
)
{
project
.
kubernetes_namespaces
}
subject
{
described_class
.
missing_kubernetes_namespace
(
kubernetes_namespaces
)
}
it
{
is_expected
.
to
contain_exactly
(
project
)
}
context
'kubernetes namespace exists'
do
before
do
create
(
:cluster_kubernetes_namespace
,
project:
project
,
cluster:
cluster
)
end
it
{
is_expected
.
to
be_empty
}
end
end
describe
'validation'
do
let!
(
:project
)
{
create
(
:project
)
}
...
...
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