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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
8d3e96ac
Commit
8d3e96ac
authored
Dec 10, 2018
by
Dylan Griffith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add more structured JSON logging to Kubernetes classes
parent
80eebd8e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
app/services/clusters/gcp/fetch_operation_service.rb
app/services/clusters/gcp/fetch_operation_service.rb
+7
-0
app/services/clusters/gcp/finalize_creation_service.rb
app/services/clusters/gcp/finalize_creation_service.rb
+7
-0
No files found.
app/services/clusters/gcp/fetch_operation_service.rb
View file @
8d3e96ac
...
...
@@ -11,8 +11,15 @@ module Clusters
yield
(
operation
)
if
block_given?
rescue
Google
::
Apis
::
ServerError
,
Google
::
Apis
::
ClientError
,
Google
::
Apis
::
AuthorizationError
=>
e
logger
.
error
(
exception:
e
.
class
.
name
,
service:
self
.
class
.
name
,
provider_id:
provider
.
id
,
message:
e
.
message
)
provider
.
make_errored!
(
"Failed to request to CloudPlatform;
#{
e
.
message
}
"
)
end
private
def
logger
@logger
||=
Gitlab
::
Kubernetes
::
Logger
.
build
end
end
end
end
app/services/clusters/gcp/finalize_creation_service.rb
View file @
8d3e96ac
...
...
@@ -16,15 +16,22 @@ module Clusters
ClusterPlatformConfigureWorker
.
perform_async
(
cluster
.
id
)
rescue
Google
::
Apis
::
ServerError
,
Google
::
Apis
::
ClientError
,
Google
::
Apis
::
AuthorizationError
=>
e
logger
.
error
(
exception:
e
.
class
.
name
,
service:
self
.
class
.
name
,
provider_id:
provider
.
id
,
message:
e
.
message
)
provider
.
make_errored!
(
"Failed to request to CloudPlatform;
#{
e
.
message
}
"
)
rescue
Kubeclient
::
HttpError
=>
e
logger
.
error
(
exception:
e
.
class
.
name
,
service:
self
.
class
.
name
,
provider_id:
provider
.
id
,
message:
e
.
message
)
provider
.
make_errored!
(
"Failed to run Kubeclient:
#{
e
.
message
}
"
)
rescue
ActiveRecord
::
RecordInvalid
=>
e
logger
.
error
(
exception:
e
.
class
.
name
,
service:
self
.
class
.
name
,
provider_id:
provider
.
id
,
message:
e
.
message
)
provider
.
make_errored!
(
"Failed to configure Google Kubernetes Engine Cluster:
#{
e
.
message
}
"
)
end
private
def
logger
@logger
||=
Gitlab
::
Kubernetes
::
Logger
.
build
end
def
create_gitlab_service_account!
Clusters
::
Gcp
::
Kubernetes
::
CreateOrUpdateServiceAccountService
.
gitlab_creator
(
kube_client
,
...
...
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