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
e58347bd
Commit
e58347bd
authored
Nov 11, 2018
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master' into ce-to-ee-2018-11-11
parents
988415ab
f69f7a67
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
3 deletions
+20
-3
app/services/clusters/gcp/kubernetes/create_or_update_namespace_service.rb
...ters/gcp/kubernetes/create_or_update_namespace_service.rb
+0
-2
app/workers/cluster_platform_configure_worker.rb
app/workers/cluster_platform_configure_worker.rb
+1
-1
changelogs/unreleased/fix-error-handling-bugs-in-kubernetes-integration.yml
...sed/fix-error-handling-bugs-in-kubernetes-integration.yml
+5
-0
spec/workers/cluster_platform_configure_worker_spec.rb
spec/workers/cluster_platform_configure_worker_spec.rb
+14
-0
No files found.
app/services/clusters/gcp/kubernetes/create_or_update_namespace_service.rb
View file @
e58347bd
...
...
@@ -16,8 +16,6 @@ module Clusters
configure_kubernetes_token
kubernetes_namespace
.
save!
rescue
::
Kubeclient
::
HttpError
=>
err
raise
err
unless
err
.
error_code
=
404
end
private
...
...
app/workers/cluster_platform_configure_worker.rb
View file @
e58347bd
...
...
@@ -17,6 +17,6 @@ class ClusterPlatformConfigureWorker
end
rescue
::
Kubeclient
::
HttpError
=>
err
Rails
.
logger
.
error
"Failed to create/update Kubernetes
Namespace. id:
#{
kubernetes_namespace
.
id
}
message
:
#{
err
.
message
}
"
Rails
.
logger
.
error
"Failed to create/update Kubernetes
namespace for cluster_id:
#{
cluster_id
}
with error
:
#{
err
.
message
}
"
end
end
changelogs/unreleased/fix-error-handling-bugs-in-kubernetes-integration.yml
0 → 100644
View file @
e58347bd
---
title
:
Fix error handling bugs in kubernetes integration
merge_request
:
22922
author
:
type
:
fixed
spec/workers/cluster_platform_configure_worker_spec.rb
View file @
e58347bd
...
...
@@ -30,4 +30,18 @@ describe ClusterPlatformConfigureWorker, '#execute' do
described_class
.
new
.
perform
(
123
)
end
end
context
'when kubeclient raises error'
do
let
(
:cluster
)
{
create
(
:cluster
,
:project
)
}
it
'rescues and logs the error'
do
allow_any_instance_of
(
Clusters
::
Gcp
::
Kubernetes
::
CreateOrUpdateNamespaceService
).
to
receive
(
:execute
).
and_raise
(
::
Kubeclient
::
HttpError
.
new
(
500
,
'something baaaad happened'
,
''
))
expect
(
Rails
.
logger
)
.
to
receive
(
:error
)
.
with
(
"Failed to create/update Kubernetes namespace for cluster_id:
#{
cluster
.
id
}
with error: something baaaad happened"
)
described_class
.
new
.
perform
(
cluster
.
id
)
end
end
end
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