From eae44c590f7e0c4d2d397e03cdcc07ba6d316056 Mon Sep 17 00:00:00 2001 From: Jingyi Hu Date: Tue, 3 Dec 2024 23:59:05 +0000 Subject: [PATCH] chore: do not import direct package in apis --- apis/bigqueryconnection/v1alpha1/connection_reference.go | 6 +++--- apis/compute/v1beta1/targettcpproxy_reference.go | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/apis/bigqueryconnection/v1alpha1/connection_reference.go b/apis/bigqueryconnection/v1alpha1/connection_reference.go index 47d28d3420..fc87be509a 100644 --- a/apis/bigqueryconnection/v1alpha1/connection_reference.go +++ b/apis/bigqueryconnection/v1alpha1/connection_reference.go @@ -19,8 +19,8 @@ import ( "fmt" "strings" + "github.com/GoogleCloudPlatform/k8s-config-connector/apis/common" refsv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/apis/refs/v1beta1" - "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/controller/direct" "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/k8s" "github.com/google/uuid" apierrors "k8s.io/apimachinery/pkg/api/errors" @@ -45,7 +45,7 @@ func NewBigQueryConnectionConnectionRef(ctx context.Context, reader client.Reade location := obj.Spec.Location // Get desired service-generated ID from spec - desiredServiceID := direct.ValueOf(obj.Spec.ResourceID) + desiredServiceID := common.ValueOf(obj.Spec.ResourceID) if desiredServiceID != "" { if _, err := uuid.Parse(desiredServiceID); err != nil { return nil, fmt.Errorf("spec.resourceID should be in a UUID format, got %s ", desiredServiceID) @@ -53,7 +53,7 @@ func NewBigQueryConnectionConnectionRef(ctx context.Context, reader client.Reade } // Get externalReference - externalRef := direct.ValueOf(obj.Status.ExternalRef) + externalRef := common.ValueOf(obj.Status.ExternalRef) if externalRef != "" { tokens := strings.Split(externalRef, "/") diff --git a/apis/compute/v1beta1/targettcpproxy_reference.go b/apis/compute/v1beta1/targettcpproxy_reference.go index 1e28b254fd..66aab79bdf 100644 --- a/apis/compute/v1beta1/targettcpproxy_reference.go +++ b/apis/compute/v1beta1/targettcpproxy_reference.go @@ -19,8 +19,7 @@ import ( "fmt" "strings" - "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/controller/direct" - + "github.com/GoogleCloudPlatform/k8s-config-connector/apis/common" refsv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/apis/refs/v1beta1" "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/k8s" apierrors "k8s.io/apimachinery/pkg/api/errors" @@ -102,7 +101,7 @@ func NewComputeTargetTCPProxyRef(ctx context.Context, reader client.Reader, obj if obj.Spec.Location == nil { id.parent = &ComputeTargetTCPProxyParent{ProjectID: projectID, Region: "global"} } else { - region := direct.ValueOf(obj.Spec.Location) + region := common.ValueOf(obj.Spec.Location) id.parent = &ComputeTargetTCPProxyParent{ProjectID: projectID, Region: region} }