From ff58381afcaa3bd87d0893f44c5a302cdf0e164c Mon Sep 17 00:00:00 2001 From: Gemma Hou Date: Wed, 18 Sep 2024 00:40:12 +0000 Subject: [PATCH] normalize IPAddress field in golden logs --- .../globalcomputeforwardingrule/_http.log | 8 ++++---- .../globalcomputeforwardingrulefull/_http.log | 8 ++++---- tests/e2e/unified_test.go | 3 +++ 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computeforwardingrule/globalcomputeforwardingrule/_http.log b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computeforwardingrule/globalcomputeforwardingrule/_http.log index 96dc7556e9..d26ba0eda4 100644 --- a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computeforwardingrule/globalcomputeforwardingrule/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computeforwardingrule/globalcomputeforwardingrule/_http.log @@ -747,7 +747,7 @@ User-Agent: kcc/controller-manager x-goog-request-params: project=${projectId} { - "IPAddress": "0.0.0.0", + "IPAddress": "8.8.8.8", "description": "A global forwarding rule", "labels": { "cnrm-test": "true", @@ -840,7 +840,7 @@ X-Frame-Options: SAMEORIGIN X-Xss-Protection: 0 { - "IPAddress": "0.0.0.0", + "IPAddress": "8.8.8.8", "IPProtocol": "TCP", "creationTimestamp": "2024-04-01T12:34:56.123456Z", "description": "A global forwarding rule", @@ -919,7 +919,7 @@ X-Frame-Options: SAMEORIGIN X-Xss-Protection: 0 { - "IPAddress": "0.0.0.0", + "IPAddress": "8.8.8.8", "IPProtocol": "TCP", "creationTimestamp": "2024-04-01T12:34:56.123456Z", "description": "A global forwarding rule", @@ -1031,7 +1031,7 @@ X-Frame-Options: SAMEORIGIN X-Xss-Protection: 0 { - "IPAddress": "0.0.0.0", + "IPAddress": "8.8.8.8", "IPProtocol": "TCP", "creationTimestamp": "2024-04-01T12:34:56.123456Z", "description": "A global forwarding rule", diff --git a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computeforwardingrule/globalcomputeforwardingrulefull/_http.log b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computeforwardingrule/globalcomputeforwardingrulefull/_http.log index 8708236ffb..9bb5e1ea37 100644 --- a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computeforwardingrule/globalcomputeforwardingrulefull/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computeforwardingrule/globalcomputeforwardingrulefull/_http.log @@ -747,7 +747,7 @@ User-Agent: kcc/controller-manager x-goog-request-params: project=${projectId} { - "IPAddress": "0.0.0.0", + "IPAddress": "8.8.8.8", "IPProtocol": "TCP", "description": "A global forwarding rule", "ipVersion": "IPV4", @@ -854,7 +854,7 @@ X-Frame-Options: SAMEORIGIN X-Xss-Protection: 0 { - "IPAddress": "0.0.0.0", + "IPAddress": "8.8.8.8", "IPProtocol": "TCP", "creationTimestamp": "2024-04-01T12:34:56.123456Z", "description": "A global forwarding rule", @@ -945,7 +945,7 @@ X-Frame-Options: SAMEORIGIN X-Xss-Protection: 0 { - "IPAddress": "0.0.0.0", + "IPAddress": "8.8.8.8", "IPProtocol": "TCP", "creationTimestamp": "2024-04-01T12:34:56.123456Z", "description": "A global forwarding rule", @@ -1112,7 +1112,7 @@ X-Frame-Options: SAMEORIGIN X-Xss-Protection: 0 { - "IPAddress": "0.0.0.0", + "IPAddress": "8.8.8.8", "IPProtocol": "TCP", "creationTimestamp": "2024-04-01T12:34:56.123456Z", "description": "A global forwarding rule", diff --git a/tests/e2e/unified_test.go b/tests/e2e/unified_test.go index f17972f2d5..93dbdf9a22 100644 --- a/tests/e2e/unified_test.go +++ b/tests/e2e/unified_test.go @@ -527,6 +527,9 @@ func runScenario(ctx context.Context, t *testing.T, testPause bool, fixture reso addReplacement("natIP", "192.0.0.10") addReplacement("labelFingerprint", "abcdef0123A=") addReplacement("fingerprint", "abcdef0123A=") + // Matches the mock ip address of Compute forwarding rule + addReplacement("IPAddress", "8.8.8.8") + // Extract resource targetID numbers from compute operations for _, event := range events { body := event.Response.ParseBody()