diff --git a/apis/compute/v1beta1/targettcpproxy_reference.go b/apis/compute/v1beta1/targettcpproxy_reference.go index 2165c31394..42f9a522a4 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/computetargettcpproxy_types.go b/apis/compute/v1beta1/targettcpproxy_types.go similarity index 99% rename from apis/compute/v1beta1/computetargettcpproxy_types.go rename to apis/compute/v1beta1/targettcpproxy_types.go index 1e9aaf8953..fb17ec5ece 100644 --- a/apis/compute/v1beta1/computetargettcpproxy_types.go +++ b/apis/compute/v1beta1/targettcpproxy_types.go @@ -42,8 +42,7 @@ type ComputeTargetTCPProxySpec struct { // The geographical location of the ComputeTargetTCPProxy. // Reference: GCP definition of regions/zones (https://cloud.google.com/compute/docs/regions-zones/) - // +optional - Location *string `json:"location"` + Location *string `json:"location,omitempty"` // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="ProxyBind is immutable" // Immutable. This field only applies when the forwarding rule that references diff --git a/apis/compute/v1beta1/zz_generated.deepcopy.go b/apis/compute/v1beta1/zz_generated.deepcopy.go index ca24003cfc..6b066735c6 100644 --- a/apis/compute/v1beta1/zz_generated.deepcopy.go +++ b/apis/compute/v1beta1/zz_generated.deepcopy.go @@ -875,3 +875,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/mockgcp/mockcompute/globaltargettcpproxyv1.go b/mockgcp/mockcompute/globaltargettcpproxyv1.go index 3c2734bd91..b54f6b21de 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 @@ -63,6 +63,9 @@ func (s *GlobalTargetTcpProxyV1) Insert(ctx context.Context, req *pb.InsertTarge obj.CreationTimestamp = PtrTo(s.nowString()) obj.Id = &id obj.Kind = PtrTo("compute#targetTcpProxy") + if obj.ProxyHeader == nil { + obj.ProxyHeader = PtrTo("NONE") + } if err := s.storage.Create(ctx, fqn, obj); err != nil { return nil, err @@ -126,7 +129,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 0000000000..3c54111662 --- /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 0000000000..2de289414f --- /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 5a478ad8e4..64af6b05f2 100644 --- a/pkg/controller/direct/register/register.go +++ b/pkg/controller/direct/register/register.go @@ -25,6 +25,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-direct/_generated_object_globalcomputeforwardingruletcp-direct.golden.yaml b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computeforwardingrule/globalcomputeforwardingruletcp-direct/_generated_object_globalcomputeforwardingruletcp-direct.golden.yaml new file mode 100644 index 0000000000..d155e547c9 --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computeforwardingrule/globalcomputeforwardingruletcp-direct/_generated_object_globalcomputeforwardingruletcp-direct.golden.yaml @@ -0,0 +1,40 @@ +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeForwardingRule +metadata: + annotations: + alpha.cnrm.cloud.google.com/reconciler: direct + cnrm.cloud.google.com/management-conflict-prevention-policy: none + cnrm.cloud.google.com/project-id: ${projectId} + finalizers: + - cnrm.cloud.google.com/finalizer + - cnrm.cloud.google.com/deletion-defender + generation: 2 + labels: + cnrm-test: "true" + label-one: value-two + name: computeglobalforwardingrule-${uniqueId} + namespace: ${uniqueId} +spec: + description: A global forwarding rule + ipAddress: + addressRef: + name: computeaddress-${uniqueId} + ipProtocol: TCP + loadBalancingScheme: EXTERNAL + location: global + portRange: "110" + target: + targetTCPProxyRef: + name: computetargettcpproxy2-${uniqueId} +status: + conditions: + - lastTransitionTime: "1970-01-01T00:00:00Z" + message: The resource is up to date + reason: UpToDate + status: "True" + type: Ready + creationTimestamp: "1970-01-01T00:00:00Z" + externalRef: //compute.googleapis.com/projects/${projectId}/global/forwardingrules/computeglobalforwardingrule-${uniqueId} + labelFingerprint: abcdef0123A= + observedGeneration: 2 + selfLink: https://www.googleapis.com/compute/v1/projects/${projectId}/global/forwardingRules/computeglobalforwardingrule-${uniqueId} diff --git a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computeforwardingrule/globalcomputeforwardingruletcp-direct/_http.log b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computeforwardingrule/globalcomputeforwardingruletcp-direct/_http.log new file mode 100644 index 0000000000..d6d4c97ffd --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computeforwardingrule/globalcomputeforwardingruletcp-direct/_http.log @@ -0,0 +1,1563 @@ +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/addresses/${addressID}?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +404 Not Found +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "error": { + "code": 404, + "errors": [ + { + "domain": "global", + "message": "address \"projects/${projectId}/global/addresses/computeaddress-${uniqueId}\" not found", + "reason": "notFound" + } + ], + "message": "address \"projects/${projectId}/global/addresses/computeaddress-${uniqueId}\" not found" + } +} + +--- + +POST https://compute.googleapis.com/compute/v1/projects/${projectId}/global/addresses?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +{ + "description": "a test global address", + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "name": "computeaddress-${uniqueId}" +} + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "id": "000000000000000000000", + "insertTime": "2024-04-01T12:34:56.123456Z", + "kind": "compute#operation", + "name": "${operationID}", + "operationType": "insert", + "progress": 0, + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "RUNNING", + "targetId": "${addressID}", + "targetLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/addresses/computeaddress-${uniqueId}", + "user": "user@example.com" +} + +--- + +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 + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "endTime": "2024-04-01T12:34:56.123456Z", + "id": "000000000000000000000", + "insertTime": "2024-04-01T12:34:56.123456Z", + "kind": "compute#operation", + "name": "${operationID}", + "operationType": "insert", + "progress": 100, + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "DONE", + "targetId": "${addressID}", + "targetLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/addresses/computeaddress-${uniqueId}", + "user": "user@example.com" +} + +--- + +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/addresses/${addressID}?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "address": "8.8.8.8", + "creationTimestamp": "2024-04-01T12:34:56.123456Z", + "description": "a test global address", + "id": "000000000000000000000", + "kind": "compute#address", + "labelFingerprint": "abcdef0123A=", + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "name": "computeaddress-${uniqueId}", + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/addresses/computeaddress-${uniqueId}" +} + +--- + +POST https://compute.googleapis.com/compute/v1/projects/${projectId}/global/addresses/${addressID}/setLabels?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +{ + "labelFingerprint": "abcdef0123A=", + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + } +} + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "id": "000000000000000000000", + "insertTime": "2024-04-01T12:34:56.123456Z", + "kind": "compute#operation", + "name": "${operationID}", + "progress": 0, + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "DONE" +} + +--- + +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/addresses/${addressID}?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "address": "8.8.8.8", + "creationTimestamp": "2024-04-01T12:34:56.123456Z", + "description": "a test global address", + "id": "000000000000000000000", + "kind": "compute#address", + "labelFingerprint": "abcdef0123A=", + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "name": "computeaddress-${uniqueId}", + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/addresses/computeaddress-${uniqueId}" +} + +--- + +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/healthChecks/computehealthcheck-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +404 Not Found +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "error": { + "code": 404, + "errors": [ + { + "domain": "global", + "message": "healthCheck \"projects/${projectId}/global/healthChecks/computehealthcheck-${uniqueId}\" not found", + "reason": "notFound" + } + ], + "message": "healthCheck \"projects/${projectId}/global/healthChecks/computehealthcheck-${uniqueId}\" not found" + } +} + +--- + +POST https://compute.googleapis.com/compute/v1/projects/${projectId}/global/healthChecks?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +{ + "checkIntervalSec": 10, + "healthyThreshold": 2, + "httpHealthCheck": { + "port": 80, + "proxyHeader": "NONE", + "requestPath": "/" + }, + "name": "computehealthcheck-${uniqueId}", + "timeoutSec": 5, + "type": "HTTP", + "unhealthyThreshold": 2 +} + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "id": "000000000000000000000", + "insertTime": "2024-04-01T12:34:56.123456Z", + "kind": "compute#operation", + "name": "${operationID}", + "progress": 0, + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "DONE" +} + +--- + +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/healthChecks/computehealthcheck-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "checkIntervalSec": 10, + "creationTimestamp": "2024-04-01T12:34:56.123456Z", + "healthyThreshold": 2, + "httpHealthCheck": { + "port": 80, + "proxyHeader": "NONE", + "requestPath": "/" + }, + "id": "000000000000000000000", + "kind": "compute#healthCheck", + "name": "computehealthcheck-${uniqueId}", + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/healthChecks/computehealthcheck-${uniqueId}", + "timeoutSec": 5, + "type": "HTTP", + "unhealthyThreshold": 2 +} + +--- + +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +404 Not Found +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "error": { + "code": 404, + "errors": [ + { + "domain": "global", + "message": "The resource 'projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}' was not found", + "reason": "notFound" + } + ], + "message": "The resource 'projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}' was not found" + } +} + +--- + +POST https://compute.googleapis.com/compute/v1/projects/${projectId}/global/backendServices?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +{ + "connectionDraining": { + "drainingTimeoutSec": 300 + }, + "healthChecks": [ + "https://www.googleapis.com/compute/v1/projects/${projectId}/global/healthChecks/computehealthcheck-${uniqueId}" + ], + "iap": { + "enabled": false, + "oauth2ClientId": "", + "oauth2ClientSecret": "" + }, + "loadBalancingScheme": "EXTERNAL", + "name": "computebackendservice-${uniqueId}", + "protocol": "TCP" +} + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "id": "000000000000000000000", + "insertTime": "2024-04-01T12:34:56.123456Z", + "kind": "compute#operation", + "name": "${operationID}", + "progress": 0, + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "DONE" +} + +--- + +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "connectionDraining": { + "drainingTimeoutSec": 300 + }, + "creationTimestamp": "2024-04-01T12:34:56.123456Z", + "healthChecks": [ + "https://www.googleapis.com/compute/v1/projects/${projectId}/global/healthChecks/computehealthcheck-${uniqueId}" + ], + "iap": { + "enabled": false, + "oauth2ClientId": "", + "oauth2ClientSecret": "" + }, + "id": "000000000000000000000", + "kind": "compute#backendService", + "loadBalancingScheme": "EXTERNAL", + "name": "computebackendservice-${uniqueId}", + "protocol": "TCP", + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}" +} + +--- + +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/${targetTcpProxyID} +Content-Type: application/json +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&target_tcp_proxy=computetargettcpproxy-${uniqueId} + +404 Not Found +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "error": { + "code": 404, + "errors": [ + { + "domain": "global", + "message": "The resource 'projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}' was not found", + "reason": "notFound" + } + ], + "message": "The resource 'projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}' was not found" + } +} + +--- + +POST https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies +Content-Type: application/json +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId} + +{ + "description": "test description", + "name": "computetargettcpproxy-${uniqueId}", + "proxyHeader": "NONE", + "service": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}" +} + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "id": "000000000000000000000", + "insertTime": "2024-04-01T12:34:56.123456Z", + "kind": "compute#operation", + "name": "${operationID}", + "operationType": "insert", + "progress": 0, + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "RUNNING", + "targetId": "${targetTcpProxyID}", + "targetLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}", + "user": "user@example.com" +} + +--- + +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 +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "endTime": "2024-04-01T12:34:56.123456Z", + "id": "000000000000000000000", + "insertTime": "2024-04-01T12:34:56.123456Z", + "kind": "compute#operation", + "name": "${operationID}", + "operationType": "insert", + "progress": 100, + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "DONE", + "targetId": "${targetTcpProxyID}", + "targetLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}", + "user": "user@example.com" +} + +--- + +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/${targetTcpProxyID} +Content-Type: application/json +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&target_tcp_proxy=computetargettcpproxy-${uniqueId} + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "creationTimestamp": "2024-04-01T12:34:56.123456Z", + "description": "test description", + "id": "000000000000000000000", + "kind": "compute#targetTcpProxy", + "name": "computetargettcpproxy-${uniqueId}", + "proxyHeader": "NONE", + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${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/${targetTcpProxyID} +Content-Type: application/json +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&target_tcp_proxy=computetargettcpproxy2-${uniqueId} + +404 Not Found +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "error": { + "code": 404, + "errors": [ + { + "domain": "global", + "message": "The resource 'projects/${projectId}/global/targetTcpProxies/computetargettcpproxy2-${uniqueId}' was not found", + "reason": "notFound" + } + ], + "message": "The resource 'projects/${projectId}/global/targetTcpProxies/computetargettcpproxy2-${uniqueId}' was not found" + } +} + +--- + +POST https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies +Content-Type: application/json +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId} + +{ + "description": "other test description", + "name": "computetargettcpproxy2-${uniqueId}", + "proxyHeader": "NONE", + "service": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}" +} + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "id": "000000000000000000000", + "insertTime": "2024-04-01T12:34:56.123456Z", + "kind": "compute#operation", + "name": "${operationID}", + "operationType": "insert", + "progress": 0, + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "RUNNING", + "targetId": "${targetTcpProxyID}", + "targetLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy2-${uniqueId}", + "user": "user@example.com" +} + +--- + +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 +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "endTime": "2024-04-01T12:34:56.123456Z", + "id": "000000000000000000000", + "insertTime": "2024-04-01T12:34:56.123456Z", + "kind": "compute#operation", + "name": "${operationID}", + "operationType": "insert", + "progress": 100, + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "DONE", + "targetId": "${targetTcpProxyID}", + "targetLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy2-${uniqueId}", + "user": "user@example.com" +} + +--- + +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/${targetTcpProxyID} +Content-Type: application/json +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&target_tcp_proxy=computetargettcpproxy2-${uniqueId} + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "creationTimestamp": "2024-04-01T12:34:56.123456Z", + "description": "other test description", + "id": "000000000000000000000", + "kind": "compute#targetTcpProxy", + "name": "computetargettcpproxy2-${uniqueId}", + "proxyHeader": "NONE", + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy2-${uniqueId}", + "service": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}" +} + +--- + +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/forwardingRules/${forwardingRuleID} +Content-Type: application/json +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&forwarding_rule=computeglobalforwardingrule-${uniqueId} + +404 Not Found +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "error": { + "code": 404, + "errors": [ + { + "domain": "global", + "message": "The resource 'projects/${projectId}/global/forwardingRules/computeglobalforwardingrule-${uniqueId}' was not found", + "reason": "notFound" + } + ], + "message": "The resource 'projects/${projectId}/global/forwardingRules/computeglobalforwardingrule-${uniqueId}' was not found" + } +} + +--- + +POST https://compute.googleapis.com/compute/v1/projects/${projectId}/global/forwardingRules +Content-Type: application/json +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId} + +{ + "IPAddress": "8.8.8.8", + "IPProtocol": "TCP", + "description": "A global forwarding rule", + "labels": { + "cnrm-test": "true", + "label-one": "value-one", + "managed-by-cnrm": "true" + }, + "loadBalancingScheme": "EXTERNAL", + "name": "computeglobalforwardingrule-${uniqueId}", + "portRange": "110", + "target": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}" +} + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "id": "000000000000000000000", + "insertTime": "2024-04-01T12:34:56.123456Z", + "kind": "compute#operation", + "name": "${operationID}", + "operationType": "insert", + "progress": 0, + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "RUNNING", + "targetId": "${forwardingRuleID}", + "targetLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/forwardingRules/computeglobalforwardingrule-${uniqueId}", + "user": "user@example.com" +} + +--- + +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 +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "endTime": "2024-04-01T12:34:56.123456Z", + "id": "000000000000000000000", + "insertTime": "2024-04-01T12:34:56.123456Z", + "kind": "compute#operation", + "name": "${operationID}", + "operationType": "insert", + "progress": 100, + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "DONE", + "targetId": "${forwardingRuleID}", + "targetLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/forwardingRules/computeglobalforwardingrule-${uniqueId}", + "user": "user@example.com" +} + +--- + +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/forwardingRules/${forwardingRuleID} +Content-Type: application/json +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&forwarding_rule=computeglobalforwardingrule-${uniqueId} + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "IPAddress": "8.8.8.8", + "IPProtocol": "TCP", + "creationTimestamp": "2024-04-01T12:34:56.123456Z", + "description": "A global forwarding rule", + "fingerprint": "abcdef0123A=", + "id": "000000000000000000000", + "kind": "compute#forwardingRule", + "labelFingerprint": "abcdef0123A=", + "loadBalancingScheme": "EXTERNAL", + "name": "computeglobalforwardingrule-${uniqueId}", + "networkTier": "PREMIUM", + "portRange": "110-110", + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/forwardingRules/computeglobalforwardingrule-${uniqueId}", + "target": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}" +} + +--- + +POST https://compute.googleapis.com/compute/v1/projects/${projectId}/global/forwardingRules/${forwardingRuleID}/setLabels +Content-Type: application/json +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&resource=computeglobalforwardingrule-${uniqueId} + +{ + "labelFingerprint": "abcdef0123A=", + "labels": { + "cnrm-test": "true", + "label-one": "value-one", + "managed-by-cnrm": "true" + } +} + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "endTime": "2024-04-01T12:34:56.123456Z", + "id": "000000000000000000000", + "insertTime": "2024-04-01T12:34:56.123456Z", + "kind": "compute#operation", + "name": "${operationID}", + "operationType": "setLabels", + "progress": 100, + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "DONE", + "targetId": "${forwardingRuleID}", + "targetLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/forwardingRules/computeglobalforwardingrule-${uniqueId}", + "user": "user@example.com" +} + +--- + +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/forwardingRules/${forwardingRuleID} +Content-Type: application/json +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&forwarding_rule=computeglobalforwardingrule-${uniqueId} + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "IPAddress": "8.8.8.8", + "IPProtocol": "TCP", + "creationTimestamp": "2024-04-01T12:34:56.123456Z", + "description": "A global forwarding rule", + "fingerprint": "abcdef0123A=", + "id": "000000000000000000000", + "kind": "compute#forwardingRule", + "labelFingerprint": "abcdef0123A=", + "labels": { + "cnrm-test": "true", + "label-one": "value-one", + "managed-by-cnrm": "true" + }, + "loadBalancingScheme": "EXTERNAL", + "name": "computeglobalforwardingrule-${uniqueId}", + "networkTier": "PREMIUM", + "portRange": "110-110", + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/forwardingRules/computeglobalforwardingrule-${uniqueId}", + "target": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}" +} + +--- + +POST https://compute.googleapis.com/compute/v1/projects/${projectId}/global/forwardingRules/${forwardingRuleID}/setLabels +Content-Type: application/json +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&resource=computeglobalforwardingrule-${uniqueId} + +{ + "labelFingerprint": "abcdef0123A=", + "labels": { + "cnrm-test": "true", + "label-one": "value-two", + "managed-by-cnrm": "true" + } +} + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "endTime": "2024-04-01T12:34:56.123456Z", + "id": "000000000000000000000", + "insertTime": "2024-04-01T12:34:56.123456Z", + "kind": "compute#operation", + "name": "${operationID}", + "operationType": "setLabels", + "progress": 100, + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "DONE", + "targetId": "${forwardingRuleID}", + "targetLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/forwardingRules/computeglobalforwardingrule-${uniqueId}", + "user": "user@example.com" +} + +--- + +POST https://compute.googleapis.com/compute/v1/projects/${projectId}/global/forwardingRules/${forwardingRuleID}/setTarget +Content-Type: application/json +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&forwarding_rule=computeglobalforwardingrule-${uniqueId} + +{ + "target": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy2-${uniqueId}" +} + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "id": "000000000000000000000", + "insertTime": "2024-04-01T12:34:56.123456Z", + "kind": "compute#operation", + "name": "${operationID}", + "operationType": "SetTarget", + "progress": 0, + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "RUNNING", + "targetId": "${forwardingRuleID}", + "targetLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/forwardingRules/computeglobalforwardingrule-${uniqueId}", + "user": "user@example.com" +} + +--- + +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 +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "endTime": "2024-04-01T12:34:56.123456Z", + "id": "000000000000000000000", + "insertTime": "2024-04-01T12:34:56.123456Z", + "kind": "compute#operation", + "name": "${operationID}", + "operationType": "SetTarget", + "progress": 100, + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "DONE", + "targetId": "${forwardingRuleID}", + "targetLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/forwardingRules/computeglobalforwardingrule-${uniqueId}", + "user": "user@example.com" +} + +--- + +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/forwardingRules/${forwardingRuleID} +Content-Type: application/json +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&forwarding_rule=computeglobalforwardingrule-${uniqueId} + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "IPAddress": "8.8.8.8", + "IPProtocol": "TCP", + "creationTimestamp": "2024-04-01T12:34:56.123456Z", + "description": "A global forwarding rule", + "fingerprint": "abcdef0123A=", + "id": "000000000000000000000", + "kind": "compute#forwardingRule", + "labelFingerprint": "abcdef0123A=", + "labels": { + "cnrm-test": "true", + "label-one": "value-two", + "managed-by-cnrm": "true" + }, + "loadBalancingScheme": "EXTERNAL", + "name": "computeglobalforwardingrule-${uniqueId}", + "networkTier": "PREMIUM", + "portRange": "110-110", + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/forwardingRules/computeglobalforwardingrule-${uniqueId}", + "target": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy2-${uniqueId}" +} + +--- + +DELETE https://compute.googleapis.com/compute/v1/projects/${projectId}/global/forwardingRules/${forwardingRuleID} +Content-Type: application/json +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&forwarding_rule=computeglobalforwardingrule-${uniqueId} + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "id": "000000000000000000000", + "insertTime": "2024-04-01T12:34:56.123456Z", + "kind": "compute#operation", + "name": "${operationID}", + "operationType": "delete", + "progress": 0, + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "RUNNING", + "targetId": "${forwardingRuleID}", + "targetLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/forwardingRules/computeglobalforwardingrule-${uniqueId}", + "user": "user@example.com" +} + +--- + +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 +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "endTime": "2024-04-01T12:34:56.123456Z", + "id": "000000000000000000000", + "insertTime": "2024-04-01T12:34:56.123456Z", + "kind": "compute#operation", + "name": "${operationID}", + "operationType": "delete", + "progress": 100, + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "DONE", + "targetId": "${forwardingRuleID}", + "targetLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/forwardingRules/computeglobalforwardingrule-${uniqueId}", + "user": "user@example.com" +} + +--- + +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/${targetTcpProxyID} +Content-Type: application/json +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&target_tcp_proxy=computetargettcpproxy2-${uniqueId} + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "creationTimestamp": "2024-04-01T12:34:56.123456Z", + "description": "other test description", + "id": "000000000000000000000", + "kind": "compute#targetTcpProxy", + "name": "computetargettcpproxy2-${uniqueId}", + "proxyHeader": "NONE", + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy2-${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/${targetTcpProxyID} +Content-Type: application/json +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&target_tcp_proxy=computetargettcpproxy2-${uniqueId} + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "id": "000000000000000000000", + "insertTime": "2024-04-01T12:34:56.123456Z", + "kind": "compute#operation", + "name": "${operationID}", + "operationType": "delete", + "progress": 0, + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "RUNNING", + "targetId": "${targetTcpProxyID}", + "targetLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy2-${uniqueId}", + "user": "user@example.com" +} + +--- + +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 +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "endTime": "2024-04-01T12:34:56.123456Z", + "id": "000000000000000000000", + "insertTime": "2024-04-01T12:34:56.123456Z", + "kind": "compute#operation", + "name": "${operationID}", + "operationType": "delete", + "progress": 100, + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "DONE", + "targetId": "${targetTcpProxyID}", + "targetLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy2-${uniqueId}", + "user": "user@example.com" +} + +--- + +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/${targetTcpProxyID} +Content-Type: application/json +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&target_tcp_proxy=computetargettcpproxy-${uniqueId} + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "creationTimestamp": "2024-04-01T12:34:56.123456Z", + "description": "test description", + "id": "000000000000000000000", + "kind": "compute#targetTcpProxy", + "name": "computetargettcpproxy-${uniqueId}", + "proxyHeader": "NONE", + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${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/${targetTcpProxyID} +Content-Type: application/json +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&target_tcp_proxy=computetargettcpproxy-${uniqueId} + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "id": "000000000000000000000", + "insertTime": "2024-04-01T12:34:56.123456Z", + "kind": "compute#operation", + "name": "${operationID}", + "operationType": "delete", + "progress": 0, + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "RUNNING", + "targetId": "${targetTcpProxyID}", + "targetLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}", + "user": "user@example.com" +} + +--- + +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 +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "endTime": "2024-04-01T12:34:56.123456Z", + "id": "000000000000000000000", + "insertTime": "2024-04-01T12:34:56.123456Z", + "kind": "compute#operation", + "name": "${operationID}", + "operationType": "delete", + "progress": 100, + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "DONE", + "targetId": "${targetTcpProxyID}", + "targetLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}", + "user": "user@example.com" +} + +--- + +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "connectionDraining": { + "drainingTimeoutSec": 300 + }, + "creationTimestamp": "2024-04-01T12:34:56.123456Z", + "healthChecks": [ + "https://www.googleapis.com/compute/v1/projects/${projectId}/global/healthChecks/computehealthcheck-${uniqueId}" + ], + "iap": { + "enabled": false, + "oauth2ClientId": "", + "oauth2ClientSecret": "" + }, + "id": "000000000000000000000", + "kind": "compute#backendService", + "loadBalancingScheme": "EXTERNAL", + "name": "computebackendservice-${uniqueId}", + "protocol": "TCP", + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}" +} + +--- + +DELETE https://compute.googleapis.com/compute/v1/projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "id": "000000000000000000000", + "insertTime": "2024-04-01T12:34:56.123456Z", + "kind": "compute#operation", + "name": "${operationID}", + "progress": 0, + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "DONE" +} + +--- + +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/healthChecks/computehealthcheck-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "checkIntervalSec": 10, + "creationTimestamp": "2024-04-01T12:34:56.123456Z", + "healthyThreshold": 2, + "httpHealthCheck": { + "port": 80, + "proxyHeader": "NONE", + "requestPath": "/" + }, + "id": "000000000000000000000", + "kind": "compute#healthCheck", + "name": "computehealthcheck-${uniqueId}", + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/healthChecks/computehealthcheck-${uniqueId}", + "timeoutSec": 5, + "type": "HTTP", + "unhealthyThreshold": 2 +} + +--- + +DELETE https://compute.googleapis.com/compute/v1/projects/${projectId}/global/healthChecks/computehealthcheck-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "id": "000000000000000000000", + "insertTime": "2024-04-01T12:34:56.123456Z", + "kind": "compute#operation", + "name": "${operationID}", + "progress": 0, + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "DONE" +} + +--- + +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/addresses/${addressID}?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "address": "8.8.8.8", + "creationTimestamp": "2024-04-01T12:34:56.123456Z", + "description": "a test global address", + "id": "000000000000000000000", + "kind": "compute#address", + "labelFingerprint": "abcdef0123A=", + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "name": "computeaddress-${uniqueId}", + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/addresses/computeaddress-${uniqueId}" +} + +--- + +DELETE https://compute.googleapis.com/compute/v1/projects/${projectId}/global/addresses/${addressID}?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "id": "000000000000000000000", + "insertTime": "2024-04-01T12:34:56.123456Z", + "kind": "compute#operation", + "name": "${operationID}", + "operationType": "delete", + "progress": 0, + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "RUNNING", + "targetId": "${addressID}", + "targetLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/addresses/computeaddress-${uniqueId}", + "user": "user@example.com" +} + +--- + +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 + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "endTime": "2024-04-01T12:34:56.123456Z", + "id": "000000000000000000000", + "insertTime": "2024-04-01T12:34:56.123456Z", + "kind": "compute#operation", + "name": "${operationID}", + "operationType": "delete", + "progress": 100, + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "DONE", + "targetId": "${addressID}", + "targetLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/addresses/computeaddress-${uniqueId}", + "user": "user@example.com" +} \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computeforwardingrule/globalcomputeforwardingruletcp-direct/create.yaml b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computeforwardingrule/globalcomputeforwardingruletcp-direct/create.yaml new file mode 100644 index 0000000000..5901b7c3af --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computeforwardingrule/globalcomputeforwardingruletcp-direct/create.yaml @@ -0,0 +1,34 @@ +# Copyright 2022 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. + +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeForwardingRule +metadata: + labels: + label-one: "value-one" + annotations: + alpha.cnrm.cloud.google.com/reconciler: "direct" + name: computeglobalforwardingrule-${uniqueId} +spec: + description: "A global forwarding rule" + location: global + target: + targetTCPProxyRef: + name: computetargettcpproxy-${uniqueId} + portRange: "110" + ipProtocol: "TCP" + loadBalancingScheme: EXTERNAL + ipAddress: + addressRef: + name: computeaddress-${uniqueId} diff --git a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computeforwardingrule/globalcomputeforwardingruletcp-direct/dependencies.yaml b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computeforwardingrule/globalcomputeforwardingruletcp-direct/dependencies.yaml new file mode 100644 index 0000000000..6f7a4f46dd --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computeforwardingrule/globalcomputeforwardingruletcp-direct/dependencies.yaml @@ -0,0 +1,68 @@ +# Copyright 2022 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. + +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeAddress +metadata: + name: computeaddress-${uniqueId} +spec: + description: a test global address + location: global +--- +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeHealthCheck +metadata: + name: computehealthcheck-${uniqueId} +spec: + checkIntervalSec: 10 + httpHealthCheck: + port: 80 + location: global +--- +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeBackendService +metadata: + name: computebackendservice-${uniqueId} +spec: + healthChecks: + - healthCheckRef: + name: computehealthcheck-${uniqueId} + location: global + protocol: TCP +--- +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeTargetTCPProxy +metadata: + annotations: + cnrm.cloud.google.com/project-id: ${projectId} + alpha.cnrm.cloud.google.com/reconciler: "direct" + name: computetargettcpproxy-${uniqueId} +spec: + description: "test description" + backendServiceRef: + name: computebackendservice-${uniqueId} + proxyHeader: NONE +--- +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeTargetTCPProxy +metadata: + annotations: + cnrm.cloud.google.com/project-id: ${projectId} + alpha.cnrm.cloud.google.com/reconciler: "direct" + name: computetargettcpproxy2-${uniqueId} +spec: + description: "other test description" + backendServiceRef: + name: computebackendservice-${uniqueId} + proxyHeader: NONE diff --git a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computeforwardingrule/globalcomputeforwardingruletcp-direct/update.yaml b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computeforwardingrule/globalcomputeforwardingruletcp-direct/update.yaml new file mode 100644 index 0000000000..dae182b211 --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computeforwardingrule/globalcomputeforwardingruletcp-direct/update.yaml @@ -0,0 +1,34 @@ +# Copyright 2022 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. + +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeForwardingRule +metadata: + labels: + label-one: "value-two" + annotations: + alpha.cnrm.cloud.google.com/reconciler: "direct" + name: computeglobalforwardingrule-${uniqueId} +spec: + description: "A global forwarding rule" + location: global + target: + targetTCPProxyRef: + name: computetargettcpproxy2-${uniqueId} + portRange: "110" + ipProtocol: "TCP" + loadBalancingScheme: EXTERNAL + ipAddress: + addressRef: + name: computeaddress-${uniqueId} 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 496f3020ca..084d3be248 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 @@ -445,11 +445,11 @@ 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" } } @@ -575,11 +575,11 @@ 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" } } diff --git a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-basic-direct/_generated_object_globalcomputetargettcpproxy-basic-direct.golden.yaml b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-basic-direct/_generated_object_globalcomputetargettcpproxy-basic-direct.golden.yaml new file mode 100644 index 0000000000..0666f344ce --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-basic-direct/_generated_object_globalcomputetargettcpproxy-basic-direct.golden.yaml @@ -0,0 +1,30 @@ +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeTargetTCPProxy +metadata: + annotations: + alpha.cnrm.cloud.google.com/reconciler: direct + cnrm.cloud.google.com/management-conflict-prevention-policy: none + cnrm.cloud.google.com/project-id: ${projectId} + finalizers: + - cnrm.cloud.google.com/finalizer + - cnrm.cloud.google.com/deletion-defender + generation: 1 + labels: + cnrm-test: "true" + name: computetargettcpproxy-${uniqueId} + namespace: ${uniqueId} +spec: + backendServiceRef: + name: computebackendservice-${uniqueId} +status: + conditions: + - lastTransitionTime: "1970-01-01T00:00:00Z" + message: The resource is up to date + reason: UpToDate + status: "True" + type: Ready + creationTimestamp: "1970-01-01T00:00:00Z" + externalRef: projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId} + observedGeneration: 1 + 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/globalcomputetargettcpproxy-basic-direct/_http.log b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-basic-direct/_http.log new file mode 100644 index 0000000000..13129433c9 --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-basic-direct/_http.log @@ -0,0 +1,544 @@ +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/healthChecks/computehealthcheck-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +404 Not Found +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "error": { + "code": 404, + "errors": [ + { + "domain": "global", + "message": "healthCheck \"projects/${projectId}/global/healthChecks/computehealthcheck-${uniqueId}\" not found", + "reason": "notFound" + } + ], + "message": "healthCheck \"projects/${projectId}/global/healthChecks/computehealthcheck-${uniqueId}\" not found" + } +} + +--- + +POST https://compute.googleapis.com/compute/v1/projects/${projectId}/global/healthChecks?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +{ + "checkIntervalSec": 10, + "healthyThreshold": 2, + "name": "computehealthcheck-${uniqueId}", + "tcpHealthCheck": { + "port": 443, + "proxyHeader": "NONE" + }, + "timeoutSec": 5, + "type": "TCP", + "unhealthyThreshold": 2 +} + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "id": "000000000000000000000", + "insertTime": "2024-04-01T12:34:56.123456Z", + "kind": "compute#operation", + "name": "${operationID}", + "progress": 0, + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "DONE" +} + +--- + +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/healthChecks/computehealthcheck-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "checkIntervalSec": 10, + "creationTimestamp": "2024-04-01T12:34:56.123456Z", + "healthyThreshold": 2, + "id": "000000000000000000000", + "kind": "compute#healthCheck", + "name": "computehealthcheck-${uniqueId}", + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/healthChecks/computehealthcheck-${uniqueId}", + "tcpHealthCheck": { + "port": 443, + "proxyHeader": "NONE" + }, + "timeoutSec": 5, + "type": "TCP", + "unhealthyThreshold": 2 +} + +--- + +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +404 Not Found +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "error": { + "code": 404, + "errors": [ + { + "domain": "global", + "message": "The resource 'projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}' was not found", + "reason": "notFound" + } + ], + "message": "The resource 'projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}' was not found" + } +} + +--- + +POST https://compute.googleapis.com/compute/v1/projects/${projectId}/global/backendServices?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +{ + "connectionDraining": { + "drainingTimeoutSec": 300 + }, + "healthChecks": [ + "https://www.googleapis.com/compute/v1/projects/${projectId}/global/healthChecks/computehealthcheck-${uniqueId}" + ], + "iap": { + "enabled": false, + "oauth2ClientId": "", + "oauth2ClientSecret": "" + }, + "loadBalancingScheme": "EXTERNAL", + "name": "computebackendservice-${uniqueId}", + "protocol": "TCP" +} + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "id": "000000000000000000000", + "insertTime": "2024-04-01T12:34:56.123456Z", + "kind": "compute#operation", + "name": "${operationID}", + "progress": 0, + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "DONE" +} + +--- + +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "connectionDraining": { + "drainingTimeoutSec": 300 + }, + "creationTimestamp": "2024-04-01T12:34:56.123456Z", + "healthChecks": [ + "https://www.googleapis.com/compute/v1/projects/${projectId}/global/healthChecks/computehealthcheck-${uniqueId}" + ], + "iap": { + "enabled": false, + "oauth2ClientId": "", + "oauth2ClientSecret": "" + }, + "id": "000000000000000000000", + "kind": "compute#backendService", + "loadBalancingScheme": "EXTERNAL", + "name": "computebackendservice-${uniqueId}", + "protocol": "TCP", + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}" +} + +--- + +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/${targetTcpProxyID} +Content-Type: application/json +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&target_tcp_proxy=computetargettcpproxy-${uniqueId} + +404 Not Found +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "error": { + "code": 404, + "errors": [ + { + "domain": "global", + "message": "The resource 'projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}' was not found", + "reason": "notFound" + } + ], + "message": "The resource 'projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}' was not found" + } +} + +--- + +POST https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies +Content-Type: application/json +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId} + +{ + "name": "computetargettcpproxy-${uniqueId}", + "service": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}" +} + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "id": "000000000000000000000", + "insertTime": "2024-04-01T12:34:56.123456Z", + "kind": "compute#operation", + "name": "${operationID}", + "operationType": "insert", + "progress": 0, + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "RUNNING", + "targetId": "${targetTcpProxyID}", + "targetLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}", + "user": "user@example.com" +} + +--- + +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 +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "endTime": "2024-04-01T12:34:56.123456Z", + "id": "000000000000000000000", + "insertTime": "2024-04-01T12:34:56.123456Z", + "kind": "compute#operation", + "name": "${operationID}", + "operationType": "insert", + "progress": 100, + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "DONE", + "targetId": "${targetTcpProxyID}", + "targetLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}", + "user": "user@example.com" +} + +--- + +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/${targetTcpProxyID} +Content-Type: application/json +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&target_tcp_proxy=computetargettcpproxy-${uniqueId} + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "creationTimestamp": "2024-04-01T12:34:56.123456Z", + "id": "000000000000000000000", + "kind": "compute#targetTcpProxy", + "name": "computetargettcpproxy-${uniqueId}", + "proxyHeader": "NONE", + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${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/${targetTcpProxyID} +Content-Type: application/json +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&target_tcp_proxy=computetargettcpproxy-${uniqueId} + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "id": "000000000000000000000", + "insertTime": "2024-04-01T12:34:56.123456Z", + "kind": "compute#operation", + "name": "${operationID}", + "operationType": "delete", + "progress": 0, + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "RUNNING", + "targetId": "${targetTcpProxyID}", + "targetLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}", + "user": "user@example.com" +} + +--- + +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 +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "endTime": "2024-04-01T12:34:56.123456Z", + "id": "000000000000000000000", + "insertTime": "2024-04-01T12:34:56.123456Z", + "kind": "compute#operation", + "name": "${operationID}", + "operationType": "delete", + "progress": 100, + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "DONE", + "targetId": "${targetTcpProxyID}", + "targetLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}", + "user": "user@example.com" +} + +--- + +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "connectionDraining": { + "drainingTimeoutSec": 300 + }, + "creationTimestamp": "2024-04-01T12:34:56.123456Z", + "healthChecks": [ + "https://www.googleapis.com/compute/v1/projects/${projectId}/global/healthChecks/computehealthcheck-${uniqueId}" + ], + "iap": { + "enabled": false, + "oauth2ClientId": "", + "oauth2ClientSecret": "" + }, + "id": "000000000000000000000", + "kind": "compute#backendService", + "loadBalancingScheme": "EXTERNAL", + "name": "computebackendservice-${uniqueId}", + "protocol": "TCP", + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}" +} + +--- + +DELETE https://compute.googleapis.com/compute/v1/projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "id": "000000000000000000000", + "insertTime": "2024-04-01T12:34:56.123456Z", + "kind": "compute#operation", + "name": "${operationID}", + "progress": 0, + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "DONE" +} + +--- + +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/healthChecks/computehealthcheck-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "checkIntervalSec": 10, + "creationTimestamp": "2024-04-01T12:34:56.123456Z", + "healthyThreshold": 2, + "id": "000000000000000000000", + "kind": "compute#healthCheck", + "name": "computehealthcheck-${uniqueId}", + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/healthChecks/computehealthcheck-${uniqueId}", + "tcpHealthCheck": { + "port": 443, + "proxyHeader": "NONE" + }, + "timeoutSec": 5, + "type": "TCP", + "unhealthyThreshold": 2 +} + +--- + +DELETE https://compute.googleapis.com/compute/v1/projects/${projectId}/global/healthChecks/computehealthcheck-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "id": "000000000000000000000", + "insertTime": "2024-04-01T12:34:56.123456Z", + "kind": "compute#operation", + "name": "${operationID}", + "progress": 0, + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "DONE" +} \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-basic-direct/create.yaml b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-basic-direct/create.yaml new file mode 100644 index 0000000000..4fa897d040 --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-basic-direct/create.yaml @@ -0,0 +1,24 @@ +# Copyright 2022 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. + +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeTargetTCPProxy +metadata: + annotations: + cnrm.cloud.google.com/project-id: ${projectId} + alpha.cnrm.cloud.google.com/reconciler: "direct" + name: computetargettcpproxy-${uniqueId} +spec: + backendServiceRef: + name: computebackendservice-${uniqueId} diff --git a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/dependencies.yaml b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-basic-direct/dependencies.yaml similarity index 100% rename from pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/dependencies.yaml rename to pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-basic-direct/dependencies.yaml diff --git a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-basic-direct/update.yaml b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-basic-direct/update.yaml new file mode 100644 index 0000000000..4fa897d040 --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-basic-direct/update.yaml @@ -0,0 +1,24 @@ +# Copyright 2022 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. + +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeTargetTCPProxy +metadata: + annotations: + cnrm.cloud.google.com/project-id: ${projectId} + alpha.cnrm.cloud.google.com/reconciler: "direct" + name: computetargettcpproxy-${uniqueId} +spec: + backendServiceRef: + name: computebackendservice-${uniqueId} diff --git a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-basic/_generated_object_globalcomputetargettcpproxy-basic.golden.yaml b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-basic/_generated_object_globalcomputetargettcpproxy-basic.golden.yaml new file mode 100644 index 0000000000..86e2070b44 --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-basic/_generated_object_globalcomputetargettcpproxy-basic.golden.yaml @@ -0,0 +1,30 @@ +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeTargetTCPProxy +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: 2 + labels: + cnrm-test: "true" + name: computetargettcpproxy-${uniqueId} + namespace: ${uniqueId} +spec: + backendServiceRef: + name: computebackendservice-${uniqueId} + resourceID: computetargettcpproxy-${uniqueId} +status: + conditions: + - lastTransitionTime: "1970-01-01T00:00:00Z" + message: The resource is up to date + reason: UpToDate + status: "True" + type: Ready + creationTimestamp: "1970-01-01T00:00:00Z" + 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/globalcomputetargettcpproxy-basic/_http.log b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-basic/_http.log new file mode 100644 index 0000000000..dcb387066d --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-basic/_http.log @@ -0,0 +1,537 @@ +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/healthChecks/computehealthcheck-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +404 Not Found +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "error": { + "code": 404, + "errors": [ + { + "domain": "global", + "message": "healthCheck \"projects/${projectId}/global/healthChecks/computehealthcheck-${uniqueId}\" not found", + "reason": "notFound" + } + ], + "message": "healthCheck \"projects/${projectId}/global/healthChecks/computehealthcheck-${uniqueId}\" not found" + } +} + +--- + +POST https://compute.googleapis.com/compute/v1/projects/${projectId}/global/healthChecks?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +{ + "checkIntervalSec": 10, + "healthyThreshold": 2, + "name": "computehealthcheck-${uniqueId}", + "tcpHealthCheck": { + "port": 443, + "proxyHeader": "NONE" + }, + "timeoutSec": 5, + "type": "TCP", + "unhealthyThreshold": 2 +} + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "id": "000000000000000000000", + "insertTime": "2024-04-01T12:34:56.123456Z", + "kind": "compute#operation", + "name": "${operationID}", + "progress": 0, + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "DONE" +} + +--- + +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/healthChecks/computehealthcheck-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "checkIntervalSec": 10, + "creationTimestamp": "2024-04-01T12:34:56.123456Z", + "healthyThreshold": 2, + "id": "000000000000000000000", + "kind": "compute#healthCheck", + "name": "computehealthcheck-${uniqueId}", + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/healthChecks/computehealthcheck-${uniqueId}", + "tcpHealthCheck": { + "port": 443, + "proxyHeader": "NONE" + }, + "timeoutSec": 5, + "type": "TCP", + "unhealthyThreshold": 2 +} + +--- + +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +404 Not Found +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "error": { + "code": 404, + "errors": [ + { + "domain": "global", + "message": "The resource 'projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}' was not found", + "reason": "notFound" + } + ], + "message": "The resource 'projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}' was not found" + } +} + +--- + +POST https://compute.googleapis.com/compute/v1/projects/${projectId}/global/backendServices?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +{ + "connectionDraining": { + "drainingTimeoutSec": 300 + }, + "healthChecks": [ + "https://www.googleapis.com/compute/v1/projects/${projectId}/global/healthChecks/computehealthcheck-${uniqueId}" + ], + "iap": { + "enabled": false, + "oauth2ClientId": "", + "oauth2ClientSecret": "" + }, + "loadBalancingScheme": "EXTERNAL", + "name": "computebackendservice-${uniqueId}", + "protocol": "TCP" +} + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "id": "000000000000000000000", + "insertTime": "2024-04-01T12:34:56.123456Z", + "kind": "compute#operation", + "name": "${operationID}", + "progress": 0, + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "DONE" +} + +--- + +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "connectionDraining": { + "drainingTimeoutSec": 300 + }, + "creationTimestamp": "2024-04-01T12:34:56.123456Z", + "healthChecks": [ + "https://www.googleapis.com/compute/v1/projects/${projectId}/global/healthChecks/computehealthcheck-${uniqueId}" + ], + "iap": { + "enabled": false, + "oauth2ClientId": "", + "oauth2ClientSecret": "" + }, + "id": "000000000000000000000", + "kind": "compute#backendService", + "loadBalancingScheme": "EXTERNAL", + "name": "computebackendservice-${uniqueId}", + "protocol": "TCP", + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}" +} + +--- + +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/${targetTcpProxyID}?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +404 Not Found +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "error": { + "code": 404, + "errors": [ + { + "domain": "global", + "message": "The resource 'projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}' was not found", + "reason": "notFound" + } + ], + "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 +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +{ + "name": "computetargettcpproxy-${uniqueId}", + "proxyHeader": "NONE", + "service": "projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}" +} + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "id": "000000000000000000000", + "insertTime": "2024-04-01T12:34:56.123456Z", + "kind": "compute#operation", + "name": "${operationID}", + "operationType": "insert", + "progress": 0, + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "RUNNING", + "targetId": "${targetTcpProxyID}", + "targetLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}", + "user": "user@example.com" +} + +--- + +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 + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "endTime": "2024-04-01T12:34:56.123456Z", + "id": "000000000000000000000", + "insertTime": "2024-04-01T12:34:56.123456Z", + "kind": "compute#operation", + "name": "${operationID}", + "operationType": "insert", + "progress": 100, + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "DONE", + "targetId": "${targetTcpProxyID}", + "targetLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}", + "user": "user@example.com" +} + +--- + +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/${targetTcpProxyID}?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "creationTimestamp": "2024-04-01T12:34:56.123456Z", + "id": "000000000000000000000", + "kind": "compute#targetTcpProxy", + "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}" +} + +--- + +DELETE https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/${targetTcpProxyID}?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "id": "000000000000000000000", + "insertTime": "2024-04-01T12:34:56.123456Z", + "kind": "compute#operation", + "name": "${operationID}", + "operationType": "delete", + "progress": 0, + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "RUNNING", + "targetId": "${targetTcpProxyID}", + "targetLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}", + "user": "user@example.com" +} + +--- + +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 + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "endTime": "2024-04-01T12:34:56.123456Z", + "id": "000000000000000000000", + "insertTime": "2024-04-01T12:34:56.123456Z", + "kind": "compute#operation", + "name": "${operationID}", + "operationType": "delete", + "progress": 100, + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "DONE", + "targetId": "${targetTcpProxyID}", + "targetLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}", + "user": "user@example.com" +} + +--- + +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "connectionDraining": { + "drainingTimeoutSec": 300 + }, + "creationTimestamp": "2024-04-01T12:34:56.123456Z", + "healthChecks": [ + "https://www.googleapis.com/compute/v1/projects/${projectId}/global/healthChecks/computehealthcheck-${uniqueId}" + ], + "iap": { + "enabled": false, + "oauth2ClientId": "", + "oauth2ClientSecret": "" + }, + "id": "000000000000000000000", + "kind": "compute#backendService", + "loadBalancingScheme": "EXTERNAL", + "name": "computebackendservice-${uniqueId}", + "protocol": "TCP", + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}" +} + +--- + +DELETE https://compute.googleapis.com/compute/v1/projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "id": "000000000000000000000", + "insertTime": "2024-04-01T12:34:56.123456Z", + "kind": "compute#operation", + "name": "${operationID}", + "progress": 0, + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "DONE" +} + +--- + +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/healthChecks/computehealthcheck-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "checkIntervalSec": 10, + "creationTimestamp": "2024-04-01T12:34:56.123456Z", + "healthyThreshold": 2, + "id": "000000000000000000000", + "kind": "compute#healthCheck", + "name": "computehealthcheck-${uniqueId}", + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/healthChecks/computehealthcheck-${uniqueId}", + "tcpHealthCheck": { + "port": 443, + "proxyHeader": "NONE" + }, + "timeoutSec": 5, + "type": "TCP", + "unhealthyThreshold": 2 +} + +--- + +DELETE https://compute.googleapis.com/compute/v1/projects/${projectId}/global/healthChecks/computehealthcheck-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "id": "000000000000000000000", + "insertTime": "2024-04-01T12:34:56.123456Z", + "kind": "compute#operation", + "name": "${operationID}", + "progress": 0, + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "DONE" +} \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/create.yaml b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-basic/create.yaml similarity index 97% rename from pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/create.yaml rename to pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-basic/create.yaml index 8f0aed9bde..5ce9fad643 100644 --- a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/create.yaml +++ b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-basic/create.yaml @@ -21,4 +21,3 @@ metadata: spec: backendServiceRef: name: computebackendservice-${uniqueId} - proxyHeader: NONE diff --git a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-basic/dependencies.yaml b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-basic/dependencies.yaml new file mode 100644 index 0000000000..41e379a2fe --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-basic/dependencies.yaml @@ -0,0 +1,35 @@ +# Copyright 2022 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. + +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeHealthCheck +metadata: + name: computehealthcheck-${uniqueId} +spec: + checkIntervalSec: 10 + tcpHealthCheck: + port: 443 + location: global +--- +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeBackendService +metadata: + name: computebackendservice-${uniqueId} +spec: + healthChecks: + - healthCheckRef: + name: computehealthcheck-${uniqueId} + location: global + protocol: TCP + diff --git a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/update.yaml b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-basic/update.yaml similarity index 97% rename from pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/update.yaml rename to pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-basic/update.yaml index 516754a19e..5ce9fad643 100644 --- a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/update.yaml +++ b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-basic/update.yaml @@ -21,4 +21,3 @@ metadata: spec: backendServiceRef: name: computebackendservice-${uniqueId} - proxyHeader: PROXY_V1 diff --git a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-full-direct/_generated_object_globalcomputetargettcpproxy-full-direct.golden.yaml b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-full-direct/_generated_object_globalcomputetargettcpproxy-full-direct.golden.yaml new file mode 100644 index 0000000000..4d9666af4d --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-full-direct/_generated_object_globalcomputetargettcpproxy-full-direct.golden.yaml @@ -0,0 +1,33 @@ +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeTargetTCPProxy +metadata: + annotations: + alpha.cnrm.cloud.google.com/reconciler: direct + cnrm.cloud.google.com/management-conflict-prevention-policy: none + cnrm.cloud.google.com/project-id: ${projectId} + finalizers: + - cnrm.cloud.google.com/finalizer + - cnrm.cloud.google.com/deletion-defender + generation: 2 + labels: + cnrm-test: "true" + name: computetargettcpproxy-${uniqueId} + namespace: ${uniqueId} +spec: + backendServiceRef: + name: computebackendservice-${uniqueId} + description: test target tcp proxy + proxyBind: false + proxyHeader: PROXY_V1 +status: + conditions: + - lastTransitionTime: "1970-01-01T00:00:00Z" + message: The resource is up to date + reason: UpToDate + status: "True" + type: Ready + creationTimestamp: "1970-01-01T00:00:00Z" + 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/globalcomputetargettcpproxy-full-direct/_http.log b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-full-direct/_http.log new file mode 100644 index 0000000000..bc776e6c89 --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-full-direct/_http.log @@ -0,0 +1,650 @@ +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/healthChecks/computehealthcheck-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +404 Not Found +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "error": { + "code": 404, + "errors": [ + { + "domain": "global", + "message": "healthCheck \"projects/${projectId}/global/healthChecks/computehealthcheck-${uniqueId}\" not found", + "reason": "notFound" + } + ], + "message": "healthCheck \"projects/${projectId}/global/healthChecks/computehealthcheck-${uniqueId}\" not found" + } +} + +--- + +POST https://compute.googleapis.com/compute/v1/projects/${projectId}/global/healthChecks?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +{ + "checkIntervalSec": 10, + "healthyThreshold": 2, + "name": "computehealthcheck-${uniqueId}", + "tcpHealthCheck": { + "port": 443, + "proxyHeader": "NONE" + }, + "timeoutSec": 5, + "type": "TCP", + "unhealthyThreshold": 2 +} + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "id": "000000000000000000000", + "insertTime": "2024-04-01T12:34:56.123456Z", + "kind": "compute#operation", + "name": "${operationID}", + "progress": 0, + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "DONE" +} + +--- + +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/healthChecks/computehealthcheck-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "checkIntervalSec": 10, + "creationTimestamp": "2024-04-01T12:34:56.123456Z", + "healthyThreshold": 2, + "id": "000000000000000000000", + "kind": "compute#healthCheck", + "name": "computehealthcheck-${uniqueId}", + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/healthChecks/computehealthcheck-${uniqueId}", + "tcpHealthCheck": { + "port": 443, + "proxyHeader": "NONE" + }, + "timeoutSec": 5, + "type": "TCP", + "unhealthyThreshold": 2 +} + +--- + +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +404 Not Found +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "error": { + "code": 404, + "errors": [ + { + "domain": "global", + "message": "The resource 'projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}' was not found", + "reason": "notFound" + } + ], + "message": "The resource 'projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}' was not found" + } +} + +--- + +POST https://compute.googleapis.com/compute/v1/projects/${projectId}/global/backendServices?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +{ + "connectionDraining": { + "drainingTimeoutSec": 300 + }, + "healthChecks": [ + "https://www.googleapis.com/compute/v1/projects/${projectId}/global/healthChecks/computehealthcheck-${uniqueId}" + ], + "iap": { + "enabled": false, + "oauth2ClientId": "", + "oauth2ClientSecret": "" + }, + "loadBalancingScheme": "EXTERNAL", + "name": "computebackendservice-${uniqueId}", + "protocol": "TCP" +} + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "id": "000000000000000000000", + "insertTime": "2024-04-01T12:34:56.123456Z", + "kind": "compute#operation", + "name": "${operationID}", + "progress": 0, + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "DONE" +} + +--- + +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "connectionDraining": { + "drainingTimeoutSec": 300 + }, + "creationTimestamp": "2024-04-01T12:34:56.123456Z", + "healthChecks": [ + "https://www.googleapis.com/compute/v1/projects/${projectId}/global/healthChecks/computehealthcheck-${uniqueId}" + ], + "iap": { + "enabled": false, + "oauth2ClientId": "", + "oauth2ClientSecret": "" + }, + "id": "000000000000000000000", + "kind": "compute#backendService", + "loadBalancingScheme": "EXTERNAL", + "name": "computebackendservice-${uniqueId}", + "protocol": "TCP", + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}" +} + +--- + +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/${targetTcpProxyID} +Content-Type: application/json +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&target_tcp_proxy=computetargettcpproxy-${uniqueId} + +404 Not Found +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "error": { + "code": 404, + "errors": [ + { + "domain": "global", + "message": "The resource 'projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}' was not found", + "reason": "notFound" + } + ], + "message": "The resource 'projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}' was not found" + } +} + +--- + +POST https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies +Content-Type: application/json +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId} + +{ + "description": "test target tcp proxy", + "name": "computetargettcpproxy-${uniqueId}", + "proxyBind": false, + "proxyHeader": "NONE", + "service": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}" +} + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "id": "000000000000000000000", + "insertTime": "2024-04-01T12:34:56.123456Z", + "kind": "compute#operation", + "name": "${operationID}", + "operationType": "insert", + "progress": 0, + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "RUNNING", + "targetId": "${targetTcpProxyID}", + "targetLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}", + "user": "user@example.com" +} + +--- + +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 +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "endTime": "2024-04-01T12:34:56.123456Z", + "id": "000000000000000000000", + "insertTime": "2024-04-01T12:34:56.123456Z", + "kind": "compute#operation", + "name": "${operationID}", + "operationType": "insert", + "progress": 100, + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "DONE", + "targetId": "${targetTcpProxyID}", + "targetLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}", + "user": "user@example.com" +} + +--- + +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/${targetTcpProxyID} +Content-Type: application/json +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&target_tcp_proxy=computetargettcpproxy-${uniqueId} + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "creationTimestamp": "2024-04-01T12:34:56.123456Z", + "description": "test target tcp proxy", + "id": "000000000000000000000", + "kind": "compute#targetTcpProxy", + "name": "computetargettcpproxy-${uniqueId}", + "proxyBind": false, + "proxyHeader": "NONE", + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${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/${targetTcpProxyID}/setProxyHeader +Content-Type: application/json +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&target_tcp_proxy=computetargettcpproxy-${uniqueId} + +{ + "proxyHeader": "PROXY_V1" +} + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "id": "000000000000000000000", + "insertTime": "2024-04-01T12:34:56.123456Z", + "kind": "compute#operation", + "name": "${operationID}", + "operationType": "TargetTcpProxySetProxyHeader", + "progress": 0, + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "RUNNING", + "targetId": "${targetTcpProxyID}", + "targetLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}", + "user": "user@example.com" +} + +--- + +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 +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "endTime": "2024-04-01T12:34:56.123456Z", + "id": "000000000000000000000", + "insertTime": "2024-04-01T12:34:56.123456Z", + "kind": "compute#operation", + "name": "${operationID}", + "operationType": "TargetTcpProxySetProxyHeader", + "progress": 100, + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "DONE", + "targetId": "${targetTcpProxyID}", + "targetLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}", + "user": "user@example.com" +} + +--- + +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/${targetTcpProxyID} +Content-Type: application/json +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&target_tcp_proxy=computetargettcpproxy-${uniqueId} + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "creationTimestamp": "2024-04-01T12:34:56.123456Z", + "description": "test target tcp proxy", + "id": "000000000000000000000", + "kind": "compute#targetTcpProxy", + "name": "computetargettcpproxy-${uniqueId}", + "proxyBind": false, + "proxyHeader": "PROXY_V1", + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${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/${targetTcpProxyID} +Content-Type: application/json +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&target_tcp_proxy=computetargettcpproxy-${uniqueId} + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "id": "000000000000000000000", + "insertTime": "2024-04-01T12:34:56.123456Z", + "kind": "compute#operation", + "name": "${operationID}", + "operationType": "delete", + "progress": 0, + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "RUNNING", + "targetId": "${targetTcpProxyID}", + "targetLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}", + "user": "user@example.com" +} + +--- + +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 +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "endTime": "2024-04-01T12:34:56.123456Z", + "id": "000000000000000000000", + "insertTime": "2024-04-01T12:34:56.123456Z", + "kind": "compute#operation", + "name": "${operationID}", + "operationType": "delete", + "progress": 100, + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "DONE", + "targetId": "${targetTcpProxyID}", + "targetLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}", + "user": "user@example.com" +} + +--- + +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "connectionDraining": { + "drainingTimeoutSec": 300 + }, + "creationTimestamp": "2024-04-01T12:34:56.123456Z", + "healthChecks": [ + "https://www.googleapis.com/compute/v1/projects/${projectId}/global/healthChecks/computehealthcheck-${uniqueId}" + ], + "iap": { + "enabled": false, + "oauth2ClientId": "", + "oauth2ClientSecret": "" + }, + "id": "000000000000000000000", + "kind": "compute#backendService", + "loadBalancingScheme": "EXTERNAL", + "name": "computebackendservice-${uniqueId}", + "protocol": "TCP", + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}" +} + +--- + +DELETE https://compute.googleapis.com/compute/v1/projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "id": "000000000000000000000", + "insertTime": "2024-04-01T12:34:56.123456Z", + "kind": "compute#operation", + "name": "${operationID}", + "progress": 0, + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "DONE" +} + +--- + +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/healthChecks/computehealthcheck-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "checkIntervalSec": 10, + "creationTimestamp": "2024-04-01T12:34:56.123456Z", + "healthyThreshold": 2, + "id": "000000000000000000000", + "kind": "compute#healthCheck", + "name": "computehealthcheck-${uniqueId}", + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/healthChecks/computehealthcheck-${uniqueId}", + "tcpHealthCheck": { + "port": 443, + "proxyHeader": "NONE" + }, + "timeoutSec": 5, + "type": "TCP", + "unhealthyThreshold": 2 +} + +--- + +DELETE https://compute.googleapis.com/compute/v1/projects/${projectId}/global/healthChecks/computehealthcheck-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "id": "000000000000000000000", + "insertTime": "2024-04-01T12:34:56.123456Z", + "kind": "compute#operation", + "name": "${operationID}", + "progress": 0, + "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "DONE" +} \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-full-direct/create.yaml b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-full-direct/create.yaml new file mode 100644 index 0000000000..502a07ed29 --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-full-direct/create.yaml @@ -0,0 +1,27 @@ +# Copyright 2022 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. + +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeTargetTCPProxy +metadata: + annotations: + cnrm.cloud.google.com/project-id: ${projectId} + alpha.cnrm.cloud.google.com/reconciler: "direct" + name: computetargettcpproxy-${uniqueId} +spec: + description: "test target tcp proxy" + backendServiceRef: + name: computebackendservice-${uniqueId} + proxyBind: false + proxyHeader: NONE diff --git a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-full-direct/dependencies.yaml b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-full-direct/dependencies.yaml new file mode 100644 index 0000000000..41e379a2fe --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-full-direct/dependencies.yaml @@ -0,0 +1,35 @@ +# Copyright 2022 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. + +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeHealthCheck +metadata: + name: computehealthcheck-${uniqueId} +spec: + checkIntervalSec: 10 + tcpHealthCheck: + port: 443 + location: global +--- +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeBackendService +metadata: + name: computebackendservice-${uniqueId} +spec: + healthChecks: + - healthCheckRef: + name: computehealthcheck-${uniqueId} + location: global + protocol: TCP + diff --git a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-full-direct/update.yaml b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-full-direct/update.yaml new file mode 100644 index 0000000000..34f627e368 --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-full-direct/update.yaml @@ -0,0 +1,27 @@ +# Copyright 2022 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. + +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeTargetTCPProxy +metadata: + annotations: + cnrm.cloud.google.com/project-id: ${projectId} + alpha.cnrm.cloud.google.com/reconciler: "direct" + name: computetargettcpproxy-${uniqueId} +spec: + description: "test target tcp proxy" + backendServiceRef: + name: computebackendservice-${uniqueId} + proxyBind: false + proxyHeader: PROXY_V1 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/globalcomputetargettcpproxy-full/_generated_object_globalcomputetargettcpproxy-full.golden.yaml similarity index 94% rename from pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/_generated_object_computetargettcpproxy.golden.yaml rename to pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-full/_generated_object_globalcomputetargettcpproxy-full.golden.yaml index 25f407780d..320b868b4d 100644 --- a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/_generated_object_computetargettcpproxy.golden.yaml +++ b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-full/_generated_object_globalcomputetargettcpproxy-full.golden.yaml @@ -16,6 +16,8 @@ metadata: spec: backendServiceRef: name: computebackendservice-${uniqueId} + description: test target tcp proxy + proxyBind: false proxyHeader: PROXY_V1 resourceID: computetargettcpproxy-${uniqueId} status: diff --git a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/_http.log b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-full/_http.log similarity index 97% rename from pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/_http.log rename to pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-full/_http.log index c29482c0eb..e83ff3a1e7 100644 --- a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-full/_http.log @@ -239,11 +239,11 @@ 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" } } @@ -254,6 +254,7 @@ Content-Type: application/json User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager { + "description": "test target tcp proxy", "name": "computetargettcpproxy-${uniqueId}", "proxyHeader": "NONE", "service": "projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}" @@ -336,6 +337,7 @@ X-Xss-Protection: 0 { "creationTimestamp": "2024-04-01T12:34:56.123456Z", + "description": "test target tcp proxy", "id": "000000000000000000000", "kind": "compute#targetTcpProxy", "name": "computetargettcpproxy-${uniqueId}", @@ -370,7 +372,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", @@ -402,7 +404,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", @@ -431,6 +433,7 @@ X-Xss-Protection: 0 { "creationTimestamp": "2024-04-01T12:34:56.123456Z", + "description": "test target tcp proxy", "id": "000000000000000000000", "kind": "compute#targetTcpProxy", "name": "computetargettcpproxy-${uniqueId}", diff --git a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-full/create.yaml b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-full/create.yaml new file mode 100644 index 0000000000..93b78899f0 --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-full/create.yaml @@ -0,0 +1,26 @@ +# Copyright 2022 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. + +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeTargetTCPProxy +metadata: + annotations: + cnrm.cloud.google.com/project-id: ${projectId} + name: computetargettcpproxy-${uniqueId} +spec: + description: "test target tcp proxy" + backendServiceRef: + name: computebackendservice-${uniqueId} + proxyBind: false + proxyHeader: NONE diff --git a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-full/dependencies.yaml b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-full/dependencies.yaml new file mode 100644 index 0000000000..41e379a2fe --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-full/dependencies.yaml @@ -0,0 +1,35 @@ +# Copyright 2022 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. + +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeHealthCheck +metadata: + name: computehealthcheck-${uniqueId} +spec: + checkIntervalSec: 10 + tcpHealthCheck: + port: 443 + location: global +--- +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeBackendService +metadata: + name: computebackendservice-${uniqueId} +spec: + healthChecks: + - healthCheckRef: + name: computehealthcheck-${uniqueId} + location: global + protocol: TCP + diff --git a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-full/update.yaml b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-full/update.yaml new file mode 100644 index 0000000000..3019011cd8 --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globalcomputetargettcpproxy-full/update.yaml @@ -0,0 +1,26 @@ +# Copyright 2022 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. + +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeTargetTCPProxy +metadata: + annotations: + cnrm.cloud.google.com/project-id: ${projectId} + name: computetargettcpproxy-${uniqueId} +spec: + description: "test target tcp proxy" + backendServiceRef: + name: computebackendservice-${uniqueId} + proxyBind: false + proxyHeader: PROXY_V1