Skip to content

Commit

Permalink
🐛 fix GKE cluster resource (#1697)
Browse files Browse the repository at this point in the history
Fixes the following error for GKE clusters:
```
  masterAuthorizedNetworksConfig: failed to convert dict to primitive, unsupported child type: []map[string]interface {}
```

Signed-off-by: Ivan Milchev <[email protected]>
  • Loading branch information
imilchev authored Sep 12, 2023
1 parent 3af3c8c commit 882cdc3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions providers/gcp/resources/gke.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ package resources
import (
"context"
"fmt"
"strings"

"go.mondoo.com/cnquery/llx"
"go.mondoo.com/cnquery/providers-sdk/v1/plugin"
"go.mondoo.com/cnquery/providers-sdk/v1/util/convert"
"go.mondoo.com/cnquery/providers/gcp/connection"
"go.mondoo.com/cnquery/types"
"strings"

container "cloud.google.com/go/container/apiv1"
"cloud.google.com/go/container/apiv1/containerpb"
Expand All @@ -28,7 +29,6 @@ func (g *mqlGcpProjectGkeService) id() (string, error) {
}

func (g *mqlGcpProject) gke() (*mqlGcpProjectGkeService, error) {

if g.Id.Error != nil {
return nil, g.Id.Error
}
Expand Down Expand Up @@ -412,7 +412,7 @@ func (g *mqlGcpProjectGkeService) clusters() ([]interface{}, error) {

var masterAuthorizedNetworksCfg map[string]interface{}
if c.MasterAuthorizedNetworksConfig != nil {
cidrBlocks := make([]map[string]interface{}, 0, len(c.MasterAuthorizedNetworksConfig.CidrBlocks))
cidrBlocks := make([]interface{}, 0, len(c.MasterAuthorizedNetworksConfig.CidrBlocks))
for _, cidrBlock := range c.MasterAuthorizedNetworksConfig.CidrBlocks {
cidrBlocks = append(cidrBlocks, map[string]interface{}{
"displayName": cidrBlock.DisplayName,
Expand Down

0 comments on commit 882cdc3

Please sign in to comment.