From 19487b85a08d964303d5677b28be8d2f5afa049c Mon Sep 17 00:00:00 2001 From: Gemma Hou Date: Wed, 30 Oct 2024 22:45:45 +0000 Subject: [PATCH] Migrate compute target TCP proxy(global) to direct controller --- .../v1beta1/targettcpproxy_reference.go | 33 +- apis/compute/v1beta1/zz_generated.deepcopy.go | 15 + dev/tasks/run-e2e | 2 +- mockgcp/mockcompute/globaltargettcpproxyv1.go | 4 +- .../direct/compute/targettcpproxy/refs.go | 100 ++++++ .../targettcpproxy_controller.go | 330 ++++++++++++++++++ pkg/controller/direct/register/register.go | 1 + .../globalcomputeforwardingruletcp/_http.log | 94 +++-- ...d_object_computetargettcpproxy.golden.yaml | 7 +- .../v1beta1/computetargettcpproxy/_http.log | 62 ++-- 10 files changed, 571 insertions(+), 77 deletions(-) create mode 100644 pkg/controller/direct/compute/targettcpproxy/refs.go create mode 100644 pkg/controller/direct/compute/targettcpproxy/targettcpproxy_controller.go diff --git a/apis/compute/v1beta1/targettcpproxy_reference.go b/apis/compute/v1beta1/targettcpproxy_reference.go index 2165c313948..42f9a522a46 100644 --- a/apis/compute/v1beta1/targettcpproxy_reference.go +++ b/apis/compute/v1beta1/targettcpproxy_reference.go @@ -94,8 +94,8 @@ func NewComputeTargetTCPProxyRef(ctx context.Context, reader client.Reader, obj if projectID == "" { return nil, fmt.Errorf("cannot resolve project") } - region := valueOf(obj.Spec.Location) - id.parent = &ComputeTargetTCPProxyParent{ProjectID: projectID, Region: region} + + id.parent = &ComputeTargetTCPProxyParent{ProjectID: projectID} // Get desired ID resourceID := valueOf(obj.Spec.ResourceID) @@ -121,15 +121,13 @@ func NewComputeTargetTCPProxyRef(ctx context.Context, reader client.Reader, obj if actualParent.ProjectID != projectID { return nil, fmt.Errorf("spec.projectRef changed, expect %s, got %s", actualParent.ProjectID, projectID) } - if actualParent.Region != region { - return nil, fmt.Errorf("spec.location changed, expect %s, got %s", actualParent.Region, region) - } + if actualResourceID != resourceID { return nil, fmt.Errorf("cannot reset `metadata.name` or `spec.resourceID` to %s, since it has already assigned to %s", resourceID, actualResourceID) } id.External = externalRef - id.parent = &ComputeTargetTCPProxyParent{ProjectID: projectID, Region: region} + id.parent = &ComputeTargetTCPProxyParent{ProjectID: projectID} return id, nil } @@ -149,10 +147,18 @@ func (r *ComputeTargetTCPProxyRef) Parent() (*ComputeTargetTCPProxyParent, error type ComputeTargetTCPProxyParent struct { ProjectID string +} + +type RegionalComputeTargetTCPProxyParent struct { + ProjectID string Region string } func (p *ComputeTargetTCPProxyParent) String() string { + return "projects/" + p.ProjectID + "/global" +} + +func (p *RegionalComputeTargetTCPProxyParent) String() string { return "projects/" + p.ProjectID + "/regions/" + p.Region } @@ -161,12 +167,25 @@ func asComputeTargetTCPProxyExternal(parent *ComputeTargetTCPProxyParent, resour } func parseComputeTargetTCPProxyExternal(external string) (parent *ComputeTargetTCPProxyParent, resourceID string, err error) { + external = strings.TrimPrefix(external, "/") + tokens := strings.Split(external, "/") + if len(tokens) != 5 || tokens[0] != "projects" || tokens[3] != "targetTcpProxies" { + return nil, "", fmt.Errorf("format of ComputeTargetTCPProxy external=%q was not known (use projects//global/targetTcpProxies/)", external) + } + parent = &ComputeTargetTCPProxyParent{ + ProjectID: tokens[1], + } + resourceID = tokens[4] + return parent, resourceID, nil +} + +func parseRegionalComputeTargetTCPProxyExternal(external string) (parent *RegionalComputeTargetTCPProxyParent, resourceID string, err error) { external = strings.TrimPrefix(external, "/") tokens := strings.Split(external, "/") if len(tokens) != 6 || tokens[0] != "projects" || tokens[2] != "regions" || tokens[4] != "targetTcpProxies" { return nil, "", fmt.Errorf("format of ComputeTargetTCPProxy external=%q was not known (use projects//regions//targetTcpProxies/)", external) } - parent = &ComputeTargetTCPProxyParent{ + parent = &RegionalComputeTargetTCPProxyParent{ ProjectID: tokens[1], Region: tokens[3], } diff --git a/apis/compute/v1beta1/zz_generated.deepcopy.go b/apis/compute/v1beta1/zz_generated.deepcopy.go index 4e08b179a3e..58c8ad7fc52 100644 --- a/apis/compute/v1beta1/zz_generated.deepcopy.go +++ b/apis/compute/v1beta1/zz_generated.deepcopy.go @@ -840,3 +840,18 @@ func (in *ForwardingruleTarget) DeepCopy() *ForwardingruleTarget { in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RegionalComputeTargetTCPProxyParent) DeepCopyInto(out *RegionalComputeTargetTCPProxyParent) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RegionalComputeTargetTCPProxyParent. +func (in *RegionalComputeTargetTCPProxyParent) DeepCopy() *RegionalComputeTargetTCPProxyParent { + if in == nil { + return nil + } + out := new(RegionalComputeTargetTCPProxyParent) + in.DeepCopyInto(out) + return out +} diff --git a/dev/tasks/run-e2e b/dev/tasks/run-e2e index 57f0c793c6e..9fa6704e60c 100755 --- a/dev/tasks/run-e2e +++ b/dev/tasks/run-e2e @@ -26,7 +26,7 @@ if [[ -z "${KUBEBUILDER_ASSETS:-}" ]]; then fi if [[ -z "${KCC_USE_DIRECT_RECONCILERS:-}" ]]; then - KCC_USE_DIRECT_RECONCILERS=ComputeForwardingRule,GKEHubFeatureMembership,SecretManagerSecret + KCC_USE_DIRECT_RECONCILERS=ComputeForwardingRule,ComputeTargetTCPProxy,GKEHubFeatureMembership,SecretManagerSecret fi echo "Using direct controllers: $KCC_USE_DIRECT_RECONCILERS" export KCC_USE_DIRECT_RECONCILERS diff --git a/mockgcp/mockcompute/globaltargettcpproxyv1.go b/mockgcp/mockcompute/globaltargettcpproxyv1.go index 3c2734bd917..a353e2f52cb 100644 --- a/mockgcp/mockcompute/globaltargettcpproxyv1.go +++ b/mockgcp/mockcompute/globaltargettcpproxyv1.go @@ -41,7 +41,7 @@ func (s *GlobalTargetTcpProxyV1) Get(ctx context.Context, req *pb.GetTargetTcpPr obj := &pb.TargetTcpProxy{} if err := s.storage.Get(ctx, fqn, obj); err != nil { - return nil, err + return nil, status.Errorf(codes.NotFound, "The resource '%s' was not found", fqn) } return obj, nil @@ -126,7 +126,7 @@ func (s *GlobalTargetTcpProxyV1) SetProxyHeader(ctx context.Context, req *pb.Set op := &pb.Operation{ TargetId: obj.Id, TargetLink: obj.SelfLink, - OperationType: PtrTo("setProxyHeader"), + OperationType: PtrTo("TargetTcpProxySetProxyHeader"), User: PtrTo("user@example.com"), } return s.startGlobalLRO(ctx, name.Project.ID, op, func() (proto.Message, error) { diff --git a/pkg/controller/direct/compute/targettcpproxy/refs.go b/pkg/controller/direct/compute/targettcpproxy/refs.go new file mode 100644 index 00000000000..3c541116627 --- /dev/null +++ b/pkg/controller/direct/compute/targettcpproxy/refs.go @@ -0,0 +1,100 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package targettcpproxy + +import ( + "context" + "fmt" + + "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/k8s" + apierrors "k8s.io/apimachinery/pkg/api/errors" + + krm "github.com/GoogleCloudPlatform/k8s-config-connector/apis/compute/v1beta1" + + refs "github.com/GoogleCloudPlatform/k8s-config-connector/apis/refs/v1beta1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/types" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +func ResolveComputeBackendService(ctx context.Context, reader client.Reader, src client.Object, ref *refs.ComputeBackendServiceRef) (*refs.ComputeBackendServiceRef, error) { + if ref == nil { + return nil, nil + } + + if ref.External != "" { + if ref.Name != "" { + return nil, fmt.Errorf("cannot specify both name and external on reference") + } + return ref, nil + } + + if ref.Name == "" { + return nil, fmt.Errorf("must specify either name or external on reference") + } + + key := types.NamespacedName{ + Namespace: ref.Namespace, + Name: ref.Name, + } + if key.Namespace == "" { + key.Namespace = src.GetNamespace() + } + + computeBackendService, err := resolveResourceName(ctx, reader, key, schema.GroupVersionKind{ + Group: "compute.cnrm.cloud.google.com", + Version: "v1beta1", + Kind: "ComputeBackendService", + }) + if err != nil { + return nil, err + } + + // targetField: self_link + // See compute servicemappings for details + selfLink, _, err := unstructured.NestedString(computeBackendService.Object, "status", "selfLink") + if err != nil || selfLink == "" { + return nil, fmt.Errorf("cannot get selfLink for referenced %s %v (status.selfLink is empty)", computeBackendService.GetKind(), computeBackendService.GetNamespace()) + } + return &refs.ComputeBackendServiceRef{ + External: selfLink}, nil +} + +func resolveResourceName(ctx context.Context, reader client.Reader, key client.ObjectKey, gvk schema.GroupVersionKind) (*unstructured.Unstructured, error) { + resource := &unstructured.Unstructured{} + resource.SetGroupVersionKind(gvk) + if err := reader.Get(ctx, key, resource); err != nil { + if apierrors.IsNotFound(err) { + return nil, k8s.NewReferenceNotFoundError(resource.GroupVersionKind(), key) + } + return nil, fmt.Errorf("error reading referenced %v %v: %w", gvk.Kind, key, err) + } + + return resource, nil +} + +func resolveDependencies(ctx context.Context, reader client.Reader, obj *krm.ComputeTargetTCPProxy) error { + // Get backend service + if obj.Spec.BackendServiceRef != nil { + backendServiceRef, err := ResolveComputeBackendService(ctx, reader, obj, obj.Spec.BackendServiceRef) + if err != nil { + return err + + } + obj.Spec.BackendServiceRef.External = backendServiceRef.External + } + return nil +} diff --git a/pkg/controller/direct/compute/targettcpproxy/targettcpproxy_controller.go b/pkg/controller/direct/compute/targettcpproxy/targettcpproxy_controller.go new file mode 100644 index 00000000000..2de289414fe --- /dev/null +++ b/pkg/controller/direct/compute/targettcpproxy/targettcpproxy_controller.go @@ -0,0 +1,330 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package targettcpproxy + +import ( + "context" + "fmt" + "reflect" + "strings" + + "google.golang.org/api/option" + + gcp "cloud.google.com/go/compute/apiv1" + computepb "cloud.google.com/go/compute/apiv1/computepb" + krm "github.com/GoogleCloudPlatform/k8s-config-connector/apis/compute/v1beta1" + "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/config" + "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/controller/direct" + "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/controller/direct/directbase" + "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/controller/direct/registry" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/klog/v2" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +const ctrlName = "firewallpolicyrule-controller" + +func init() { + registry.RegisterModel(krm.ComputeTargetTCPProxyGVK, NewtargetTCPProxyModel) +} + +func NewtargetTCPProxyModel(ctx context.Context, config *config.ControllerConfig) (directbase.Model, error) { + return &targetTCPProxyModel{config: config}, nil +} + +type targetTCPProxyModel struct { + config *config.ControllerConfig +} + +// model implements the Model interface. +var _ directbase.Model = &targetTCPProxyModel{} + +type targetTCPProxyAdapter struct { + id *krm.ComputeTargetTCPProxyRef + targetTcpProxiesClient *gcp.TargetTcpProxiesClient + desired *krm.ComputeTargetTCPProxy + actual *computepb.TargetTcpProxy + reader client.Reader +} + +var _ directbase.Adapter = &targetTCPProxyAdapter{} + +func (m *targetTCPProxyModel) client(ctx context.Context) (*gcp.TargetTcpProxiesClient, error) { + var opts []option.ClientOption + opts, err := m.config.RESTClientOptions() + if err != nil { + return nil, err + } + gcpClient, err := gcp.NewTargetTcpProxiesRESTClient(ctx, opts...) + if err != nil { + return nil, fmt.Errorf("building TargetTcpProxy client: %w", err) + } + return gcpClient, err +} + +func (m *targetTCPProxyModel) AdapterForObject(ctx context.Context, reader client.Reader, u *unstructured.Unstructured) (directbase.Adapter, error) { + obj := &krm.ComputeTargetTCPProxy{} + if err := runtime.DefaultUnstructuredConverter.FromUnstructured(u.Object, &obj); err != nil { + return nil, fmt.Errorf("error converting to %T: %w", obj, err) + } + + // Set label managed-by-cnrm: true + obj.ObjectMeta.Labels["managed-by-cnrm"] = "true" + + computeTargetTCPProxyRef, err := krm.NewComputeTargetTCPProxyRef(ctx, reader, obj, u) + if err != nil { + return nil, err + } + + targetTCPProxyAdapter := &targetTCPProxyAdapter{ + id: computeTargetTCPProxyRef, + desired: obj, + reader: reader, + } + + // Get GCP client + gcpClient, err := m.client(ctx) + if err != nil { + return nil, fmt.Errorf("building gcp client: %w", err) + } + targetTCPProxyAdapter.targetTcpProxiesClient = gcpClient + + return targetTCPProxyAdapter, nil +} + +func (m *targetTCPProxyModel) AdapterForURL(ctx context.Context, url string) (directbase.Adapter, error) { + // TODO: Support URLs + return nil, nil +} + +func (a *targetTCPProxyAdapter) Find(ctx context.Context) (bool, error) { + log := klog.FromContext(ctx).WithName(ctrlName) + log.V(2).Info("getting ComputeTargetTCPProxy", "name", a.id.External) + + targetTCPProxy, err := a.get(ctx) + if err != nil { + if direct.IsNotFound(err) { + return false, nil + } + return false, fmt.Errorf("getting ComputeTargetTCPProxy %q: %w", a.id.External, err) + } + a.actual = targetTCPProxy + return true, nil +} + +func (a *targetTCPProxyAdapter) Create(ctx context.Context, createOp *directbase.CreateOperation) error { + var err error + + err = resolveDependencies(ctx, a.reader, a.desired) + if err != nil { + return err + } + + log := klog.FromContext(ctx).WithName(ctrlName) + log.V(2).Info("creating ComputeTargetTCPProxy", "name", a.id.External) + mapCtx := &direct.MapContext{} + + desired := a.desired.DeepCopy() + + targetTCPProxy := ComputeTargetTCPProxySpec_ToProto(mapCtx, &desired.Spec) + if mapCtx.Err() != nil { + return mapCtx.Err() + } + + parent, err := a.id.Parent() + if err != nil { + return fmt.Errorf("get ComputeTargetTCPProxy parent %s: %w", a.id.External, err) + } + + tokens := strings.Split(a.id.External, "/") + targetTCPProxy.Name = direct.LazyPtr(tokens[len(tokens)-1]) + + req := &computepb.InsertTargetTcpProxyRequest{ + Project: parent.ProjectID, + TargetTcpProxyResource: targetTCPProxy, + } + op, err := a.targetTcpProxiesClient.Insert(ctx, req) + + if err != nil { + return fmt.Errorf("creating ComputeTargetTCPProxy %s: %w", a.id.External, err) + } + if !op.Done() { + err = op.Wait(ctx) + if err != nil { + return fmt.Errorf("waiting ComputeTargetTCPProxy %s create failed: %w", a.id.External, err) + } + } + log.V(2).Info("successfully created ComputeTargetTCPProxy", "name", a.id.External) + + // Get the created resource + created := &computepb.TargetTcpProxy{} + created, err = a.get(ctx) + if err != nil { + return fmt.Errorf("getting ComputeTargetTCPProxy %s: %w", a.id.External, err) + } + + status := &krm.ComputeTargetTCPProxyStatus{} + status = ComputeTargetTCPProxyStatus_FromProto(mapCtx, created) + + parent, err = a.id.Parent() + if err != nil { + return err + } + + externalRef := parent.String() + "/targetTcpProxies/" + direct.ValueOf(created.Name) + status.ExternalRef = &externalRef + return createOp.UpdateStatus(ctx, status, nil) +} + +func (a *targetTCPProxyAdapter) Update(ctx context.Context, updateOp *directbase.UpdateOperation) error { + var err error + + err = resolveDependencies(ctx, a.reader, a.desired) + if err != nil { + return err + } + + log := klog.FromContext(ctx).WithName(ctrlName) + log.V(2).Info("updating ComputeTargetTCPProxy", "name", a.id.External) + mapCtx := &direct.MapContext{} + + desired := a.desired.DeepCopy() + targetTCPProxy := ComputeTargetTCPProxySpec_ToProto(mapCtx, &desired.Spec) + if mapCtx.Err() != nil { + return mapCtx.Err() + } + + op := &gcp.Operation{} + updated := &computepb.TargetTcpProxy{} + + parent, err := a.id.Parent() + if err != nil { + return fmt.Errorf("get ComputeTargetTCPProxy parent %s: %w", a.id.External, err) + } + tokens := strings.Split(a.id.External, "/") + targetTCPProxy.Name = direct.LazyPtr(tokens[len(tokens)-1]) + + if !reflect.DeepEqual(targetTCPProxy.Service, a.actual.Service) { + setBackendServiceReq := &computepb.SetBackendServiceTargetTcpProxyRequest{ + Project: parent.ProjectID, + TargetTcpProxiesSetBackendServiceRequestResource: &computepb.TargetTcpProxiesSetBackendServiceRequest{Service: targetTCPProxy.Service}, + TargetTcpProxy: tokens[len(tokens)-1], + } + op, err = a.targetTcpProxiesClient.SetBackendService(ctx, setBackendServiceReq) + if err != nil { + return fmt.Errorf("updating ComputeTargetTCPProxy backend service %s: %w", a.id.External, err) + } + } + if !reflect.DeepEqual(targetTCPProxy.ProxyHeader, a.actual.ProxyHeader) { + setProxyHeaderReq := &computepb.SetProxyHeaderTargetTcpProxyRequest{ + Project: parent.ProjectID, + TargetTcpProxiesSetProxyHeaderRequestResource: &computepb.TargetTcpProxiesSetProxyHeaderRequest{ProxyHeader: targetTCPProxy.ProxyHeader}, + TargetTcpProxy: tokens[len(tokens)-1], + } + op, err = a.targetTcpProxiesClient.SetProxyHeader(ctx, setProxyHeaderReq) + if err != nil { + return fmt.Errorf("updating ComputeTargetTCPProxy proxy header %s: %w", a.id.External, err) + } + } + + if !op.Done() { + err = op.Wait(ctx) + if err != nil { + return fmt.Errorf("waiting ComputeTargetTCPProxy %s update failed: %w", a.id.External, err) + } + } + log.V(2).Info("successfully updated ComputeTargetTCPProxy", "name", a.id.External) + + // Get the updated resource + updated, err = a.get(ctx) + if err != nil { + return fmt.Errorf("getting ComputeTargetTCPProxy %s: %w", a.id.External, err) + } + + status := &krm.ComputeTargetTCPProxyStatus{} + status = ComputeTargetTCPProxyStatus_FromProto(mapCtx, updated) + return updateOp.UpdateStatus(ctx, status, nil) +} + +func (a *targetTCPProxyAdapter) Export(ctx context.Context) (*unstructured.Unstructured, error) { + if a.actual == nil { + return nil, fmt.Errorf("targetTcpProxy %s not found", a.id.External) + } + + mc := &direct.MapContext{} + spec := ComputeTargetTCPProxySpec_FromProto(mc, a.actual) + specObj, err := runtime.DefaultUnstructuredConverter.ToUnstructured(spec) + if err != nil { + return nil, fmt.Errorf("error converting targetTcpProxy spec to unstructured: %w", err) + } + + u := &unstructured.Unstructured{ + Object: make(map[string]interface{}), + } + u.SetGroupVersionKind(krm.ComputeTargetTCPProxyGVK) + + if err := unstructured.SetNestedField(u.Object, specObj, "spec"); err != nil { + return nil, fmt.Errorf("setting spec: %w", err) + } + + return u, nil +} + +// Delete implements the Adapter interface. +func (a *targetTCPProxyAdapter) Delete(ctx context.Context, deleteOp *directbase.DeleteOperation) (bool, error) { + log := klog.FromContext(ctx).WithName(ctrlName) + log.V(2).Info("deleting ComputeTargetTcpProxy", "name", a.id.External) + + parent, err := a.id.Parent() + if err != nil { + return false, fmt.Errorf("get ComputeTargetTcpProxy parent %s: %w", a.id.External, err) + } + + tokens := strings.Split(a.id.External, "/") + + delReq := &computepb.DeleteTargetTcpProxyRequest{ + Project: parent.ProjectID, + TargetTcpProxy: tokens[len(tokens)-1], + } + op, err := a.targetTcpProxiesClient.Delete(ctx, delReq) + + if err != nil { + return false, fmt.Errorf("deleting ComputeTargetTcpProxy %s: %w", a.id.External, err) + } + if !op.Done() { + err = op.Wait(ctx) + if err != nil { + return false, fmt.Errorf("waiting ComputeTargetTcpProxy %s delete failed: %w", a.id.External, err) + } + } + log.V(2).Info("successfully deleted ComputeTargetTcpProxy", "name", a.id.External) + return true, nil +} + +func (a *targetTCPProxyAdapter) get(ctx context.Context) (*computepb.TargetTcpProxy, error) { + parent, err := a.id.Parent() + if err != nil { + return nil, fmt.Errorf("get ComputeTargetTcpProxy parent %s: %w", a.id.External, err) + } + + tokens := strings.Split(a.id.External, "/") + + getReq := &computepb.GetTargetTcpProxyRequest{ + Project: parent.ProjectID, + TargetTcpProxy: tokens[len(tokens)-1], + } + return a.targetTcpProxiesClient.Get(ctx, getReq) +} diff --git a/pkg/controller/direct/register/register.go b/pkg/controller/direct/register/register.go index 81fc73bf539..de3f2000efb 100644 --- a/pkg/controller/direct/register/register.go +++ b/pkg/controller/direct/register/register.go @@ -24,6 +24,7 @@ import ( _ "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/controller/direct/cloudbuild" _ "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/controller/direct/compute/firewallpolicyrule" _ "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/controller/direct/compute/forwardingrule" + _ "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/controller/direct/compute/targettcpproxy" _ "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/controller/direct/dataflow" _ "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/controller/direct/dataform" _ "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/controller/direct/discoveryengine" diff --git a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computeforwardingrule/globalcomputeforwardingruletcp/_http.log b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computeforwardingrule/globalcomputeforwardingruletcp/_http.log index ebe8796bdef..4f78186c385 100644 --- a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computeforwardingrule/globalcomputeforwardingruletcp/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computeforwardingrule/globalcomputeforwardingruletcp/_http.log @@ -424,9 +424,10 @@ X-Xss-Protection: 0 --- -GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}?alt=json +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId} Content-Type: application/json -User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&target_tcp_proxy=computetargettcpproxy-${uniqueId} 404 Not Found Cache-Control: private @@ -445,25 +446,26 @@ X-Xss-Protection: 0 "errors": [ { "domain": "global", - "message": "targetTcpProxy \"projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}\" not found", + "message": "The resource 'projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}' was not found", "reason": "notFound" } ], - "message": "targetTcpProxy \"projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}\" not found" + "message": "The resource 'projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}' was not found" } } --- -POST https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies?alt=json +POST https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies Content-Type: application/json -User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId} { "description": "test description", "name": "computetargettcpproxy-${uniqueId}", "proxyHeader": "NONE", - "service": "projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}" + "service": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}" } 200 OK @@ -494,8 +496,10 @@ X-Xss-Protection: 0 --- -GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}?alt=json&prettyPrint=false -User-Agent: google-api-go-client/0.5 Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID} +Content-Type: application/json +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&operation=${operationID} 200 OK Cache-Control: private @@ -526,9 +530,10 @@ X-Xss-Protection: 0 --- -GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}?alt=json +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId} Content-Type: application/json -User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&target_tcp_proxy=computetargettcpproxy-${uniqueId} 200 OK Cache-Control: private @@ -549,14 +554,15 @@ X-Xss-Protection: 0 "name": "computetargettcpproxy-${uniqueId}", "proxyHeader": "NONE", "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}", - "service": "projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}" + "service": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}" } --- -GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy2-${uniqueId}?alt=json +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy2-${uniqueId} Content-Type: application/json -User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&target_tcp_proxy=computetargettcpproxy2-${uniqueId} 404 Not Found Cache-Control: private @@ -575,25 +581,26 @@ X-Xss-Protection: 0 "errors": [ { "domain": "global", - "message": "targetTcpProxy \"projects/${projectId}/global/targetTcpProxies/computetargettcpproxy2-${uniqueId}\" not found", + "message": "The resource 'projects/${projectId}/global/targetTcpProxies/computetargettcpproxy2-${uniqueId}' was not found", "reason": "notFound" } ], - "message": "targetTcpProxy \"projects/${projectId}/global/targetTcpProxies/computetargettcpproxy2-${uniqueId}\" not found" + "message": "The resource 'projects/${projectId}/global/targetTcpProxies/computetargettcpproxy2-${uniqueId}' was not found" } } --- -POST https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies?alt=json +POST https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies Content-Type: application/json -User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId} { "description": "other test description", "name": "computetargettcpproxy2-${uniqueId}", "proxyHeader": "NONE", - "service": "projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}" + "service": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}" } 200 OK @@ -624,8 +631,10 @@ X-Xss-Protection: 0 --- -GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}?alt=json&prettyPrint=false -User-Agent: google-api-go-client/0.5 Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID} +Content-Type: application/json +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&operation=${operationID} 200 OK Cache-Control: private @@ -656,9 +665,10 @@ X-Xss-Protection: 0 --- -GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy2-${uniqueId}?alt=json +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy2-${uniqueId} Content-Type: application/json -User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&target_tcp_proxy=computetargettcpproxy2-${uniqueId} 200 OK Cache-Control: private @@ -679,7 +689,7 @@ X-Xss-Protection: 0 "name": "computetargettcpproxy2-${uniqueId}", "proxyHeader": "NONE", "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy2-${uniqueId}", - "service": "projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}" + "service": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}" } --- @@ -1137,9 +1147,10 @@ X-Xss-Protection: 0 --- -GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy2-${uniqueId}?alt=json +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy2-${uniqueId} Content-Type: application/json -User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&target_tcp_proxy=computetargettcpproxy2-${uniqueId} 200 OK Cache-Control: private @@ -1160,14 +1171,15 @@ X-Xss-Protection: 0 "name": "computetargettcpproxy2-${uniqueId}", "proxyHeader": "NONE", "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy2-${uniqueId}", - "service": "projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}" + "service": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}" } --- -DELETE https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy2-${uniqueId}?alt=json +DELETE https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy2-${uniqueId} Content-Type: application/json -User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&target_tcp_proxy=computetargettcpproxy2-${uniqueId} 200 OK Cache-Control: private @@ -1197,8 +1209,10 @@ X-Xss-Protection: 0 --- -GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}?alt=json&prettyPrint=false -User-Agent: google-api-go-client/0.5 Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID} +Content-Type: application/json +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&operation=${operationID} 200 OK Cache-Control: private @@ -1229,9 +1243,10 @@ X-Xss-Protection: 0 --- -GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}?alt=json +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId} Content-Type: application/json -User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&target_tcp_proxy=computetargettcpproxy-${uniqueId} 200 OK Cache-Control: private @@ -1252,14 +1267,15 @@ X-Xss-Protection: 0 "name": "computetargettcpproxy-${uniqueId}", "proxyHeader": "NONE", "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}", - "service": "projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}" + "service": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}" } --- -DELETE https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}?alt=json +DELETE https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId} Content-Type: application/json -User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&target_tcp_proxy=computetargettcpproxy-${uniqueId} 200 OK Cache-Control: private @@ -1289,8 +1305,10 @@ X-Xss-Protection: 0 --- -GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}?alt=json&prettyPrint=false -User-Agent: google-api-go-client/0.5 Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID} +Content-Type: application/json +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&operation=${operationID} 200 OK Cache-Control: private diff --git a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/_generated_object_computetargettcpproxy.golden.yaml b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/_generated_object_computetargettcpproxy.golden.yaml index 25f407780da..79b503368e4 100644 --- a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/_generated_object_computetargettcpproxy.golden.yaml +++ b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/_generated_object_computetargettcpproxy.golden.yaml @@ -4,11 +4,10 @@ metadata: annotations: cnrm.cloud.google.com/management-conflict-prevention-policy: none cnrm.cloud.google.com/project-id: ${projectId} - cnrm.cloud.google.com/state-into-spec: absent finalizers: - cnrm.cloud.google.com/finalizer - cnrm.cloud.google.com/deletion-defender - generation: 3 + generation: 2 labels: cnrm-test: "true" name: computetargettcpproxy-${uniqueId} @@ -17,7 +16,6 @@ spec: backendServiceRef: name: computebackendservice-${uniqueId} proxyHeader: PROXY_V1 - resourceID: computetargettcpproxy-${uniqueId} status: conditions: - lastTransitionTime: "1970-01-01T00:00:00Z" @@ -26,6 +24,7 @@ status: status: "True" type: Ready creationTimestamp: "1970-01-01T00:00:00Z" - observedGeneration: 3 + externalRef: projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId} + observedGeneration: 2 proxyId: 1111111111111111 selfLink: https://www.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId} diff --git a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/_http.log b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/_http.log index df689facc74..69e1770da8c 100644 --- a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/_http.log @@ -218,9 +218,10 @@ X-Xss-Protection: 0 --- -GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}?alt=json +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId} Content-Type: application/json -User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&target_tcp_proxy=computetargettcpproxy-${uniqueId} 404 Not Found Cache-Control: private @@ -239,24 +240,25 @@ X-Xss-Protection: 0 "errors": [ { "domain": "global", - "message": "targetTcpProxy \"projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}\" not found", + "message": "The resource 'projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}' was not found", "reason": "notFound" } ], - "message": "targetTcpProxy \"projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}\" not found" + "message": "The resource 'projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}' was not found" } } --- -POST https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies?alt=json +POST https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies Content-Type: application/json -User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId} { "name": "computetargettcpproxy-${uniqueId}", "proxyHeader": "NONE", - "service": "projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}" + "service": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}" } 200 OK @@ -287,8 +289,10 @@ X-Xss-Protection: 0 --- -GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}?alt=json&prettyPrint=false -User-Agent: google-api-go-client/0.5 Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID} +Content-Type: application/json +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&operation=${operationID} 200 OK Cache-Control: private @@ -319,9 +323,10 @@ X-Xss-Protection: 0 --- -GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}?alt=json +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId} Content-Type: application/json -User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&target_tcp_proxy=computetargettcpproxy-${uniqueId} 200 OK Cache-Control: private @@ -341,14 +346,15 @@ X-Xss-Protection: 0 "name": "computetargettcpproxy-${uniqueId}", "proxyHeader": "NONE", "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}", - "service": "projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}" + "service": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}" } --- -POST https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}/setProxyHeader?alt=json +POST https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}/setProxyHeader Content-Type: application/json -User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&target_tcp_proxy=computetargettcpproxy-${uniqueId} { "proxyHeader": "PROXY_V1" @@ -370,7 +376,7 @@ X-Xss-Protection: 0 "insertTime": "2024-04-01T12:34:56.123456Z", "kind": "compute#operation", "name": "${operationID}", - "operationType": "setProxyHeader", + "operationType": "TargetTcpProxySetProxyHeader", "progress": 0, "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", @@ -382,8 +388,10 @@ X-Xss-Protection: 0 --- -GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}?alt=json&prettyPrint=false -User-Agent: google-api-go-client/0.5 Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID} +Content-Type: application/json +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&operation=${operationID} 200 OK Cache-Control: private @@ -402,7 +410,7 @@ X-Xss-Protection: 0 "insertTime": "2024-04-01T12:34:56.123456Z", "kind": "compute#operation", "name": "${operationID}", - "operationType": "setProxyHeader", + "operationType": "TargetTcpProxySetProxyHeader", "progress": 100, "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", @@ -414,9 +422,10 @@ X-Xss-Protection: 0 --- -GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}?alt=json +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId} Content-Type: application/json -User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&target_tcp_proxy=computetargettcpproxy-${uniqueId} 200 OK Cache-Control: private @@ -436,14 +445,15 @@ X-Xss-Protection: 0 "name": "computetargettcpproxy-${uniqueId}", "proxyHeader": "PROXY_V1", "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}", - "service": "projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}" + "service": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}" } --- -DELETE https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}?alt=json +DELETE https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId} Content-Type: application/json -User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&target_tcp_proxy=computetargettcpproxy-${uniqueId} 200 OK Cache-Control: private @@ -473,8 +483,10 @@ X-Xss-Protection: 0 --- -GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}?alt=json&prettyPrint=false -User-Agent: google-api-go-client/0.5 Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID} +Content-Type: application/json +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&operation=${operationID} 200 OK Cache-Control: private