Skip to content

Commit

Permalink
Fix error collides with imported package name (istio#16050)
Browse files Browse the repository at this point in the history
  • Loading branch information
moriadry authored and istio-testing committed Aug 6, 2019
1 parent 4c1fb25 commit 6ecc2c1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions pkg/kube/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ func CreateInterfaceFromClusterConfig(clusterConfig *clientcmdapi.Config) (kuber
// from passed cluster's config struct
func createInterface(clusterConfig *clientcmdapi.Config) (kubernetes.Interface, error) {
clientConfig := clientcmd.NewDefaultClientConfig(*clusterConfig, &clientcmd.ConfigOverrides{})
rest, err := clientConfig.ClientConfig()
restConfig, err := clientConfig.ClientConfig()
if err != nil {
return nil, err
}
return kubernetes.NewForConfig(rest)
return kubernetes.NewForConfig(restConfig)
}
4 changes: 2 additions & 2 deletions pkg/mcp/configz/server/configz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ func testConfigJWithOneRequest(t *testing.T, baseURL string) {
}

exists = false
for _, snapshot := range m["Snapshots"].([]interface{}) {
if snapshot.(map[string]interface{})["Collection"].(string) == testK8sCollection {
for _, ss := range m["Snapshots"].([]interface{}) {
if ss.(map[string]interface{})["Collection"].(string) == testK8sCollection {
exists = true
break
}
Expand Down
8 changes: 4 additions & 4 deletions pkg/mcp/status/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,11 @@ func (s *Status) WithDetails(details ...proto.Message) (*Status, error) {
// s.Code() != OK implies that s.Proto() != nil.
p := s.Proto()
for _, detail := range details {
any, err := types.MarshalAny(detail)
body, err := types.MarshalAny(detail)
if err != nil {
return nil, err
}
p.Details = append(p.Details, any)
p.Details = append(p.Details, body)
}
return &Status{s: p}, nil
}
Expand All @@ -197,9 +197,9 @@ func (s *Status) Details() []interface{} {
return nil
}
details := make([]interface{}, 0, len(s.s.Details))
for _, any := range s.s.Details {
for _, body := range s.s.Details {
detail := &types.DynamicAny{}
if err := types.UnmarshalAny(any, detail); err != nil {
if err := types.UnmarshalAny(body, detail); err != nil {
details = append(details, err)
continue
}
Expand Down

0 comments on commit 6ecc2c1

Please sign in to comment.