Skip to content

Commit

Permalink
Add error handling in cache package
Browse files Browse the repository at this point in the history
Signed-off-by: Uddeshya Singh <[email protected]>
  • Loading branch information
uds5501 committed Jan 3, 2021
1 parent e913454 commit c787318
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions internal/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,21 @@ var (

func init() {
// Initialize Kubeconfig
rconfig, _ := mesherykube.DetectKubeConfig()
rconfig, err1 := mesherykube.DetectKubeConfig()
if err1 != nil {
return
}

// Configure discovery client
dclient, _ := discovery.NewClient(rconfig)
dclient, err2 := discovery.NewClient(rconfig)
if err2 != nil {
return
}

namespaces, _ := dclient.ListNamespaces()
namespaces, err3 := dclient.ListNamespaces()
if err3 != nil {
return
}
var namespacesName []string

// processing
Expand Down

0 comments on commit c787318

Please sign in to comment.