Skip to content

Commit

Permalink
Merge pull request #73 from wzshiming/patch-1
Browse files Browse the repository at this point in the history
Fix panic when failed to get namespace.
  • Loading branch information
c-bata authored Jan 6, 2020
2 parents fee61bc + 423ae26 commit ebb7c45
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kube/completer.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func NewCompleter() (*Completer, error) {

namespaces, err := client.CoreV1().Namespaces().List(metav1.ListOptions{})
if err != nil {
if err.(*errors.StatusError).Status().Code == 403 {
if statusError, ok := err.(*errors.StatusError); ok && statusError.Status().Code == 403 {
namespaces = nil
} else {
return nil, err
Expand Down

0 comments on commit ebb7c45

Please sign in to comment.