From 0f61fdb585dd9f453e6228384920ebee45c544e6 Mon Sep 17 00:00:00 2001 From: Beraldo Leal Date: Fri, 7 Feb 2025 21:03:35 -0500 Subject: [PATCH] gcp: go mod tidy Making CI happy Signed-off-by: Beraldo Leal --- src/cloud-api-adaptor/go.mod | 1 - src/cloud-api-adaptor/test/e2e/gcp_common.go | 12 +++--------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/cloud-api-adaptor/go.mod b/src/cloud-api-adaptor/go.mod index 7059e5119..08fece8c1 100644 --- a/src/cloud-api-adaptor/go.mod +++ b/src/cloud-api-adaptor/go.mod @@ -194,7 +194,6 @@ require ( golang.org/x/text v0.21.0 // indirect golang.org/x/time v0.5.0 // indirect golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect - google.golang.org/api v0.162.0 // indirect google.golang.org/appengine v1.6.8 // indirect google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240213162025-012b6fc9bca9 // indirect diff --git a/src/cloud-api-adaptor/test/e2e/gcp_common.go b/src/cloud-api-adaptor/test/e2e/gcp_common.go index 2bb6d8e42..e913f64b7 100644 --- a/src/cloud-api-adaptor/test/e2e/gcp_common.go +++ b/src/cloud-api-adaptor/test/e2e/gcp_common.go @@ -8,27 +8,24 @@ import ( "fmt" "testing" "time" - + compute "cloud.google.com/go/compute/apiv1" - pv "github.com/confidential-containers/cloud-api-adaptor/src/cloud-api-adaptor/test/provisioner/gcp" computepb "cloud.google.com/go/compute/apiv1/computepb" + pv "github.com/confidential-containers/cloud-api-adaptor/src/cloud-api-adaptor/test/provisioner/gcp" log "github.com/sirupsen/logrus" ) // GCPCloudAssert implements the CloudAssert interface for gcp. type GCPCloudAssert struct{} - func NewGCPAssert() GCPCloudAssert { return GCPCloudAssert{} } - func (c GCPCloudAssert) DefaultTimeout() time.Duration { return 2 * time.Minute } - func gcpFindVM(prefixName string) (*computepb.Instance, error) { ctx := context.Background() instancesClient, err := compute.NewInstancesRESTClient(ctx) @@ -37,7 +34,6 @@ func gcpFindVM(prefixName string) (*computepb.Instance, error) { } defer instancesClient.Close() - filter := fmt.Sprintf("name eq ^%s.*", prefixName) req := &computepb.ListInstancesRequest{ Project: pv.GCPProps.GkeCluster.ProjectID, @@ -55,10 +51,9 @@ func gcpFindVM(prefixName string) (*computepb.Instance, error) { return instance, nil } - func (c GCPCloudAssert) HasPodVM(t *testing.T, id string) { pod_vm_prefix := "podvm-" + id - vm, err := gcpFindVM(pod_vm_prefix) + vm, err := gcpFindVM(pod_vm_prefix) if vm != nil { t.Logf("Vitural machine %s found.", id) } else { @@ -66,7 +61,6 @@ func (c GCPCloudAssert) HasPodVM(t *testing.T, id string) { t.Error("PodVM was not created") } } - func (c GCPCloudAssert) GetInstanceType(t *testing.T, podName string) (string, error) { // Get Instance Type of PodVM