Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recompile plugin with steampipe-plugin-sdk v5.2.0 #438

Merged
merged 2 commits into from
Mar 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions gcp/compute_location_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package gcp
import (
"context"

"github.com/turbot/steampipe-plugin-sdk/v4/plugin"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin"
)

// func init() {
Expand Down Expand Up @@ -44,7 +44,7 @@ func BuildComputeLocationList(ctx context.Context, d *plugin.QueryData) []map[st
// validate location list
matrix := make([]map[string]interface{}, len(resp.Items))
for i, location := range resp.Items {
matrix[i] = map[string]interface{}{matrixKeyLocation: location}
matrix[i] = map[string]interface{}{matrixKeyLocation: location.Name}
}
d.ConnectionManager.Cache.Set(locationCacheKey, matrix)
return matrix
Expand Down
4 changes: 2 additions & 2 deletions gcp/connection_config.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package gcp

import (
"github.com/turbot/steampipe-plugin-sdk/v4/plugin"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin/schema"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin/schema"
)

type gcpConfig struct {
Expand Down
2 changes: 1 addition & 1 deletion gcp/ignore_error_predicate.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/turbot/go-kit/helpers"
"github.com/turbot/go-kit/types"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin"
"google.golang.org/api/googleapi"
)

Expand Down
2 changes: 1 addition & 1 deletion gcp/kms_multi_location.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package gcp
import (
"context"

"github.com/turbot/steampipe-plugin-sdk/v4/plugin"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin"
)

// var pluginQueryData *plugin.QueryData
Expand Down
6 changes: 3 additions & 3 deletions gcp/monitoring_metric.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"strings"
"time"

"github.com/turbot/steampipe-plugin-sdk/v4/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin/transform"
"github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin/transform"
"google.golang.org/api/monitoring/v3"
)

Expand Down
4 changes: 2 additions & 2 deletions gcp/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ package gcp
import (
"context"

"github.com/turbot/steampipe-plugin-sdk/v4/plugin"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin/transform"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin/transform"
)

const pluginName = "steampipe-plugin-gcp"
Expand Down
2 changes: 1 addition & 1 deletion gcp/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package gcp
import (
"context"

"github.com/turbot/steampipe-plugin-sdk/v4/plugin"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin"
"google.golang.org/api/accessapproval/v1"
"google.golang.org/api/bigquery/v2"
"google.golang.org/api/bigtableadmin/v2"
Expand Down
6 changes: 3 additions & 3 deletions gcp/table_gcp_audit_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package gcp
import (
"context"

"github.com/turbot/steampipe-plugin-sdk/v4/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin/transform"
"github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin/transform"

"google.golang.org/api/cloudresourcemanager/v1"
)
Expand Down
10 changes: 5 additions & 5 deletions gcp/table_gcp_bigquery_dataset.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"strings"

"github.com/turbot/go-kit/types"
"github.com/turbot/steampipe-plugin-sdk/v4/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin/transform"
"github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin/transform"

"google.golang.org/api/bigquery/v2"
)
Expand Down Expand Up @@ -183,7 +183,7 @@ func listBigQueryDatasets(ctx context.Context, d *plugin.QueryData, h *plugin.Hy

// Check if context has been cancelled or if the limit has been hit (if specified)
// if there is a limit, it will return the number of rows required to reach this limit
if d.QueryStatus.RowsRemaining(ctx) == 0 {
if d.RowsRemaining(ctx) == 0 {
page.NextPageToken = ""
return nil
}
Expand Down Expand Up @@ -218,7 +218,7 @@ func getBigQueryDataset(ctx context.Context, d *plugin.QueryData, h *plugin.Hydr
data := datasetID(h.Item)
id = strings.Split(data, ":")[1]
} else {
id = d.KeyColumnQuals["dataset_id"].GetStringValue()
id = d.EqualsQuals["dataset_id"].GetStringValue()
}

// check if id is empty
Expand Down
10 changes: 5 additions & 5 deletions gcp/table_gcp_bigquery_job.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"strings"

"github.com/turbot/go-kit/types"
"github.com/turbot/steampipe-plugin-sdk/v4/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin/transform"
"github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin/transform"
"google.golang.org/api/bigquery/v2"
)

Expand Down Expand Up @@ -275,7 +275,7 @@ func listBigQueryJobs(ctx context.Context, d *plugin.QueryData, h *plugin.Hydrat

// Check if context has been cancelled or if the limit has been hit (if specified)
// if there is a limit, it will return the number of rows required to reach this limit
if d.QueryStatus.RowsRemaining(ctx) == 0 {
if d.RowsRemaining(ctx) == 0 {
page.NextPageToken = ""
return nil
}
Expand Down Expand Up @@ -310,7 +310,7 @@ func getBigQueryJob(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateD
data := jobID(h.Item)
id = strings.Split(data, ".")[1]
} else {
id = d.KeyColumnQuals["job_id"].GetStringValue()
id = d.EqualsQuals["job_id"].GetStringValue()
}

// handle empty id in get call
Expand Down
12 changes: 6 additions & 6 deletions gcp/table_gcp_bigquery_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"strings"

"github.com/turbot/go-kit/types"
"github.com/turbot/steampipe-plugin-sdk/v4/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin/transform"
"github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin/transform"
"google.golang.org/api/bigquery/v2"
)

Expand Down Expand Up @@ -281,7 +281,7 @@ func listBigqueryTables(ctx context.Context, d *plugin.QueryData, h *plugin.Hydr

// Check if context has been cancelled or if the limit has been hit (if specified)
// if there is a limit, it will return the number of rows required to reach this limit
if d.QueryStatus.RowsRemaining(ctx) == 0 {
if d.RowsRemaining(ctx) == 0 {
page.NextPageToken = ""
return nil
}
Expand Down Expand Up @@ -318,8 +318,8 @@ func getBigqueryTable(ctx context.Context, d *plugin.QueryData, h *plugin.Hydrat
datasetID = data.TableReference.DatasetId
id = data.TableReference.TableId
} else {
datasetID = d.KeyColumnQuals["dataset_id"].GetStringValue()
id = d.KeyColumnQuals["table_id"].GetStringValue()
datasetID = d.EqualsQuals["dataset_id"].GetStringValue()
id = d.EqualsQuals["table_id"].GetStringValue()
}

// Empty Check
Expand Down
8 changes: 4 additions & 4 deletions gcp/table_gcp_bigtable_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"context"
"strings"

"github.com/turbot/steampipe-plugin-sdk/v4/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin/transform"
"github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin/transform"

"google.golang.org/api/bigtableadmin/v2"
)
Expand Down Expand Up @@ -152,7 +152,7 @@ func getBigtableInstance(ctx context.Context, d *plugin.QueryData, h *plugin.Hyd
}
project := projectId.(string)

name := d.KeyColumnQuals["name"].GetStringValue()
name := d.EqualsQuals["name"].GetStringValue()

resp, err := service.Projects.Instances.Get("projects/" + project + "/instances/" + name).Do()
if err != nil {
Expand Down
12 changes: 6 additions & 6 deletions gcp/table_gcp_cloudfunctions_function.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"strings"

"github.com/turbot/go-kit/types"
"github.com/turbot/steampipe-plugin-sdk/v4/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin/transform"
"github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin/transform"

"google.golang.org/api/cloudfunctions/v1"
)
Expand Down Expand Up @@ -238,7 +238,7 @@ func listCloudFunctions(ctx context.Context, d *plugin.QueryData, h *plugin.Hydr

// Check if context has been cancelled or if the limit has been hit (if specified)
// if there is a limit, it will return the number of rows required to reach this limit
if d.QueryStatus.RowsRemaining(ctx) == 0 {
if d.RowsRemaining(ctx) == 0 {
page.NextPageToken = ""
return nil
}
Expand Down Expand Up @@ -270,8 +270,8 @@ func getCloudFunction(ctx context.Context, d *plugin.QueryData, h *plugin.Hydrat
}
project := projectId.(string)

name := d.KeyColumnQuals["name"].GetStringValue()
location := d.KeyColumnQuals["location"].GetStringValue()
name := d.EqualsQuals["name"].GetStringValue()
location := d.EqualsQuals["location"].GetStringValue()

// API https://cloud.google.com/functions/docs/reference/rest/v1/projects.locations.functions/get
cloudFunction, err := service.Projects.Locations.Functions.Get("projects/" + project + "/locations/" + location + "/functions/" + name).Do()
Expand Down
10 changes: 5 additions & 5 deletions gcp/table_gcp_compute_address.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"strings"

"github.com/turbot/go-kit/types"
"github.com/turbot/steampipe-plugin-sdk/v4/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin/transform"
"github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin/transform"

"google.golang.org/api/compute/v1"
)
Expand Down Expand Up @@ -196,7 +196,7 @@ func listComputeAddresses(ctx context.Context, d *plugin.QueryData, h *plugin.Hy

// Check if context has been cancelled or if the limit has been hit (if specified)
// if there is a limit, it will return the number of rows required to reach this limit
if d.QueryStatus.RowsRemaining(ctx) == 0 {
if d.RowsRemaining(ctx) == 0 {
page.NextPageToken = ""
return nil
}
Expand Down Expand Up @@ -227,7 +227,7 @@ func getComputeAddress(ctx context.Context, d *plugin.QueryData, h *plugin.Hydra
project := projectId.(string)

var address compute.Address
name := d.KeyColumnQuals["name"].GetStringValue()
name := d.EqualsQuals["name"].GetStringValue()

// Empty check
if name == "" {
Expand Down
10 changes: 5 additions & 5 deletions gcp/table_gcp_compute_autoscaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"strings"

"github.com/turbot/go-kit/types"
"github.com/turbot/steampipe-plugin-sdk/v4/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin/transform"
"github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin/transform"
"google.golang.org/api/compute/v1"
)

Expand Down Expand Up @@ -179,7 +179,7 @@ func listComputeAutoscaler(ctx context.Context, d *plugin.QueryData, h *plugin.H

// Check if context has been cancelled or if the limit has been hit (if specified)
// if there is a limit, it will return the number of rows required to reach this limit
if d.QueryStatus.RowsRemaining(ctx) == 0 {
if d.RowsRemaining(ctx) == 0 {
page.NextPageToken = ""
return nil
}
Expand Down Expand Up @@ -207,7 +207,7 @@ func getComputeAutoscaler(ctx context.Context, d *plugin.QueryData, h *plugin.Hy
project := projectId.(string)

var autoscaler compute.Autoscaler
name := d.KeyColumnQuals["name"].GetStringValue()
name := d.EqualsQuals["name"].GetStringValue()
if name == "" {
return nil, nil
}
Expand Down
10 changes: 5 additions & 5 deletions gcp/table_gcp_compute_backend_bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"strings"

"github.com/turbot/go-kit/types"
"github.com/turbot/steampipe-plugin-sdk/v4/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin/transform"
"github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin/transform"

"google.golang.org/api/compute/v1"
)
Expand Down Expand Up @@ -164,7 +164,7 @@ func listComputeBackendBuckets(ctx context.Context, d *plugin.QueryData, h *plug

// Check if context has been cancelled or if the limit has been hit (if specified)
// if there is a limit, it will return the number of rows required to reach this limit
if d.QueryStatus.RowsRemaining(ctx) == 0 {
if d.RowsRemaining(ctx) == 0 {
page.NextPageToken = ""
return nil
}
Expand Down Expand Up @@ -194,7 +194,7 @@ func getComputeBackendBucket(ctx context.Context, d *plugin.QueryData, h *plugin
}
project := projectId.(string)

name := d.KeyColumnQuals["name"].GetStringValue()
name := d.EqualsQuals["name"].GetStringValue()

// Error: pq: rpc error: code = Unknown desc = json: invalid use of ,string struct tag,
// trying to unmarshal "projects/project/global/backendBuckets/" into uint64
Expand Down
10 changes: 5 additions & 5 deletions gcp/table_gcp_compute_backend_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"strings"

"github.com/turbot/go-kit/types"
"github.com/turbot/steampipe-plugin-sdk/v4/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin/transform"
"github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin/transform"

"google.golang.org/api/compute/v1"
)
Expand Down Expand Up @@ -286,7 +286,7 @@ func listComputeBackendServices(ctx context.Context, d *plugin.QueryData, h *plu

// Check if context has been cancelled or if the limit has been hit (if specified)
// if there is a limit, it will return the number of rows required to reach this limit
if d.QueryStatus.RowsRemaining(ctx) == 0 {
if d.RowsRemaining(ctx) == 0 {
page.NextPageToken = ""
return nil
}
Expand Down Expand Up @@ -318,7 +318,7 @@ func getComputeBackendService(ctx context.Context, d *plugin.QueryData, h *plugi
project := projectId.(string)

var backendService compute.BackendService
name := d.KeyColumnQuals["name"].GetStringValue()
name := d.EqualsQuals["name"].GetStringValue()

resp := service.BackendServices.AggregatedList(project).Filter("name=" + name)
if err := resp.Pages(
Expand Down
10 changes: 5 additions & 5 deletions gcp/table_gcp_compute_disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"strings"

"github.com/turbot/go-kit/types"
"github.com/turbot/steampipe-plugin-sdk/v4/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin/transform"
"github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin/transform"
"google.golang.org/api/compute/v1"
)

Expand Down Expand Up @@ -307,7 +307,7 @@ func listComputeDisk(ctx context.Context, d *plugin.QueryData, h *plugin.Hydrate

// Check if context has been cancelled or if the limit has been hit (if specified)
// if there is a limit, it will return the number of rows required to reach this limit
if d.QueryStatus.RowsRemaining(ctx) == 0 {
if d.RowsRemaining(ctx) == 0 {
page.NextPageToken = ""
return nil
}
Expand Down Expand Up @@ -341,7 +341,7 @@ func getComputeDisk(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateD
project := projectId.(string)

var disk compute.Disk
name := d.KeyColumnQuals["name"].GetStringValue()
name := d.EqualsQuals["name"].GetStringValue()

resp := service.Disks.AggregatedList(project).Filter("name=" + name)
if err := resp.Pages(ctx, func(page *compute.DiskAggregatedList) error {
Expand Down
Loading