Skip to content

Commit

Permalink
Handle errors of adding tfjob scheme
Browse files Browse the repository at this point in the history
To fix the gometalinter error
  • Loading branch information
ohmystack committed Aug 19, 2019
1 parent d0c924c commit ddf4d85
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion pkg/controller.v1/tensorflow/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@ func NewTFController(
tfJobInformerFactory tfjobinformers.SharedInformerFactory,
option options.ServerOption) *TFController {

tfjobscheme.AddToScheme(scheme.Scheme)
err := tfjobscheme.AddToScheme(scheme.Scheme)
if err != nil {
log.Fatalf("Failed to add tfjob scheme: %v", err)
}

log.Info("Creating TFJob controller")
// Create new TFController.
Expand Down
5 changes: 4 additions & 1 deletion pkg/controller.v1beta2/tensorflow/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,10 @@ func NewTFController(
tfJobInformerFactory tfjobinformers.SharedInformerFactory,
option options.ServerOption) *TFController {

tfjobscheme.AddToScheme(scheme.Scheme)
err := tfjobscheme.AddToScheme(scheme.Scheme)
if err != nil {
log.Fatalf("Failed to add tfjob scheme: %v", err)
}

log.Info("Creating TFJob controller")
// Create new TFController.
Expand Down

0 comments on commit ddf4d85

Please sign in to comment.