From 54c7d8faab0ef4123a089488e42f096a59c2fea7 Mon Sep 17 00:00:00 2001 From: Ivan Milchev Date: Mon, 11 Mar 2024 11:55:07 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20gcp=20init=20functions=20p?= =?UTF-8?q?anic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ivan Milchev --- providers/gcp/resources/bigquery.go | 2 ++ providers/gcp/resources/compute.go | 2 ++ providers/gcp/resources/gke.go | 3 +++ providers/gcp/resources/storage.go | 3 +++ 4 files changed, 10 insertions(+) diff --git a/providers/gcp/resources/bigquery.go b/providers/gcp/resources/bigquery.go index b57a50ab0d..fed451ec95 100644 --- a/providers/gcp/resources/bigquery.go +++ b/providers/gcp/resources/bigquery.go @@ -190,6 +190,8 @@ func initGcpProjectBigqueryServiceDataset(runtime *plugin.Runtime, args map[stri args["id"] = llx.StringData(ids.name) args["location"] = llx.StringData(ids.region) args["projectId"] = llx.StringData(ids.project) + } else { + return nil, nil, errors.New("no asset identifier found") } } diff --git a/providers/gcp/resources/compute.go b/providers/gcp/resources/compute.go index b2d0bdb5d1..b093b2b50b 100644 --- a/providers/gcp/resources/compute.go +++ b/providers/gcp/resources/compute.go @@ -807,6 +807,8 @@ func initGcpProjectComputeServiceFirewall(runtime *plugin.Runtime, args map[stri if ids := getAssetIdentifier(runtime); ids != nil { args["name"] = llx.StringData(ids.name) args["projectId"] = llx.StringData(ids.project) + } else { + return nil, nil, errors.New("no asset identifier found") } } diff --git a/providers/gcp/resources/gke.go b/providers/gcp/resources/gke.go index 96ca81afed..a0849b625a 100644 --- a/providers/gcp/resources/gke.go +++ b/providers/gcp/resources/gke.go @@ -5,6 +5,7 @@ package resources import ( "context" + "errors" "fmt" "strings" @@ -62,6 +63,8 @@ func initGcpProjectGkeServiceCluster(runtime *plugin.Runtime, args map[string]*l args["name"] = llx.StringData(ids.name) args["location"] = llx.StringData(ids.region) args["projectId"] = llx.StringData(ids.project) + } else { + return nil, nil, errors.New("no asset identifier found") } } diff --git a/providers/gcp/resources/storage.go b/providers/gcp/resources/storage.go index b02c23ee76..d0f229a445 100644 --- a/providers/gcp/resources/storage.go +++ b/providers/gcp/resources/storage.go @@ -5,6 +5,7 @@ package resources import ( "context" + "errors" "fmt" "strconv" @@ -143,6 +144,8 @@ func initGcpProjectStorageServiceBucket(runtime *plugin.Runtime, args map[string args["name"] = llx.StringData(ids.name) args["projectId"] = llx.StringData(ids.project) args["location"] = llx.StringData(ids.region) + } else { + return nil, nil, errors.New("no asset identifier found") } }