Skip to content

Commit

Permalink
gcp: go mod tidy
Browse files Browse the repository at this point in the history
Making CI happy

Signed-off-by: Beraldo Leal <bleal@redhat.com>
  • Loading branch information
beraldoleal committed Feb 13, 2025
1 parent 9c13521 commit 0f61fdb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
1 change: 0 additions & 1 deletion src/cloud-api-adaptor/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 3 additions & 9 deletions src/cloud-api-adaptor/test/e2e/gcp_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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,
Expand All @@ -55,18 +51,16 @@ 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 {
t.Logf("Virtual machine %s not found: %s", id, err)
t.Error("PodVM was not created")
}
}


func (c GCPCloudAssert) GetInstanceType(t *testing.T, podName string) (string, error) {
// Get Instance Type of PodVM
Expand Down

0 comments on commit 0f61fdb

Please sign in to comment.