From 5263b11312d5b82698b5a7ff7eabc936e963ab3c Mon Sep 17 00:00:00 2001 From: Gemma Hou Date: Wed, 30 Oct 2024 22:45:45 +0000 Subject: [PATCH] Migrate compute target TCP proxy(global) to direct controller --- dev/tasks/run-e2e | 2 +- .../globalcomputeforwardingruletcp/_http.log | 86 +++++++++++-------- ...ed_object_globaltargettcpproxy.golden.yaml | 7 +- .../globaltargettcpproxy/_http.log | 54 +++++++----- 4 files changed, 89 insertions(+), 60 deletions(-) diff --git a/dev/tasks/run-e2e b/dev/tasks/run-e2e index 57f0c793c6..9fa6704e60 100755 --- a/dev/tasks/run-e2e +++ b/dev/tasks/run-e2e @@ -26,7 +26,7 @@ if [[ -z "${KUBEBUILDER_ASSETS:-}" ]]; then fi if [[ -z "${KCC_USE_DIRECT_RECONCILERS:-}" ]]; then - KCC_USE_DIRECT_RECONCILERS=ComputeForwardingRule,GKEHubFeatureMembership,SecretManagerSecret + KCC_USE_DIRECT_RECONCILERS=ComputeForwardingRule,ComputeTargetTCPProxy,GKEHubFeatureMembership,SecretManagerSecret fi echo "Using direct controllers: $KCC_USE_DIRECT_RECONCILERS" export KCC_USE_DIRECT_RECONCILERS diff --git a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computeforwardingrule/globalcomputeforwardingruletcp/_http.log b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computeforwardingrule/globalcomputeforwardingruletcp/_http.log index 1ef39630b1..4f78186c38 100644 --- a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computeforwardingrule/globalcomputeforwardingruletcp/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computeforwardingrule/globalcomputeforwardingruletcp/_http.log @@ -424,9 +424,10 @@ X-Xss-Protection: 0 --- -GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}?alt=json +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId} Content-Type: application/json -User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&target_tcp_proxy=computetargettcpproxy-${uniqueId} 404 Not Found Cache-Control: private @@ -455,15 +456,16 @@ X-Xss-Protection: 0 --- -POST https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies?alt=json +POST https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies Content-Type: application/json -User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId} { "description": "test description", "name": "computetargettcpproxy-${uniqueId}", "proxyHeader": "NONE", - "service": "projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}" + "service": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}" } 200 OK @@ -494,8 +496,10 @@ X-Xss-Protection: 0 --- -GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}?alt=json&prettyPrint=false -User-Agent: google-api-go-client/0.5 Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID} +Content-Type: application/json +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&operation=${operationID} 200 OK Cache-Control: private @@ -526,9 +530,10 @@ X-Xss-Protection: 0 --- -GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}?alt=json +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId} Content-Type: application/json -User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&target_tcp_proxy=computetargettcpproxy-${uniqueId} 200 OK Cache-Control: private @@ -549,14 +554,15 @@ X-Xss-Protection: 0 "name": "computetargettcpproxy-${uniqueId}", "proxyHeader": "NONE", "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}", - "service": "projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}" + "service": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}" } --- -GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy2-${uniqueId}?alt=json +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy2-${uniqueId} Content-Type: application/json -User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&target_tcp_proxy=computetargettcpproxy2-${uniqueId} 404 Not Found Cache-Control: private @@ -585,15 +591,16 @@ X-Xss-Protection: 0 --- -POST https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies?alt=json +POST https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies Content-Type: application/json -User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId} { "description": "other test description", "name": "computetargettcpproxy2-${uniqueId}", "proxyHeader": "NONE", - "service": "projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}" + "service": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}" } 200 OK @@ -624,8 +631,10 @@ X-Xss-Protection: 0 --- -GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}?alt=json&prettyPrint=false -User-Agent: google-api-go-client/0.5 Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID} +Content-Type: application/json +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&operation=${operationID} 200 OK Cache-Control: private @@ -656,9 +665,10 @@ X-Xss-Protection: 0 --- -GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy2-${uniqueId}?alt=json +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy2-${uniqueId} Content-Type: application/json -User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&target_tcp_proxy=computetargettcpproxy2-${uniqueId} 200 OK Cache-Control: private @@ -679,7 +689,7 @@ X-Xss-Protection: 0 "name": "computetargettcpproxy2-${uniqueId}", "proxyHeader": "NONE", "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy2-${uniqueId}", - "service": "projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}" + "service": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}" } --- @@ -1137,9 +1147,10 @@ X-Xss-Protection: 0 --- -GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy2-${uniqueId}?alt=json +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy2-${uniqueId} Content-Type: application/json -User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&target_tcp_proxy=computetargettcpproxy2-${uniqueId} 200 OK Cache-Control: private @@ -1160,14 +1171,15 @@ X-Xss-Protection: 0 "name": "computetargettcpproxy2-${uniqueId}", "proxyHeader": "NONE", "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy2-${uniqueId}", - "service": "projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}" + "service": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}" } --- -DELETE https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy2-${uniqueId}?alt=json +DELETE https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy2-${uniqueId} Content-Type: application/json -User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&target_tcp_proxy=computetargettcpproxy2-${uniqueId} 200 OK Cache-Control: private @@ -1197,8 +1209,10 @@ X-Xss-Protection: 0 --- -GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}?alt=json&prettyPrint=false -User-Agent: google-api-go-client/0.5 Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID} +Content-Type: application/json +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&operation=${operationID} 200 OK Cache-Control: private @@ -1229,9 +1243,10 @@ X-Xss-Protection: 0 --- -GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}?alt=json +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId} Content-Type: application/json -User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&target_tcp_proxy=computetargettcpproxy-${uniqueId} 200 OK Cache-Control: private @@ -1252,14 +1267,15 @@ X-Xss-Protection: 0 "name": "computetargettcpproxy-${uniqueId}", "proxyHeader": "NONE", "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}", - "service": "projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}" + "service": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}" } --- -DELETE https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}?alt=json +DELETE https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId} Content-Type: application/json -User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&target_tcp_proxy=computetargettcpproxy-${uniqueId} 200 OK Cache-Control: private @@ -1289,8 +1305,10 @@ X-Xss-Protection: 0 --- -GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}?alt=json&prettyPrint=false -User-Agent: google-api-go-client/0.5 Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID} +Content-Type: application/json +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&operation=${operationID} 200 OK Cache-Control: private diff --git a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globaltargettcpproxy/_generated_object_globaltargettcpproxy.golden.yaml b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globaltargettcpproxy/_generated_object_globaltargettcpproxy.golden.yaml index 25f407780d..79b503368e 100644 --- a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globaltargettcpproxy/_generated_object_globaltargettcpproxy.golden.yaml +++ b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globaltargettcpproxy/_generated_object_globaltargettcpproxy.golden.yaml @@ -4,11 +4,10 @@ metadata: annotations: cnrm.cloud.google.com/management-conflict-prevention-policy: none cnrm.cloud.google.com/project-id: ${projectId} - cnrm.cloud.google.com/state-into-spec: absent finalizers: - cnrm.cloud.google.com/finalizer - cnrm.cloud.google.com/deletion-defender - generation: 3 + generation: 2 labels: cnrm-test: "true" name: computetargettcpproxy-${uniqueId} @@ -17,7 +16,6 @@ spec: backendServiceRef: name: computebackendservice-${uniqueId} proxyHeader: PROXY_V1 - resourceID: computetargettcpproxy-${uniqueId} status: conditions: - lastTransitionTime: "1970-01-01T00:00:00Z" @@ -26,6 +24,7 @@ status: status: "True" type: Ready creationTimestamp: "1970-01-01T00:00:00Z" - observedGeneration: 3 + externalRef: projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId} + observedGeneration: 2 proxyId: 1111111111111111 selfLink: https://www.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId} diff --git a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globaltargettcpproxy/_http.log b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globaltargettcpproxy/_http.log index 71b85befe4..69e1770da8 100644 --- a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globaltargettcpproxy/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computetargettcpproxy/globaltargettcpproxy/_http.log @@ -218,9 +218,10 @@ X-Xss-Protection: 0 --- -GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}?alt=json +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId} Content-Type: application/json -User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&target_tcp_proxy=computetargettcpproxy-${uniqueId} 404 Not Found Cache-Control: private @@ -249,14 +250,15 @@ X-Xss-Protection: 0 --- -POST https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies?alt=json +POST https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies Content-Type: application/json -User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId} { "name": "computetargettcpproxy-${uniqueId}", "proxyHeader": "NONE", - "service": "projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}" + "service": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}" } 200 OK @@ -287,8 +289,10 @@ X-Xss-Protection: 0 --- -GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}?alt=json&prettyPrint=false -User-Agent: google-api-go-client/0.5 Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID} +Content-Type: application/json +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&operation=${operationID} 200 OK Cache-Control: private @@ -319,9 +323,10 @@ X-Xss-Protection: 0 --- -GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}?alt=json +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId} Content-Type: application/json -User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&target_tcp_proxy=computetargettcpproxy-${uniqueId} 200 OK Cache-Control: private @@ -341,14 +346,15 @@ X-Xss-Protection: 0 "name": "computetargettcpproxy-${uniqueId}", "proxyHeader": "NONE", "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}", - "service": "projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}" + "service": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}" } --- -POST https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}/setProxyHeader?alt=json +POST https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}/setProxyHeader Content-Type: application/json -User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&target_tcp_proxy=computetargettcpproxy-${uniqueId} { "proxyHeader": "PROXY_V1" @@ -382,8 +388,10 @@ X-Xss-Protection: 0 --- -GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}?alt=json&prettyPrint=false -User-Agent: google-api-go-client/0.5 Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID} +Content-Type: application/json +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&operation=${operationID} 200 OK Cache-Control: private @@ -414,9 +422,10 @@ X-Xss-Protection: 0 --- -GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}?alt=json +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId} Content-Type: application/json -User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&target_tcp_proxy=computetargettcpproxy-${uniqueId} 200 OK Cache-Control: private @@ -436,14 +445,15 @@ X-Xss-Protection: 0 "name": "computetargettcpproxy-${uniqueId}", "proxyHeader": "PROXY_V1", "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}", - "service": "projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}" + "service": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/backendServices/computebackendservice-${uniqueId}" } --- -DELETE https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId}?alt=json +DELETE https://compute.googleapis.com/compute/v1/projects/${projectId}/global/targetTcpProxies/computetargettcpproxy-${uniqueId} Content-Type: application/json -User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&target_tcp_proxy=computetargettcpproxy-${uniqueId} 200 OK Cache-Control: private @@ -473,8 +483,10 @@ X-Xss-Protection: 0 --- -GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}?alt=json&prettyPrint=false -User-Agent: google-api-go-client/0.5 Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager +GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID} +Content-Type: application/json +User-Agent: kcc/controller-manager +x-goog-request-params: project=${projectId}&operation=${operationID} 200 OK Cache-Control: private