Skip to content

Commit

Permalink
Merge pull request #79 from maleck13/client-config
Browse files Browse the repository at this point in the history
dont fail when missing configmap
  • Loading branch information
maleck13 authored Feb 12, 2018
2 parents cd716b2 + 38b38dc commit b7e51e7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/cmd/clientConfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"github.com/olekukonko/tablewriter"
"github.com/pkg/errors"
"github.com/spf13/cobra"
kerror "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
)
Expand Down Expand Up @@ -71,7 +72,11 @@ kubectl plugin mobile get clientconfig`,
var svcConfig *ServiceConfig
var err error
configMap, err := ccc.k8Client.CoreV1().ConfigMaps(ns).Get(svc.Name, v1.GetOptions{})
// ignoring not found as some services will not have this public configmap
if err != nil {
if kerror.IsNotFound(err) {
continue
}
return errors.Wrap(err, "unable to create config. Failed to get service "+svc.Name+" configmap")
}
if _, ok := convertors[svc.Name]; !ok {
Expand Down

0 comments on commit b7e51e7

Please sign in to comment.