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
b982a44a
Commit
b982a44a
authored
Nov 07, 2017
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '38464-k8s-apps' of
https://gitlab.com/gitlab-org/gitlab-ce
into 38464-k8s-apps
parents
bbdb0cf0
68a92295
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
29 deletions
+10
-29
lib/gitlab/import_export/import_export.yml
lib/gitlab/import_export/import_export.yml
+0
-2
lib/gitlab/import_export/relation_factory.rb
lib/gitlab/import_export/relation_factory.rb
+0
-2
spec/factories/clusters/applications/helm.rb
spec/factories/clusters/applications/helm.rb
+1
-6
spec/lib/gitlab/import_export/all_models.yml
spec/lib/gitlab/import_export/all_models.yml
+0
-16
spec/services/clusters/applications/install_service_spec.rb
spec/services/clusters/applications/install_service_spec.rb
+9
-3
No files found.
lib/gitlab/import_export/import_export.yml
View file @
b982a44a
...
@@ -54,8 +54,6 @@ project_tree:
...
@@ -54,8 +54,6 @@ project_tree:
-
:auto_devops
-
:auto_devops
-
:triggers
-
:triggers
-
:pipeline_schedules
-
:pipeline_schedules
-
clusters
:
-
:application_helm
-
:services
-
:services
-
:hooks
-
:hooks
-
protected_branches
:
-
protected_branches
:
...
...
lib/gitlab/import_export/relation_factory.rb
View file @
b982a44a
...
@@ -8,8 +8,6 @@ module Gitlab
...
@@ -8,8 +8,6 @@ module Gitlab
triggers:
'Ci::Trigger'
,
triggers:
'Ci::Trigger'
,
pipeline_schedules:
'Ci::PipelineSchedule'
,
pipeline_schedules:
'Ci::PipelineSchedule'
,
builds:
'Ci::Build'
,
builds:
'Ci::Build'
,
clusters:
'Clusters::Cluster'
,
application_helm:
'Clusters::Applications::Helm'
,
hooks:
'ProjectHook'
,
hooks:
'ProjectHook'
,
merge_access_levels:
'ProtectedBranch::MergeAccessLevel'
,
merge_access_levels:
'ProtectedBranch::MergeAccessLevel'
,
push_access_levels:
'ProtectedBranch::PushAccessLevel'
,
push_access_levels:
'ProtectedBranch::PushAccessLevel'
,
...
...
spec/factories/clusters/applications/helm.rb
View file @
b982a44a
FactoryGirl
.
define
do
FactoryGirl
.
define
do
factory
:cluster_applications_helm
,
class:
Clusters
::
Applications
::
Helm
do
factory
:cluster_applications_helm
,
class:
Clusters
::
Applications
::
Helm
do
cluster
factory:
:cluster
cluster
factory:
%i(cluster provided_by_gcp)
trait
:installable
do
trait
:installable
do
cluster
status
0
status
0
end
end
trait
:scheduled
do
trait
:scheduled
do
cluster
status
1
status
1
end
end
trait
:installing
do
trait
:installing
do
cluster
status
2
status
2
end
end
trait
:installed
do
trait
:installed
do
cluster
status
3
status
3
end
end
trait
:errored
do
trait
:errored
do
cluster
status
(
-
1
)
status
(
-
1
)
status_reason
'something went wrong'
status_reason
'something went wrong'
end
end
...
...
spec/lib/gitlab/import_export/all_models.yml
View file @
b982a44a
...
@@ -147,22 +147,6 @@ deploy_keys:
...
@@ -147,22 +147,6 @@ deploy_keys:
-
user
-
user
-
deploy_keys_projects
-
deploy_keys_projects
-
projects
-
projects
clusters
:
-
application_helm
-
cluster_projects
-
projects
-
user
-
provider_gcp
-
platform_kubernetes
cluster_projects
:
-
projects
-
clusters
provider_gcp
:
-
cluster
platform_kubernetes
:
-
cluster
application_helm
:
-
cluster
services
:
services
:
-
project
-
project
-
service_hook
-
service_hook
...
...
spec/services/clusters/applications/install_service_spec.rb
View file @
b982a44a
...
@@ -4,14 +4,20 @@ describe Clusters::Applications::InstallService do
...
@@ -4,14 +4,20 @@ describe Clusters::Applications::InstallService do
describe
'#execute'
do
describe
'#execute'
do
let
(
:application
)
{
create
(
:cluster_applications_helm
,
:scheduled
)
}
let
(
:application
)
{
create
(
:cluster_applications_helm
,
:scheduled
)
}
let
(
:service
)
{
described_class
.
new
(
application
)
}
let
(
:service
)
{
described_class
.
new
(
application
)
}
let
(
:helm_client
)
{
instance_double
(
Gitlab
::
Kubernetes
::
Helm
)
}
before
do
allow
(
service
).
to
receive
(
:helm_api
).
and_return
(
helm_client
)
end
context
'when there are no errors'
do
context
'when there are no errors'
do
before
do
before
do
expect
_any_instance_of
(
Gitlab
::
Kubernetes
::
Helm
).
to
receive
(
:install
).
with
(
application
)
expect
(
helm_client
).
to
receive
(
:install
).
with
(
application
)
allow
(
ClusterWaitForAppInstallationWorker
).
to
receive
(
:perform_in
).
and_return
(
nil
)
allow
(
ClusterWaitForAppInstallationWorker
).
to
receive
(
:perform_in
).
and_return
(
nil
)
end
end
it
'make the application installing'
do
it
'make the application installing'
do
expect
(
application
.
cluster
).
not_to
be_nil
service
.
execute
service
.
execute
expect
(
application
).
to
be_installing
expect
(
application
).
to
be_installing
...
@@ -27,7 +33,7 @@ describe Clusters::Applications::InstallService do
...
@@ -27,7 +33,7 @@ describe Clusters::Applications::InstallService do
context
'when k8s cluster communication fails'
do
context
'when k8s cluster communication fails'
do
before
do
before
do
error
=
KubeException
.
new
(
500
,
'system failure'
,
nil
)
error
=
KubeException
.
new
(
500
,
'system failure'
,
nil
)
expect
_any_instance_of
(
Gitlab
::
Kubernetes
::
Helm
).
to
receive
(
:install
).
with
(
application
).
and_raise
(
error
)
expect
(
helm_client
).
to
receive
(
:install
).
with
(
application
).
and_raise
(
error
)
end
end
it
'make the application errored'
do
it
'make the application errored'
do
...
@@ -43,7 +49,7 @@ describe Clusters::Applications::InstallService do
...
@@ -43,7 +49,7 @@ describe Clusters::Applications::InstallService do
it
'make the application errored'
do
it
'make the application errored'
do
expect
(
application
).
to
receive
(
:make_installing!
).
once
.
and_raise
(
ActiveRecord
::
RecordInvalid
)
expect
(
application
).
to
receive
(
:make_installing!
).
once
.
and_raise
(
ActiveRecord
::
RecordInvalid
)
expect
_any_instance_of
(
Gitlab
::
Kubernetes
::
Helm
).
not_to
receive
(
:install
)
expect
(
helm_client
).
not_to
receive
(
:install
)
service
.
execute
service
.
execute
...
...
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