From bc1c37f689085171dffa3a115b149e0b0898964a Mon Sep 17 00:00:00 2001 From: Yuwen Ma Date: Thu, 20 Jun 2024 01:22:47 +0000 Subject: [PATCH 1/8] turn on the fixture check on golden log --- scripts/github-actions/tests-e2e-fixtures | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/github-actions/tests-e2e-fixtures b/scripts/github-actions/tests-e2e-fixtures index 067d668ebc..1a9e7575d1 100755 --- a/scripts/github-actions/tests-e2e-fixtures +++ b/scripts/github-actions/tests-e2e-fixtures @@ -23,12 +23,14 @@ cd ${REPO_ROOT}/ echo "Downloading envtest assets..." export KUBEBUILDER_ASSETS=$(go run sigs.k8s.io/controller-runtime/tools/setup-envtest@latest use -p path) +# Transient controller can only choose one controller type (Direct vs TF/DCL) to check the golden log. +export KCC_USE_DIRECT_RECONCILERS=MonitoringDashboard echo "Running fixtures in tests/e2e..." RUN_E2E=1 \ -# GOLDEN_OBJECT_CHECKS=1 \ -# GOLDEN_REQUEST_CHECKS=1 \ +GOLDEN_OBJECT_CHECKS=1 \ +GOLDEN_REQUEST_CHECKS=1 \ E2E_KUBE_TARGET=envtest \ E2E_GCP_TARGET=mock \ go test -test.count=1 -timeout 3600s -v ./tests/e2e -run TestAllInSeries/fixtures \ No newline at end of file From 54c26127b47a2e11abca08af723c480f74a69ef0 Mon Sep 17 00:00:00 2001 From: Yuwen Ma Date: Thu, 20 Jun 2024 18:22:39 +0000 Subject: [PATCH 2/8] update monitoringdashboard; change direct to scenario test --- .github/workflows/presubmit.yaml | 6 +- ...bject_monitoringdashboardbasic.golden.yaml | 1 - .../monitoringdashboardbasic/_http.log | 92 +++++++------------ ...object_monitoringdashboardrefs.golden.yaml | 1 - .../monitoringdashboardrefs/_http.log | 92 +++++++------------ scripts/github-actions/tests-e2e-direct.sh | 56 ----------- scripts/github-actions/tests-e2e-scenarios.sh | 29 ++++++ 7 files changed, 102 insertions(+), 175 deletions(-) delete mode 100755 scripts/github-actions/tests-e2e-direct.sh create mode 100755 scripts/github-actions/tests-e2e-scenarios.sh diff --git a/.github/workflows/presubmit.yaml b/.github/workflows/presubmit.yaml index 8603824984..98f7ccafe9 100644 --- a/.github/workflows/presubmit.yaml +++ b/.github/workflows/presubmit.yaml @@ -112,7 +112,7 @@ jobs: - name: "Run pause tests" run: | ./scripts/github-actions/ga-pause-test.sh - direct-tests: + scenarios-tests: runs-on: ubuntu-22.04 timeout-minutes: 60 steps: @@ -120,9 +120,9 @@ jobs: - uses: actions/setup-go@v4 with: go-version-file: 'go.mod' - - name: "run tests-e2e-direct" + - name: "run tests-e2e-scenarios" run: | - ./scripts/github-actions/tests-e2e-direct.sh + ./scripts/github-actions/tests-e2e-scenarios.sh tests-e2e-fixtures-vcr: runs-on: ubuntu-22.04 timeout-minutes: 60 diff --git a/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardbasic/_generated_object_monitoringdashboardbasic.golden.yaml b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardbasic/_generated_object_monitoringdashboardbasic.golden.yaml index 138280de99..81e1f8d473 100644 --- a/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardbasic/_generated_object_monitoringdashboardbasic.golden.yaml +++ b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardbasic/_generated_object_monitoringdashboardbasic.golden.yaml @@ -3,7 +3,6 @@ kind: MonitoringDashboard metadata: annotations: cnrm.cloud.google.com/management-conflict-prevention-policy: none - cnrm.cloud.google.com/state-into-spec: merge finalizers: - cnrm.cloud.google.com/finalizer - cnrm.cloud.google.com/deletion-defender diff --git a/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardbasic/_http.log b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardbasic/_http.log index caf1a0e4cb..a81a02ff3a 100644 --- a/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardbasic/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardbasic/_http.log @@ -1,6 +1,7 @@ -GET https://monitoring.googleapis.com/v1/projects/${projectId}/dashboards/monitoringdashboard-${uniqueId}?alt=json +GET https://monitoring.googleapis.com/v1/projects/${projectId}/dashboards/monitoringdashboard-${uniqueId}?%24alt=json%3Benum-encoding%3Dint Content-Type: application/json -User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 +User-Agent: kcc/controller-manager +x-goog-request-params: name=projects%2F${projectId}%2Fdashboards%2Fmonitoringdashboard-${uniqueId} 404 Not Found Cache-Control: private @@ -23,26 +24,27 @@ X-Xss-Protection: 0 --- -POST https://monitoring.googleapis.com/v1/projects/${projectId}/dashboards?alt=json +POST https://monitoring.googleapis.com/v1/projects/${projectId}/dashboards?%24alt=json%3Benum-encoding%3Dint Content-Type: application/json -User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 +User-Agent: kcc/controller-manager +x-goog-request-params: parent=projects%2F${projectId} { "columnLayout": { "columns": [ { - "weight": 2, + "weight": "2", "widgets": [ { "title": "Widget 1", "xyChart": { "dataSets": [ { - "plotType": "LINE", + "plotType": 1, "timeSeriesQuery": { "timeSeriesFilter": { "aggregation": { - "perSeriesAligner": "ALIGN_RATE" + "perSeriesAligner": 2 }, "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"" }, @@ -53,14 +55,14 @@ User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 "timeshiftDuration": "0s", "yAxis": { "label": "y1Axis", - "scale": "LINEAR" + "scale": 1 } } }, { "text": { "content": "Widget 2", - "format": "MARKDOWN" + "format": 1 } }, { @@ -68,11 +70,11 @@ User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 "xyChart": { "dataSets": [ { - "plotType": "STACKED_BAR", + "plotType": 3, "timeSeriesQuery": { "timeSeriesFilter": { "aggregation": { - "perSeriesAligner": "ALIGN_RATE" + "perSeriesAligner": 2 }, "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"" }, @@ -83,7 +85,7 @@ User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 "timeshiftDuration": "0s", "yAxis": { "label": "y1Axis", - "scale": "LINEAR" + "scale": 1 } } }, @@ -198,9 +200,10 @@ X-Xss-Protection: 0 --- -GET https://monitoring.googleapis.com/v1/projects/${projectId}/dashboards/monitoringdashboard-${uniqueId}?alt=json +GET https://monitoring.googleapis.com/v1/projects/${projectId}/dashboards/monitoringdashboard-${uniqueId}?%24alt=json%3Benum-encoding%3Dint Content-Type: application/json -User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 +User-Agent: kcc/controller-manager +x-goog-request-params: name=projects%2F${projectId}%2Fdashboards%2Fmonitoringdashboard-${uniqueId} 200 OK Cache-Control: private @@ -296,26 +299,27 @@ X-Xss-Protection: 0 --- -PATCH https://monitoring.googleapis.com/v1/projects/${projectId}/dashboards/monitoringdashboard-${uniqueId}?alt=json +PATCH https://monitoring.googleapis.com/v1/projects/${projectId}/dashboards/monitoringdashboard-${uniqueId}?%24alt=json%3Benum-encoding%3Dint Content-Type: application/json -User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 +User-Agent: kcc/controller-manager +x-goog-request-params: dashboard.name=projects%2F${projectId}%2Fdashboards%2Fmonitoringdashboard-${uniqueId} { "columnLayout": { "columns": [ { - "weight": 2, + "weight": "2", "widgets": [ { "title": "Widget 1", "xyChart": { "dataSets": [ { - "plotType": "LINE", + "plotType": 1, "timeSeriesQuery": { "timeSeriesFilter": { "aggregation": { - "perSeriesAligner": "ALIGN_RATE" + "perSeriesAligner": 2 }, "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"" }, @@ -323,18 +327,17 @@ User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 } } ], - "thresholds": [], "timeshiftDuration": "0s", "yAxis": { "label": "y1Axis", - "scale": "LINEAR" + "scale": 1 } } }, { "text": { "content": "Widget 2", - "format": "MARKDOWN" + "format": 1 } }, { @@ -342,11 +345,11 @@ User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 "xyChart": { "dataSets": [ { - "plotType": "STACKED_BAR", + "plotType": 3, "timeSeriesQuery": { "timeSeriesFilter": { "aggregation": { - "perSeriesAligner": "ALIGN_RATE" + "perSeriesAligner": 2 }, "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"" }, @@ -354,11 +357,10 @@ User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 } } ], - "thresholds": [], "timeshiftDuration": "0s", "yAxis": { "label": "y1Axis", - "scale": "LINEAR" + "scale": 1 } } }, @@ -373,7 +375,6 @@ User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 ] }, "displayName": "monitoringdashboard-updated", - "etag": "abcdef0123A=", "name": "projects/${projectId}/dashboards/monitoringdashboard-${uniqueId}" } @@ -468,9 +469,10 @@ X-Xss-Protection: 0 --- -GET https://monitoring.googleapis.com/v1/projects/${projectId}/dashboards/monitoringdashboard-${uniqueId}?alt=json +GET https://monitoring.googleapis.com/v1/projects/${projectId}/dashboards/monitoringdashboard-${uniqueId}?%24alt=json%3Benum-encoding%3Dint Content-Type: application/json -User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 +User-Agent: kcc/controller-manager +x-goog-request-params: name=projects%2F${projectId}%2Fdashboards%2Fmonitoringdashboard-${uniqueId} 200 OK Cache-Control: private @@ -563,9 +565,10 @@ X-Xss-Protection: 0 --- -DELETE https://monitoring.googleapis.com/v1/projects/${projectId}/dashboards/monitoringdashboard-${uniqueId}?alt=json +DELETE https://monitoring.googleapis.com/v1/projects/${projectId}/dashboards/monitoringdashboard-${uniqueId}?%24alt=json%3Benum-encoding%3Dint Content-Type: application/json -User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 +User-Agent: kcc/controller-manager +x-goog-request-params: name=projects%2F${projectId}%2Fdashboards%2Fmonitoringdashboard-${uniqueId} 200 OK Cache-Control: private @@ -578,29 +581,4 @@ X-Content-Type-Options: nosniff X-Frame-Options: SAMEORIGIN X-Xss-Protection: 0 -{} - ---- - -GET https://monitoring.googleapis.com/v1/projects/${projectId}/dashboards/monitoringdashboard-${uniqueId}?alt=json -Content-Type: application/json -User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 - -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, - "message": "Requested entity was not found.", - "status": "NOT_FOUND" - } -} \ No newline at end of file +{} \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardrefs/_generated_object_monitoringdashboardrefs.golden.yaml b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardrefs/_generated_object_monitoringdashboardrefs.golden.yaml index 61ef98a721..f3ebe5fcc7 100644 --- a/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardrefs/_generated_object_monitoringdashboardrefs.golden.yaml +++ b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardrefs/_generated_object_monitoringdashboardrefs.golden.yaml @@ -3,7 +3,6 @@ kind: MonitoringDashboard metadata: annotations: cnrm.cloud.google.com/management-conflict-prevention-policy: none - cnrm.cloud.google.com/state-into-spec: merge finalizers: - cnrm.cloud.google.com/finalizer - cnrm.cloud.google.com/deletion-defender diff --git a/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardrefs/_http.log b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardrefs/_http.log index ea27a856ec..7d05004891 100644 --- a/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardrefs/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardrefs/_http.log @@ -150,9 +150,10 @@ X-Xss-Protection: 0 --- -GET https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}?alt=json +GET https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}?%24alt=json%3Benum-encoding%3Dint Content-Type: application/json -User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 +User-Agent: kcc/controller-manager +x-goog-request-params: name=projects%2Fother${uniqueId}%2Fdashboards%2Fmonitoringdashboard-${uniqueId} 404 Not Found Cache-Control: private @@ -175,26 +176,27 @@ X-Xss-Protection: 0 --- -POST https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards?alt=json +POST https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards?%24alt=json%3Benum-encoding%3Dint Content-Type: application/json -User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 +User-Agent: kcc/controller-manager +x-goog-request-params: parent=projects%2Fother${uniqueId} { "columnLayout": { "columns": [ { - "weight": 2, + "weight": "2", "widgets": [ { "title": "Widget 1", "xyChart": { "dataSets": [ { - "plotType": "LINE", + "plotType": 1, "timeSeriesQuery": { "timeSeriesFilter": { "aggregation": { - "perSeriesAligner": "ALIGN_RATE" + "perSeriesAligner": 2 }, "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"" }, @@ -205,14 +207,14 @@ User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 "timeshiftDuration": "0s", "yAxis": { "label": "y1Axis", - "scale": "LINEAR" + "scale": 1 } } }, { "text": { "content": "Widget 2", - "format": "MARKDOWN" + "format": 1 } }, { @@ -220,11 +222,11 @@ User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 "xyChart": { "dataSets": [ { - "plotType": "STACKED_BAR", + "plotType": 3, "timeSeriesQuery": { "timeSeriesFilter": { "aggregation": { - "perSeriesAligner": "ALIGN_RATE" + "perSeriesAligner": 2 }, "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"" }, @@ -235,7 +237,7 @@ User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 "timeshiftDuration": "0s", "yAxis": { "label": "y1Axis", - "scale": "LINEAR" + "scale": 1 } } }, @@ -350,9 +352,10 @@ X-Xss-Protection: 0 --- -GET https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}?alt=json +GET https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}?%24alt=json%3Benum-encoding%3Dint Content-Type: application/json -User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 +User-Agent: kcc/controller-manager +x-goog-request-params: name=projects%2Fother${uniqueId}%2Fdashboards%2Fmonitoringdashboard-${uniqueId} 200 OK Cache-Control: private @@ -448,26 +451,27 @@ X-Xss-Protection: 0 --- -PATCH https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}?alt=json +PATCH https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}?%24alt=json%3Benum-encoding%3Dint Content-Type: application/json -User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 +User-Agent: kcc/controller-manager +x-goog-request-params: dashboard.name=projects%2Fother${uniqueId}%2Fdashboards%2Fmonitoringdashboard-${uniqueId} { "columnLayout": { "columns": [ { - "weight": 2, + "weight": "2", "widgets": [ { "title": "Widget 1", "xyChart": { "dataSets": [ { - "plotType": "LINE", + "plotType": 1, "timeSeriesQuery": { "timeSeriesFilter": { "aggregation": { - "perSeriesAligner": "ALIGN_RATE" + "perSeriesAligner": 2 }, "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"" }, @@ -475,18 +479,17 @@ User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 } } ], - "thresholds": [], "timeshiftDuration": "0s", "yAxis": { "label": "y1Axis", - "scale": "LINEAR" + "scale": 1 } } }, { "text": { "content": "Widget 2", - "format": "MARKDOWN" + "format": 1 } }, { @@ -494,11 +497,11 @@ User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 "xyChart": { "dataSets": [ { - "plotType": "STACKED_BAR", + "plotType": 3, "timeSeriesQuery": { "timeSeriesFilter": { "aggregation": { - "perSeriesAligner": "ALIGN_RATE" + "perSeriesAligner": 2 }, "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"" }, @@ -506,11 +509,10 @@ User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 } } ], - "thresholds": [], "timeshiftDuration": "0s", "yAxis": { "label": "y1Axis", - "scale": "LINEAR" + "scale": 1 } } }, @@ -525,8 +527,7 @@ User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 ] }, "displayName": "monitoringdashboard updated", - "etag": "abcdef0123A=", - "name": "projects/projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}" + "name": "projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}" } 200 OK @@ -620,9 +621,10 @@ X-Xss-Protection: 0 --- -GET https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}?alt=json +GET https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}?%24alt=json%3Benum-encoding%3Dint Content-Type: application/json -User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 +User-Agent: kcc/controller-manager +x-goog-request-params: name=projects%2Fother${uniqueId}%2Fdashboards%2Fmonitoringdashboard-${uniqueId} 200 OK Cache-Control: private @@ -715,9 +717,10 @@ X-Xss-Protection: 0 --- -DELETE https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}?alt=json +DELETE https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}?%24alt=json%3Benum-encoding%3Dint Content-Type: application/json -User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 +User-Agent: kcc/controller-manager +x-goog-request-params: name=projects%2Fother${uniqueId}%2Fdashboards%2Fmonitoringdashboard-${uniqueId} 200 OK Cache-Control: private @@ -734,31 +737,6 @@ X-Xss-Protection: 0 --- -GET https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}?alt=json -Content-Type: application/json -User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 - -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, - "message": "Requested entity was not found.", - "status": "NOT_FOUND" - } -} - ---- - GET https://cloudresourcemanager.googleapis.com/v1/projects/other${uniqueId}?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 diff --git a/scripts/github-actions/tests-e2e-direct.sh b/scripts/github-actions/tests-e2e-direct.sh deleted file mode 100755 index 62c7743483..0000000000 --- a/scripts/github-actions/tests-e2e-direct.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash -# 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. - -set -o errexit -set -o nounset -set -o pipefail - -REPO_ROOT="$(git rev-parse --show-toplevel)" - -cd ${REPO_ROOT}/ - -echo "Downloading envtest assets..." -export KUBEBUILDER_ASSETS=$(go run sigs.k8s.io/controller-runtime/tools/setup-envtest@latest use -p path) - -KCC_USE_DIRECT_RECONCILERS=MonitoringDashboard - -echo "Running e2e tests samples for LoggingLogMetric direct reconciliation..." -GOLDEN_OBJECT_CHECKS=1 \ -GOLDEN_REQUEST_CHECKS=1 \ -E2E_KUBE_TARGET=envtest RUN_E2E=1 E2E_GCP_TARGET=mock \ - go test -test.count=1 -timeout 600s -v ./tests/e2e -run 'TestAllInSeries/samples/linear-log-metric|TestAllInSeries/samples/exponential-log-metric|TestAllInSeries/samples/int-log-metric|TestAllInSeries/samples/explicit-log-metric' - -echo "Running e2e tests fixtures for LoggingLogMetric direct reconciliation..." -GOLDEN_OBJECT_CHECKS=1 \ -GOLDEN_REQUEST_CHECKS=1 \ -E2E_KUBE_TARGET=envtest RUN_E2E=1 E2E_GCP_TARGET=mock \ - go test -test.count=1 -timeout 600s -v ./tests/e2e -run 'TestAllInSeries/fixtures/explicitlogmetric|TestAllInSeries/fixtures/exponentiallogmetric|TestAllInSeries/fixtures/linearlogmetric|TestAllInSeries/fixtures/logbucketmetric|TestAllInSeries/fixtures/monitoringdashboard' - -echo "Running e2e tests fixtures for MonitoringDashboard direct reconciliation..." -GOLDEN_OBJECT_CHECKS=1 \ -GOLDEN_REQUEST_CHECKS=1 \ -E2E_KUBE_TARGET=envtest RUN_E2E=1 E2E_GCP_TARGET=mock \ - go test -test.count=1 -timeout 600s -v ./tests/e2e -run 'TestAllInSeries/fixtures/monitoringdashboard' - -echo "Running scenarios tests for LoggingLogMetric direct reconciliation..." -GOLDEN_REQUEST_CHECKS=1 E2E_KUBE_TARGET=envtest E2E_GCP_TARGET=mock RUN_E2E=1 \ - go test -test.count=1 -timeout 360s -v ./tests/e2e -run TestE2EScript/scenarios/fields - - -echo "Running e2e tests fixtures for CloudBuildWorkerPool direct reconciliation..." -GOLDEN_OBJECT_CHECKS=1 \ -GOLDEN_REQUEST_CHECKS=1 \ -E2E_KUBE_TARGET=envtest RUN_E2E=1 E2E_GCP_TARGET=mock \ - go test -test.count=1 -timeout 600s -v ./tests/e2e -run 'TestAllInSeries/fixtures/cloudbuildworkerpool' \ No newline at end of file diff --git a/scripts/github-actions/tests-e2e-scenarios.sh b/scripts/github-actions/tests-e2e-scenarios.sh new file mode 100755 index 0000000000..1a56e045e4 --- /dev/null +++ b/scripts/github-actions/tests-e2e-scenarios.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# 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. + +set -o errexit +set -o nounset +set -o pipefail + +REPO_ROOT="$(git rev-parse --show-toplevel)" + +cd ${REPO_ROOT}/ + +echo "Downloading envtest assets..." +export KUBEBUILDER_ASSETS=$(go run sigs.k8s.io/controller-runtime/tools/setup-envtest@latest use -p path) + +echo "Running scenarios tests for LoggingLogMetric direct reconciliation..." +GOLDEN_REQUEST_CHECKS=1 E2E_KUBE_TARGET=envtest E2E_GCP_TARGET=mock RUN_E2E=1 \ + go test -test.count=1 -timeout 360s -v ./tests/e2e -run TestE2EScript/scenarios/fields From 36b2fc8f2d6cd8d9a6eaeaeb492aaf1adb12b5ca Mon Sep 17 00:00:00 2001 From: Yuwen Ma Date: Sat, 22 Jun 2024 15:28:34 +0000 Subject: [PATCH 3/8] fix http and golden log --- .../basicalloydbcluster/_http.log | 4 +- .../basicalloydbsecondarycluster/_http.log | 4 +- .../basicalloydbinstance/_http.log | 4 +- .../basicalloydbsecondaryinstance/_http.log | 4 +- .../fullalloydbinstance/_http.log | 4 +- .../readalloydbinstance/_http.log | 4 +- .../zonalalloydbinstance/_http.log | 4 +- .../v1alpha1/cloudidsendpoint/_http.log | 4 +- .../globalcomputeaddress/_http.log | 4 +- .../regionalcomputeaddress/_http.log | 6 +- .../compute/v1beta1/computenetwork/_http.log | 6 +- .../v1beta1/computesubnetwork/_http.log | 10 +- .../logmetricprojectref/_http.log | 24 ----- ...bject_monitoringdashboardbasic.golden.yaml | 1 + .../monitoringdashboardbasic/_http.log | 92 ++++++++++++------- ...object_monitoringdashboardrefs.golden.yaml | 1 + .../monitoringdashboardrefs/_http.log | 92 ++++++++++++------- .../servicenetworkingconnection/_http.log | 4 +- .../sqlinstance/mysqlinstance/_http.log | 6 +- .../sqlinstance/postgresinstance/_http.log | 10 +- .../sqlinstance/sqlserverinstance/_http.log | 4 +- .../basic/sql/v1beta1/sqluser/_http.log | 10 +- .../vertexaiendpointnetwork/_http.log | 4 +- .../sqlinstanceref/_http.log | 6 +- tests/e2e/normalize.go | 26 ++++-- 25 files changed, 185 insertions(+), 153 deletions(-) diff --git a/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbcluster/basicalloydbcluster/_http.log b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbcluster/basicalloydbcluster/_http.log index 443ec5af72..7b15aa6bd8 100644 --- a/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbcluster/basicalloydbcluster/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbcluster/basicalloydbcluster/_http.log @@ -54,7 +54,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "${networkID}", + "targetId": "7780111738275460050", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/${networkID}", "user": "user@example.com" } @@ -117,7 +117,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "${networkID}", + "targetId": "7780111738275460050", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/${networkID}", "user": "user@example.com" } diff --git a/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbcluster/basicalloydbsecondarycluster/_http.log b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbcluster/basicalloydbsecondarycluster/_http.log index 2b29b09b6a..f34014777d 100644 --- a/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbcluster/basicalloydbsecondarycluster/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbcluster/basicalloydbsecondarycluster/_http.log @@ -60,7 +60,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "${networkID}", + "targetId": "7780111738275460050", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/computenetwork-${uniqueId}", "user": "user@example.com" } @@ -1165,7 +1165,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "${networkID}", + "targetId": "7780111738275460050", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/computenetwork-${uniqueId}", "user": "user@example.com" } \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/basicalloydbinstance/_http.log b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/basicalloydbinstance/_http.log index 6fd60a2d7b..7312af8c57 100644 --- a/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/basicalloydbinstance/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/basicalloydbinstance/_http.log @@ -60,7 +60,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "${networkID}", + "targetId": "7780111738275460050", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/computenetwork-${uniqueId}", "user": "user@example.com" } @@ -1002,7 +1002,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "${networkID}", + "targetId": "7780111738275460050", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/computenetwork-${uniqueId}", "user": "user@example.com" } \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/basicalloydbsecondaryinstance/_http.log b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/basicalloydbsecondaryinstance/_http.log index da8a1deae2..16763ce6cc 100644 --- a/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/basicalloydbsecondaryinstance/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/basicalloydbsecondaryinstance/_http.log @@ -60,7 +60,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "${networkID}", + "targetId": "7780111738275460050", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/computenetwork-${uniqueId}", "user": "user@example.com" } @@ -1288,7 +1288,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "${networkID}", + "targetId": "7780111738275460050", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/computenetwork-${uniqueId}", "user": "user@example.com" } \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/fullalloydbinstance/_http.log b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/fullalloydbinstance/_http.log index 40f209d5a7..07c5d9de5b 100644 --- a/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/fullalloydbinstance/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/fullalloydbinstance/_http.log @@ -60,7 +60,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "${networkID}", + "targetId": "7780111738275460050", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/computenetwork-${uniqueId}", "user": "user@example.com" } @@ -993,7 +993,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "${networkID}", + "targetId": "7780111738275460050", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/computenetwork-${uniqueId}", "user": "user@example.com" } \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/readalloydbinstance/_http.log b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/readalloydbinstance/_http.log index a59e42597c..88e705cd2e 100644 --- a/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/readalloydbinstance/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/readalloydbinstance/_http.log @@ -60,7 +60,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "${networkID}", + "targetId": "7780111738275460050", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/computenetwork${uniqueId}", "user": "user@example.com" } @@ -1146,7 +1146,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "${networkID}", + "targetId": "7780111738275460050", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/computenetwork${uniqueId}", "user": "user@example.com" } \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/zonalalloydbinstance/_http.log b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/zonalalloydbinstance/_http.log index 2adb166aa1..42889815b5 100644 --- a/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/zonalalloydbinstance/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/zonalalloydbinstance/_http.log @@ -60,7 +60,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "${networkID}", + "targetId": "7780111738275460050", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/computenetwork-${uniqueId}", "user": "user@example.com" } @@ -925,7 +925,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "${networkID}", + "targetId": "7780111738275460050", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/computenetwork-${uniqueId}", "user": "user@example.com" } \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/cloudids/v1alpha1/cloudidsendpoint/_http.log b/pkg/test/resourcefixture/testdata/basic/cloudids/v1alpha1/cloudidsendpoint/_http.log index 33daa6ace0..0ece68d9f0 100644 --- a/pkg/test/resourcefixture/testdata/basic/cloudids/v1alpha1/cloudidsendpoint/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/cloudids/v1alpha1/cloudidsendpoint/_http.log @@ -60,7 +60,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "${networkID}", + "targetId": "7780111738275460050", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/computenetwork-${uniqueId}", "user": "user@example.com" } @@ -797,7 +797,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "${networkID}", + "targetId": "7780111738275460050", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/computenetwork-${uniqueId}", "user": "user@example.com" } \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computeaddress/globalcomputeaddress/_http.log b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computeaddress/globalcomputeaddress/_http.log index a37b90444f..26ca5e3554 100644 --- a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computeaddress/globalcomputeaddress/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computeaddress/globalcomputeaddress/_http.log @@ -54,7 +54,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "${networkID}", + "targetId": "7780111738275460050", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/${networkID}", "user": "user@example.com" } @@ -117,7 +117,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "${networkID}", + "targetId": "7780111738275460050", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/${networkID}", "user": "user@example.com" } diff --git a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computeaddress/regionalcomputeaddress/_http.log b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computeaddress/regionalcomputeaddress/_http.log index f73d82b50b..edb082d007 100644 --- a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computeaddress/regionalcomputeaddress/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computeaddress/regionalcomputeaddress/_http.log @@ -54,7 +54,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "${networkID}", + "targetId": "7780111738275460050", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/${subnetworkID}", "user": "user@example.com" } @@ -117,7 +117,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "${networkID}", + "targetId": "7780111738275460050", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/${subnetworkID}", "user": "user@example.com" } @@ -218,7 +218,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/regions/us-central1/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "${subnetworkNumber}", + "targetId": "7780111738275460050", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/regions/us-central1/subnetworks/${subnetworkID}", "user": "user@example.com" } diff --git a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computenetwork/_http.log b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computenetwork/_http.log index 7c60bdb0d0..54ac2f9f67 100644 --- a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computenetwork/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computenetwork/_http.log @@ -63,7 +63,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "${networkID}", + "targetId": "7780111738275460050", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/computenetwork-${uniqueId}", "user": "user@example.com" } @@ -133,7 +133,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "${networkID}", + "targetId": "7780111738275460050", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/computenetwork-${uniqueId}", "user": "user@example.com" } @@ -196,7 +196,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "${networkID}", + "targetId": "7780111738275460050", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/computenetwork-${uniqueId}", "user": "user@example.com" } \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computesubnetwork/_http.log b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computesubnetwork/_http.log index c1543b505c..265c1c8fce 100644 --- a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computesubnetwork/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computesubnetwork/_http.log @@ -63,7 +63,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "${networkID}", + "targetId": "7780111738275460050", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/computenetwork-${uniqueId}", "user": "user@example.com" } @@ -168,7 +168,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/regions/us-central1/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "${subnetworkNumber}", + "targetId": "7780111738275460050", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/regions/us-central1/subnetworks/computesubnetwork-${uniqueId}", "user": "user@example.com" } @@ -243,7 +243,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/regions/us-central1/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "${subnetworkNumber}", + "targetId": "7780111738275460050", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/regions/us-central1/subnetworks/computesubnetwork-${uniqueId}", "user": "user@example.com" } @@ -314,7 +314,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/regions/us-central1/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "${subnetworkNumber}", + "targetId": "7780111738275460050", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/regions/us-central1/subnetworks/computesubnetwork-${uniqueId}", "user": "user@example.com" } @@ -377,7 +377,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "${networkID}", + "targetId": "7780111738275460050", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/computenetwork-${uniqueId}", "user": "user@example.com" } \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/logging/v1beta1/logginglogmetric/logmetricprojectref/_http.log b/pkg/test/resourcefixture/testdata/basic/logging/v1beta1/logginglogmetric/logmetricprojectref/_http.log index 7f1d06de1c..b272a8b8f0 100644 --- a/pkg/test/resourcefixture/testdata/basic/logging/v1beta1/logginglogmetric/logmetricprojectref/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/logging/v1beta1/logginglogmetric/logmetricprojectref/_http.log @@ -522,30 +522,6 @@ X-Xss-Protection: 0 --- -GET https://logging.googleapis.com/v2/projects/${projectId}/metrics/linearlogmetric-${uniqueId}?alt=json&prettyPrint=false -User-Agent: google-api-go-client/0.5 - -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, - "message": "Metric linearlogmetric-${uniqueId} does not exist.", - "status": "NOT_FOUND" - } -} - ---- - GET https://logging.googleapis.com/v2/projects/example-project-02/metrics/linearlogmetric-${uniqueId}?alt=json&prettyPrint=false User-Agent: google-api-go-client/0.5 diff --git a/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardbasic/_generated_object_monitoringdashboardbasic.golden.yaml b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardbasic/_generated_object_monitoringdashboardbasic.golden.yaml index 81e1f8d473..138280de99 100644 --- a/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardbasic/_generated_object_monitoringdashboardbasic.golden.yaml +++ b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardbasic/_generated_object_monitoringdashboardbasic.golden.yaml @@ -3,6 +3,7 @@ kind: MonitoringDashboard metadata: annotations: cnrm.cloud.google.com/management-conflict-prevention-policy: none + cnrm.cloud.google.com/state-into-spec: merge finalizers: - cnrm.cloud.google.com/finalizer - cnrm.cloud.google.com/deletion-defender diff --git a/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardbasic/_http.log b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardbasic/_http.log index a81a02ff3a..caf1a0e4cb 100644 --- a/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardbasic/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardbasic/_http.log @@ -1,7 +1,6 @@ -GET https://monitoring.googleapis.com/v1/projects/${projectId}/dashboards/monitoringdashboard-${uniqueId}?%24alt=json%3Benum-encoding%3Dint +GET https://monitoring.googleapis.com/v1/projects/${projectId}/dashboards/monitoringdashboard-${uniqueId}?alt=json Content-Type: application/json -User-Agent: kcc/controller-manager -x-goog-request-params: name=projects%2F${projectId}%2Fdashboards%2Fmonitoringdashboard-${uniqueId} +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 404 Not Found Cache-Control: private @@ -24,27 +23,26 @@ X-Xss-Protection: 0 --- -POST https://monitoring.googleapis.com/v1/projects/${projectId}/dashboards?%24alt=json%3Benum-encoding%3Dint +POST https://monitoring.googleapis.com/v1/projects/${projectId}/dashboards?alt=json Content-Type: application/json -User-Agent: kcc/controller-manager -x-goog-request-params: parent=projects%2F${projectId} +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 { "columnLayout": { "columns": [ { - "weight": "2", + "weight": 2, "widgets": [ { "title": "Widget 1", "xyChart": { "dataSets": [ { - "plotType": 1, + "plotType": "LINE", "timeSeriesQuery": { "timeSeriesFilter": { "aggregation": { - "perSeriesAligner": 2 + "perSeriesAligner": "ALIGN_RATE" }, "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"" }, @@ -55,14 +53,14 @@ x-goog-request-params: parent=projects%2F${projectId} "timeshiftDuration": "0s", "yAxis": { "label": "y1Axis", - "scale": 1 + "scale": "LINEAR" } } }, { "text": { "content": "Widget 2", - "format": 1 + "format": "MARKDOWN" } }, { @@ -70,11 +68,11 @@ x-goog-request-params: parent=projects%2F${projectId} "xyChart": { "dataSets": [ { - "plotType": 3, + "plotType": "STACKED_BAR", "timeSeriesQuery": { "timeSeriesFilter": { "aggregation": { - "perSeriesAligner": 2 + "perSeriesAligner": "ALIGN_RATE" }, "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"" }, @@ -85,7 +83,7 @@ x-goog-request-params: parent=projects%2F${projectId} "timeshiftDuration": "0s", "yAxis": { "label": "y1Axis", - "scale": 1 + "scale": "LINEAR" } } }, @@ -200,10 +198,9 @@ X-Xss-Protection: 0 --- -GET https://monitoring.googleapis.com/v1/projects/${projectId}/dashboards/monitoringdashboard-${uniqueId}?%24alt=json%3Benum-encoding%3Dint +GET https://monitoring.googleapis.com/v1/projects/${projectId}/dashboards/monitoringdashboard-${uniqueId}?alt=json Content-Type: application/json -User-Agent: kcc/controller-manager -x-goog-request-params: name=projects%2F${projectId}%2Fdashboards%2Fmonitoringdashboard-${uniqueId} +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 200 OK Cache-Control: private @@ -299,27 +296,26 @@ X-Xss-Protection: 0 --- -PATCH https://monitoring.googleapis.com/v1/projects/${projectId}/dashboards/monitoringdashboard-${uniqueId}?%24alt=json%3Benum-encoding%3Dint +PATCH https://monitoring.googleapis.com/v1/projects/${projectId}/dashboards/monitoringdashboard-${uniqueId}?alt=json Content-Type: application/json -User-Agent: kcc/controller-manager -x-goog-request-params: dashboard.name=projects%2F${projectId}%2Fdashboards%2Fmonitoringdashboard-${uniqueId} +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 { "columnLayout": { "columns": [ { - "weight": "2", + "weight": 2, "widgets": [ { "title": "Widget 1", "xyChart": { "dataSets": [ { - "plotType": 1, + "plotType": "LINE", "timeSeriesQuery": { "timeSeriesFilter": { "aggregation": { - "perSeriesAligner": 2 + "perSeriesAligner": "ALIGN_RATE" }, "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"" }, @@ -327,17 +323,18 @@ x-goog-request-params: dashboard.name=projects%2F${projectId}%2Fdashboards%2Fmon } } ], + "thresholds": [], "timeshiftDuration": "0s", "yAxis": { "label": "y1Axis", - "scale": 1 + "scale": "LINEAR" } } }, { "text": { "content": "Widget 2", - "format": 1 + "format": "MARKDOWN" } }, { @@ -345,11 +342,11 @@ x-goog-request-params: dashboard.name=projects%2F${projectId}%2Fdashboards%2Fmon "xyChart": { "dataSets": [ { - "plotType": 3, + "plotType": "STACKED_BAR", "timeSeriesQuery": { "timeSeriesFilter": { "aggregation": { - "perSeriesAligner": 2 + "perSeriesAligner": "ALIGN_RATE" }, "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"" }, @@ -357,10 +354,11 @@ x-goog-request-params: dashboard.name=projects%2F${projectId}%2Fdashboards%2Fmon } } ], + "thresholds": [], "timeshiftDuration": "0s", "yAxis": { "label": "y1Axis", - "scale": 1 + "scale": "LINEAR" } } }, @@ -375,6 +373,7 @@ x-goog-request-params: dashboard.name=projects%2F${projectId}%2Fdashboards%2Fmon ] }, "displayName": "monitoringdashboard-updated", + "etag": "abcdef0123A=", "name": "projects/${projectId}/dashboards/monitoringdashboard-${uniqueId}" } @@ -469,10 +468,9 @@ X-Xss-Protection: 0 --- -GET https://monitoring.googleapis.com/v1/projects/${projectId}/dashboards/monitoringdashboard-${uniqueId}?%24alt=json%3Benum-encoding%3Dint +GET https://monitoring.googleapis.com/v1/projects/${projectId}/dashboards/monitoringdashboard-${uniqueId}?alt=json Content-Type: application/json -User-Agent: kcc/controller-manager -x-goog-request-params: name=projects%2F${projectId}%2Fdashboards%2Fmonitoringdashboard-${uniqueId} +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 200 OK Cache-Control: private @@ -565,10 +563,9 @@ X-Xss-Protection: 0 --- -DELETE https://monitoring.googleapis.com/v1/projects/${projectId}/dashboards/monitoringdashboard-${uniqueId}?%24alt=json%3Benum-encoding%3Dint +DELETE https://monitoring.googleapis.com/v1/projects/${projectId}/dashboards/monitoringdashboard-${uniqueId}?alt=json Content-Type: application/json -User-Agent: kcc/controller-manager -x-goog-request-params: name=projects%2F${projectId}%2Fdashboards%2Fmonitoringdashboard-${uniqueId} +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 200 OK Cache-Control: private @@ -581,4 +578,29 @@ X-Content-Type-Options: nosniff X-Frame-Options: SAMEORIGIN X-Xss-Protection: 0 -{} \ No newline at end of file +{} + +--- + +GET https://monitoring.googleapis.com/v1/projects/${projectId}/dashboards/monitoringdashboard-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 + +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, + "message": "Requested entity was not found.", + "status": "NOT_FOUND" + } +} \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardrefs/_generated_object_monitoringdashboardrefs.golden.yaml b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardrefs/_generated_object_monitoringdashboardrefs.golden.yaml index f3ebe5fcc7..61ef98a721 100644 --- a/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardrefs/_generated_object_monitoringdashboardrefs.golden.yaml +++ b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardrefs/_generated_object_monitoringdashboardrefs.golden.yaml @@ -3,6 +3,7 @@ kind: MonitoringDashboard metadata: annotations: cnrm.cloud.google.com/management-conflict-prevention-policy: none + cnrm.cloud.google.com/state-into-spec: merge finalizers: - cnrm.cloud.google.com/finalizer - cnrm.cloud.google.com/deletion-defender diff --git a/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardrefs/_http.log b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardrefs/_http.log index 7d05004891..ea27a856ec 100644 --- a/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardrefs/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardrefs/_http.log @@ -150,10 +150,9 @@ X-Xss-Protection: 0 --- -GET https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}?%24alt=json%3Benum-encoding%3Dint +GET https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}?alt=json Content-Type: application/json -User-Agent: kcc/controller-manager -x-goog-request-params: name=projects%2Fother${uniqueId}%2Fdashboards%2Fmonitoringdashboard-${uniqueId} +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 404 Not Found Cache-Control: private @@ -176,27 +175,26 @@ X-Xss-Protection: 0 --- -POST https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards?%24alt=json%3Benum-encoding%3Dint +POST https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards?alt=json Content-Type: application/json -User-Agent: kcc/controller-manager -x-goog-request-params: parent=projects%2Fother${uniqueId} +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 { "columnLayout": { "columns": [ { - "weight": "2", + "weight": 2, "widgets": [ { "title": "Widget 1", "xyChart": { "dataSets": [ { - "plotType": 1, + "plotType": "LINE", "timeSeriesQuery": { "timeSeriesFilter": { "aggregation": { - "perSeriesAligner": 2 + "perSeriesAligner": "ALIGN_RATE" }, "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"" }, @@ -207,14 +205,14 @@ x-goog-request-params: parent=projects%2Fother${uniqueId} "timeshiftDuration": "0s", "yAxis": { "label": "y1Axis", - "scale": 1 + "scale": "LINEAR" } } }, { "text": { "content": "Widget 2", - "format": 1 + "format": "MARKDOWN" } }, { @@ -222,11 +220,11 @@ x-goog-request-params: parent=projects%2Fother${uniqueId} "xyChart": { "dataSets": [ { - "plotType": 3, + "plotType": "STACKED_BAR", "timeSeriesQuery": { "timeSeriesFilter": { "aggregation": { - "perSeriesAligner": 2 + "perSeriesAligner": "ALIGN_RATE" }, "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"" }, @@ -237,7 +235,7 @@ x-goog-request-params: parent=projects%2Fother${uniqueId} "timeshiftDuration": "0s", "yAxis": { "label": "y1Axis", - "scale": 1 + "scale": "LINEAR" } } }, @@ -352,10 +350,9 @@ X-Xss-Protection: 0 --- -GET https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}?%24alt=json%3Benum-encoding%3Dint +GET https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}?alt=json Content-Type: application/json -User-Agent: kcc/controller-manager -x-goog-request-params: name=projects%2Fother${uniqueId}%2Fdashboards%2Fmonitoringdashboard-${uniqueId} +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 200 OK Cache-Control: private @@ -451,27 +448,26 @@ X-Xss-Protection: 0 --- -PATCH https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}?%24alt=json%3Benum-encoding%3Dint +PATCH https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}?alt=json Content-Type: application/json -User-Agent: kcc/controller-manager -x-goog-request-params: dashboard.name=projects%2Fother${uniqueId}%2Fdashboards%2Fmonitoringdashboard-${uniqueId} +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 { "columnLayout": { "columns": [ { - "weight": "2", + "weight": 2, "widgets": [ { "title": "Widget 1", "xyChart": { "dataSets": [ { - "plotType": 1, + "plotType": "LINE", "timeSeriesQuery": { "timeSeriesFilter": { "aggregation": { - "perSeriesAligner": 2 + "perSeriesAligner": "ALIGN_RATE" }, "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"" }, @@ -479,17 +475,18 @@ x-goog-request-params: dashboard.name=projects%2Fother${uniqueId}%2Fdashboards%2 } } ], + "thresholds": [], "timeshiftDuration": "0s", "yAxis": { "label": "y1Axis", - "scale": 1 + "scale": "LINEAR" } } }, { "text": { "content": "Widget 2", - "format": 1 + "format": "MARKDOWN" } }, { @@ -497,11 +494,11 @@ x-goog-request-params: dashboard.name=projects%2Fother${uniqueId}%2Fdashboards%2 "xyChart": { "dataSets": [ { - "plotType": 3, + "plotType": "STACKED_BAR", "timeSeriesQuery": { "timeSeriesFilter": { "aggregation": { - "perSeriesAligner": 2 + "perSeriesAligner": "ALIGN_RATE" }, "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"" }, @@ -509,10 +506,11 @@ x-goog-request-params: dashboard.name=projects%2Fother${uniqueId}%2Fdashboards%2 } } ], + "thresholds": [], "timeshiftDuration": "0s", "yAxis": { "label": "y1Axis", - "scale": 1 + "scale": "LINEAR" } } }, @@ -527,7 +525,8 @@ x-goog-request-params: dashboard.name=projects%2Fother${uniqueId}%2Fdashboards%2 ] }, "displayName": "monitoringdashboard updated", - "name": "projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}" + "etag": "abcdef0123A=", + "name": "projects/projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}" } 200 OK @@ -621,10 +620,9 @@ X-Xss-Protection: 0 --- -GET https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}?%24alt=json%3Benum-encoding%3Dint +GET https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}?alt=json Content-Type: application/json -User-Agent: kcc/controller-manager -x-goog-request-params: name=projects%2Fother${uniqueId}%2Fdashboards%2Fmonitoringdashboard-${uniqueId} +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 200 OK Cache-Control: private @@ -717,10 +715,9 @@ X-Xss-Protection: 0 --- -DELETE https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}?%24alt=json%3Benum-encoding%3Dint +DELETE https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}?alt=json Content-Type: application/json -User-Agent: kcc/controller-manager -x-goog-request-params: name=projects%2Fother${uniqueId}%2Fdashboards%2Fmonitoringdashboard-${uniqueId} +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 200 OK Cache-Control: private @@ -737,6 +734,31 @@ X-Xss-Protection: 0 --- +GET https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 + +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, + "message": "Requested entity was not found.", + "status": "NOT_FOUND" + } +} + +--- + GET https://cloudresourcemanager.googleapis.com/v1/projects/other${uniqueId}?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 diff --git a/pkg/test/resourcefixture/testdata/basic/servicenetworking/v1beta1/servicenetworkingconnection/_http.log b/pkg/test/resourcefixture/testdata/basic/servicenetworking/v1beta1/servicenetworkingconnection/_http.log index de06994a66..135295b7b5 100644 --- a/pkg/test/resourcefixture/testdata/basic/servicenetworking/v1beta1/servicenetworkingconnection/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/servicenetworking/v1beta1/servicenetworkingconnection/_http.log @@ -60,7 +60,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "${networkID}", + "targetId": "7780111738275460050", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/computenetwork-${uniqueId}", "user": "user@example.com" } @@ -1092,7 +1092,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "${networkID}", + "targetId": "7780111738275460050", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/computenetwork-${uniqueId}", "user": "user@example.com" } \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/sql/v1beta1/sqlinstance/mysqlinstance/_http.log b/pkg/test/resourcefixture/testdata/basic/sql/v1beta1/sqlinstance/mysqlinstance/_http.log index 8f8e7a4e2c..9227be86a5 100644 --- a/pkg/test/resourcefixture/testdata/basic/sql/v1beta1/sqlinstance/mysqlinstance/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/sql/v1beta1/sqlinstance/mysqlinstance/_http.log @@ -55,7 +55,7 @@ Grpc-Metadata-Content-Type: application/grpc "selfLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/operations/${operationID}", "startTime": null, "status": "PENDING", - "targetId": "sqlinstance-sample-${uniqueId}", + "targetId": "7780111738275460050", "targetLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/instances/sqlinstance-sample-${uniqueId}", "targetProject": "${projectId}", "user": "user@example.com" @@ -120,7 +120,7 @@ Grpc-Metadata-Content-Type: application/grpc "selfLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/operations/${operationID}", "startTime": null, "status": "PENDING", - "targetId": "sqlinstance-sample-${uniqueId}", + "targetId": "7780111738275460050", "targetLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/instances/sqlinstance-sample-${uniqueId}", "targetProject": "${projectId}", "user": "user@example.com" @@ -276,7 +276,7 @@ Grpc-Metadata-Content-Type: application/grpc "selfLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/operations/${operationID}", "startTime": null, "status": "PENDING", - "targetId": "sqlinstance-sample-${uniqueId}", + "targetId": "7780111738275460050", "targetLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/instances/sqlinstance-sample-${uniqueId}", "targetProject": "${projectId}", "user": "user@example.com" diff --git a/pkg/test/resourcefixture/testdata/basic/sql/v1beta1/sqlinstance/postgresinstance/_http.log b/pkg/test/resourcefixture/testdata/basic/sql/v1beta1/sqlinstance/postgresinstance/_http.log index c83d6a1b28..9f7e4059a2 100644 --- a/pkg/test/resourcefixture/testdata/basic/sql/v1beta1/sqlinstance/postgresinstance/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/sql/v1beta1/sqlinstance/postgresinstance/_http.log @@ -60,7 +60,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "${networkID}", + "targetId": "7780111738275460050", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/computenetwork-${uniqueId}", "user": "user@example.com" } @@ -590,7 +590,7 @@ Grpc-Metadata-Content-Type: application/grpc "selfLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/operations/${operationID}", "startTime": null, "status": "PENDING", - "targetId": "sqlinstance-${uniqueId}", + "targetId": "7780111738275460050", "targetLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/instances/sqlinstance-${uniqueId}", "targetProject": "${projectId}", "user": "user@example.com" @@ -841,7 +841,7 @@ Grpc-Metadata-Content-Type: application/grpc "selfLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/operations/${operationID}", "startTime": null, "status": "PENDING", - "targetId": "sqlinstance-${uniqueId}", + "targetId": "7780111738275460050", "targetLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/instances/sqlinstance-${uniqueId}", "targetProject": "${projectId}", "user": "user@example.com" @@ -1015,7 +1015,7 @@ Grpc-Metadata-Content-Type: application/grpc "selfLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/operations/${operationID}", "startTime": null, "status": "PENDING", - "targetId": "sqlinstance-${uniqueId}", + "targetId": "7780111738275460050", "targetLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/instances/sqlinstance-${uniqueId}", "targetProject": "${projectId}", "user": "user@example.com" @@ -1245,7 +1245,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "${networkID}", + "targetId": "7780111738275460050", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/computenetwork-${uniqueId}", "user": "user@example.com" } \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/sql/v1beta1/sqlinstance/sqlserverinstance/_http.log b/pkg/test/resourcefixture/testdata/basic/sql/v1beta1/sqlinstance/sqlserverinstance/_http.log index 28b3df6ae3..5a5a17e38d 100644 --- a/pkg/test/resourcefixture/testdata/basic/sql/v1beta1/sqlinstance/sqlserverinstance/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/sql/v1beta1/sqlinstance/sqlserverinstance/_http.log @@ -199,7 +199,7 @@ Grpc-Metadata-Content-Type: application/grpc "selfLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/operations/${operationID}", "startTime": null, "status": "PENDING", - "targetId": "sqlinstance-sample-${uniqueId}", + "targetId": "7780111738275460050", "targetLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/instances/sqlinstance-sample-${uniqueId}", "targetProject": "${projectId}", "user": "user@example.com" @@ -450,7 +450,7 @@ Grpc-Metadata-Content-Type: application/grpc "selfLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/operations/${operationID}", "startTime": null, "status": "PENDING", - "targetId": "sqlinstance-sample-${uniqueId}", + "targetId": "7780111738275460050", "targetLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/instances/sqlinstance-sample-${uniqueId}", "targetProject": "${projectId}", "user": "user@example.com" diff --git a/pkg/test/resourcefixture/testdata/basic/sql/v1beta1/sqluser/_http.log b/pkg/test/resourcefixture/testdata/basic/sql/v1beta1/sqluser/_http.log index c586d68737..5676808075 100644 --- a/pkg/test/resourcefixture/testdata/basic/sql/v1beta1/sqluser/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/sql/v1beta1/sqluser/_http.log @@ -53,7 +53,7 @@ Grpc-Metadata-Content-Type: application/grpc "selfLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/operations/${operationID}", "startTime": null, "status": "PENDING", - "targetId": "sqluser-dep-${uniqueId}", + "targetId": "7780111738275460050", "targetLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/instances/sqluser-dep-${uniqueId}", "targetProject": "${projectId}", "user": "user@example.com" @@ -118,7 +118,7 @@ Grpc-Metadata-Content-Type: application/grpc "selfLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/operations/${operationID}", "startTime": null, "status": "PENDING", - "targetId": "sqluser-dep-${uniqueId}", + "targetId": "7780111738275460050", "targetLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/instances/sqluser-dep-${uniqueId}", "targetProject": "${projectId}", "user": "user@example.com" @@ -422,7 +422,7 @@ Grpc-Metadata-Content-Type: application/grpc "selfLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/operations/${operationID}", "startTime": null, "status": "PENDING", - "targetId": "sqluser-dep-${uniqueId}", + "targetId": "7780111738275460050", "targetLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/instances/sqluser-dep-${uniqueId}", "targetProject": "${projectId}", "user": "user@example.com" @@ -937,7 +937,7 @@ Grpc-Metadata-Content-Type: application/grpc "selfLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/operations/${operationID}", "startTime": null, "status": "PENDING", - "targetId": "sqluser-dep-${uniqueId}", + "targetId": "7780111738275460050", "targetLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/instances/sqluser-dep-${uniqueId}", "targetProject": "${projectId}", "user": "user@example.com" @@ -1092,7 +1092,7 @@ Grpc-Metadata-Content-Type: application/grpc "selfLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/operations/${operationID}", "startTime": null, "status": "PENDING", - "targetId": "sqluser-dep-${uniqueId}", + "targetId": "7780111738275460050", "targetLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/instances/sqluser-dep-${uniqueId}", "targetProject": "${projectId}", "user": "user@example.com" diff --git a/pkg/test/resourcefixture/testdata/basic/vertexai/v1beta1/vertexaiendpoint/vertexaiendpointnetwork/_http.log b/pkg/test/resourcefixture/testdata/basic/vertexai/v1beta1/vertexaiendpoint/vertexaiendpointnetwork/_http.log index 7d03f8acf6..0300cd07dd 100644 --- a/pkg/test/resourcefixture/testdata/basic/vertexai/v1beta1/vertexaiendpoint/vertexaiendpointnetwork/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/vertexai/v1beta1/vertexaiendpoint/vertexaiendpointnetwork/_http.log @@ -60,7 +60,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "${networkID}", + "targetId": "7780111738275460050", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/computenetwork-${uniqueId}", "user": "user@example.com" } @@ -1150,7 +1150,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "${networkID}", + "targetId": "7780111738275460050", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/computenetwork-${uniqueId}", "user": "user@example.com" } \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/iammemberreferences/sqlinstanceref/_http.log b/pkg/test/resourcefixture/testdata/iammemberreferences/sqlinstanceref/_http.log index c34d669ea2..3de225eba8 100644 --- a/pkg/test/resourcefixture/testdata/iammemberreferences/sqlinstanceref/_http.log +++ b/pkg/test/resourcefixture/testdata/iammemberreferences/sqlinstanceref/_http.log @@ -53,7 +53,7 @@ Grpc-Metadata-Content-Type: application/grpc "selfLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/operations/${operationID}", "startTime": null, "status": "PENDING", - "targetId": "sqlinstance-${uniqueId}", + "targetId": "7780111738275460050", "targetLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/instances/sqlinstance-${uniqueId}", "targetProject": "${projectId}", "user": "user@example.com" @@ -118,7 +118,7 @@ Grpc-Metadata-Content-Type: application/grpc "selfLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/operations/${operationID}", "startTime": null, "status": "PENDING", - "targetId": "sqlinstance-${uniqueId}", + "targetId": "7780111738275460050", "targetLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/instances/sqlinstance-${uniqueId}", "targetProject": "${projectId}", "user": "user@example.com" @@ -628,7 +628,7 @@ Grpc-Metadata-Content-Type: application/grpc "selfLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/operations/${operationID}", "startTime": null, "status": "PENDING", - "targetId": "sqlinstance-${uniqueId}", + "targetId": "7780111738275460050", "targetLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/instances/sqlinstance-${uniqueId}", "targetProject": "${projectId}", "user": "user@example.com" diff --git a/tests/e2e/normalize.go b/tests/e2e/normalize.go index 09399cbbeb..1ab7e47187 100644 --- a/tests/e2e/normalize.go +++ b/tests/e2e/normalize.go @@ -48,18 +48,25 @@ func normalizeKRMObject(u *unstructured.Unstructured, project testgcp.GCPProject visitor.replacePaths = map[string]any{} visitor.replacePaths[".metadata.deletionTimestamp"] = "1970-01-01T00:00:00Z" - visitor.replacePaths[".status.creationTimestamp"] = "1970-01-01T00:00:00Z" - visitor.replacePaths[".status.conditions[].lastTransitionTime"] = "1970-01-01T00:00:00Z" - visitor.replacePaths[".status.uniqueId"] = "12345678" - visitor.replacePaths[".status.uid"] = "12345678" - visitor.replacePaths[".status.creationTime"] = "1970-01-01T00:00:00Z" + visitor.replacePaths[".status.blobStoragePathPrefix"] = "cloud-ai-platform-00000000-1111-2222-3333-444444444444" + visitor.replacePaths[".status.certificateId"] = "12345678" visitor.replacePaths[".status.createTime"] = "1970-01-01T00:00:00Z" + visitor.replacePaths[".status.creationTime"] = "1970-01-01T00:00:00Z" + visitor.replacePaths[".status.conditions[].lastTransitionTime"] = "1970-01-01T00:00:00Z" + visitor.replacePaths[".status.creationTimestamp"] = "1970-01-01T00:00:00Z" + visitor.replacePaths[".status.etag"] = "abcdef123456" + visitor.replacePaths[".status.lastModifiedTime"] = "1970-01-01T00:00:00Z" + visitor.replacePaths[".status.number"] = "12345678" visitor.replacePaths[".status.observedState.createTime"] = "1970-01-01T00:00:00Z" + visitor.replacePaths[".status.observedState.etag"] = "abcdef123456" visitor.replacePaths[".status.observedState.updateTime"] = "1970-01-01T00:00:00Z" + visitor.replacePaths[".status.uid"] = "12345678" + visitor.replacePaths[".status.uniqueId"] = "12345678" visitor.replacePaths[".status.updateTime"] = "1970-01-01T00:00:00Z" - visitor.replacePaths[".status.lastModifiedTime"] = "1970-01-01T00:00:00Z" - visitor.replacePaths[".status.etag"] = "abcdef123456" - visitor.replacePaths[".status.observedState.etag"] = "abcdef123456" + + // Specific to postgresinstance + visitor.replacePaths[".status.serverCaCert.createTime"] = "1970-01-01T00:00:00Z" + visitor.replacePaths[".status.serverCaCert.expirationTime"] = "1970-01-01T00:00:00Z" // Specific to Sql visitor.replacePaths[".items[].etag"] = "abcdef0123A=" @@ -104,6 +111,9 @@ func normalizeKRMObject(u *unstructured.Unstructured, project testgcp.GCPProject visitor.replacePaths[".spec.softDeletePolicy.effectiveTime"] = "1970-01-01T00:00:00Z" visitor.replacePaths[".status.observedState.softDeletePolicy.effectiveTime"] = "1970-01-01T00:00:00Z" + // Specific to Sql + visitor.replacePaths[".items[].etag"] = "abcdef0123A=" + visitor.sortSlices = sets.New[string]() // TODO: This should not be needed, we want to avoid churning the kube objects visitor.sortSlices.Insert(".spec.access") From 322ad616a3675a854f385c9d766634da9b83f0ff Mon Sep 17 00:00:00 2001 From: Yuwen Ma Date: Sun, 23 Jun 2024 21:50:30 +0000 Subject: [PATCH 4/8] revert targetId overrides --- .../basicalloydbcluster/_http.log | 4 ++-- .../basicalloydbsecondarycluster/_http.log | 4 ++-- .../basicalloydbinstance/_http.log | 4 ++-- .../basicalloydbsecondaryinstance/_http.log | 4 ++-- .../fullalloydbinstance/_http.log | 4 ++-- .../readalloydbinstance/_http.log | 4 ++-- .../zonalalloydbinstance/_http.log | 4 ++-- .../v1alpha1/cloudidsendpoint/_http.log | 4 ++-- .../globalcomputeaddress/_http.log | 4 ++-- .../regionalcomputeaddress/_http.log | 6 ++--- .../compute/v1beta1/computenetwork/_http.log | 6 ++--- .../v1beta1/computesubnetwork/_http.log | 10 ++++---- .../logmetricprojectref/_http.log | 24 +++++++++++++++++++ 13 files changed, 53 insertions(+), 29 deletions(-) diff --git a/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbcluster/basicalloydbcluster/_http.log b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbcluster/basicalloydbcluster/_http.log index 7b15aa6bd8..443ec5af72 100644 --- a/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbcluster/basicalloydbcluster/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbcluster/basicalloydbcluster/_http.log @@ -54,7 +54,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "7780111738275460050", + "targetId": "${networkID}", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/${networkID}", "user": "user@example.com" } @@ -117,7 +117,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "7780111738275460050", + "targetId": "${networkID}", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/${networkID}", "user": "user@example.com" } diff --git a/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbcluster/basicalloydbsecondarycluster/_http.log b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbcluster/basicalloydbsecondarycluster/_http.log index f34014777d..2b29b09b6a 100644 --- a/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbcluster/basicalloydbsecondarycluster/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbcluster/basicalloydbsecondarycluster/_http.log @@ -60,7 +60,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "7780111738275460050", + "targetId": "${networkID}", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/computenetwork-${uniqueId}", "user": "user@example.com" } @@ -1165,7 +1165,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "7780111738275460050", + "targetId": "${networkID}", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/computenetwork-${uniqueId}", "user": "user@example.com" } \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/basicalloydbinstance/_http.log b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/basicalloydbinstance/_http.log index 7312af8c57..6fd60a2d7b 100644 --- a/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/basicalloydbinstance/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/basicalloydbinstance/_http.log @@ -60,7 +60,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "7780111738275460050", + "targetId": "${networkID}", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/computenetwork-${uniqueId}", "user": "user@example.com" } @@ -1002,7 +1002,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "7780111738275460050", + "targetId": "${networkID}", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/computenetwork-${uniqueId}", "user": "user@example.com" } \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/basicalloydbsecondaryinstance/_http.log b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/basicalloydbsecondaryinstance/_http.log index 16763ce6cc..da8a1deae2 100644 --- a/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/basicalloydbsecondaryinstance/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/basicalloydbsecondaryinstance/_http.log @@ -60,7 +60,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "7780111738275460050", + "targetId": "${networkID}", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/computenetwork-${uniqueId}", "user": "user@example.com" } @@ -1288,7 +1288,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "7780111738275460050", + "targetId": "${networkID}", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/computenetwork-${uniqueId}", "user": "user@example.com" } \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/fullalloydbinstance/_http.log b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/fullalloydbinstance/_http.log index 07c5d9de5b..40f209d5a7 100644 --- a/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/fullalloydbinstance/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/fullalloydbinstance/_http.log @@ -60,7 +60,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "7780111738275460050", + "targetId": "${networkID}", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/computenetwork-${uniqueId}", "user": "user@example.com" } @@ -993,7 +993,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "7780111738275460050", + "targetId": "${networkID}", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/computenetwork-${uniqueId}", "user": "user@example.com" } \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/readalloydbinstance/_http.log b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/readalloydbinstance/_http.log index 88e705cd2e..a59e42597c 100644 --- a/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/readalloydbinstance/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/readalloydbinstance/_http.log @@ -60,7 +60,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "7780111738275460050", + "targetId": "${networkID}", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/computenetwork${uniqueId}", "user": "user@example.com" } @@ -1146,7 +1146,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "7780111738275460050", + "targetId": "${networkID}", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/computenetwork${uniqueId}", "user": "user@example.com" } \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/zonalalloydbinstance/_http.log b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/zonalalloydbinstance/_http.log index 42889815b5..2adb166aa1 100644 --- a/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/zonalalloydbinstance/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/zonalalloydbinstance/_http.log @@ -60,7 +60,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "7780111738275460050", + "targetId": "${networkID}", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/computenetwork-${uniqueId}", "user": "user@example.com" } @@ -925,7 +925,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "7780111738275460050", + "targetId": "${networkID}", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/computenetwork-${uniqueId}", "user": "user@example.com" } \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/cloudids/v1alpha1/cloudidsendpoint/_http.log b/pkg/test/resourcefixture/testdata/basic/cloudids/v1alpha1/cloudidsendpoint/_http.log index 0ece68d9f0..33daa6ace0 100644 --- a/pkg/test/resourcefixture/testdata/basic/cloudids/v1alpha1/cloudidsendpoint/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/cloudids/v1alpha1/cloudidsendpoint/_http.log @@ -60,7 +60,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "7780111738275460050", + "targetId": "${networkID}", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/computenetwork-${uniqueId}", "user": "user@example.com" } @@ -797,7 +797,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "7780111738275460050", + "targetId": "${networkID}", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/computenetwork-${uniqueId}", "user": "user@example.com" } \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computeaddress/globalcomputeaddress/_http.log b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computeaddress/globalcomputeaddress/_http.log index 26ca5e3554..a37b90444f 100644 --- a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computeaddress/globalcomputeaddress/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computeaddress/globalcomputeaddress/_http.log @@ -54,7 +54,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "7780111738275460050", + "targetId": "${networkID}", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/${networkID}", "user": "user@example.com" } @@ -117,7 +117,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "7780111738275460050", + "targetId": "${networkID}", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/${networkID}", "user": "user@example.com" } diff --git a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computeaddress/regionalcomputeaddress/_http.log b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computeaddress/regionalcomputeaddress/_http.log index edb082d007..f73d82b50b 100644 --- a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computeaddress/regionalcomputeaddress/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computeaddress/regionalcomputeaddress/_http.log @@ -54,7 +54,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "7780111738275460050", + "targetId": "${networkID}", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/${subnetworkID}", "user": "user@example.com" } @@ -117,7 +117,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "7780111738275460050", + "targetId": "${networkID}", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/${subnetworkID}", "user": "user@example.com" } @@ -218,7 +218,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/regions/us-central1/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "7780111738275460050", + "targetId": "${subnetworkNumber}", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/regions/us-central1/subnetworks/${subnetworkID}", "user": "user@example.com" } diff --git a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computenetwork/_http.log b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computenetwork/_http.log index 54ac2f9f67..7c60bdb0d0 100644 --- a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computenetwork/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computenetwork/_http.log @@ -63,7 +63,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "7780111738275460050", + "targetId": "${networkID}", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/computenetwork-${uniqueId}", "user": "user@example.com" } @@ -133,7 +133,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "7780111738275460050", + "targetId": "${networkID}", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/computenetwork-${uniqueId}", "user": "user@example.com" } @@ -196,7 +196,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "7780111738275460050", + "targetId": "${networkID}", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/computenetwork-${uniqueId}", "user": "user@example.com" } \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computesubnetwork/_http.log b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computesubnetwork/_http.log index 265c1c8fce..c1543b505c 100644 --- a/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computesubnetwork/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/compute/v1beta1/computesubnetwork/_http.log @@ -63,7 +63,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "7780111738275460050", + "targetId": "${networkID}", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/computenetwork-${uniqueId}", "user": "user@example.com" } @@ -168,7 +168,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/regions/us-central1/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "7780111738275460050", + "targetId": "${subnetworkNumber}", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/regions/us-central1/subnetworks/computesubnetwork-${uniqueId}", "user": "user@example.com" } @@ -243,7 +243,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/regions/us-central1/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "7780111738275460050", + "targetId": "${subnetworkNumber}", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/regions/us-central1/subnetworks/computesubnetwork-${uniqueId}", "user": "user@example.com" } @@ -314,7 +314,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/regions/us-central1/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "7780111738275460050", + "targetId": "${subnetworkNumber}", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/regions/us-central1/subnetworks/computesubnetwork-${uniqueId}", "user": "user@example.com" } @@ -377,7 +377,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "7780111738275460050", + "targetId": "${networkID}", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/computenetwork-${uniqueId}", "user": "user@example.com" } \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/logging/v1beta1/logginglogmetric/logmetricprojectref/_http.log b/pkg/test/resourcefixture/testdata/basic/logging/v1beta1/logginglogmetric/logmetricprojectref/_http.log index b272a8b8f0..7f1d06de1c 100644 --- a/pkg/test/resourcefixture/testdata/basic/logging/v1beta1/logginglogmetric/logmetricprojectref/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/logging/v1beta1/logginglogmetric/logmetricprojectref/_http.log @@ -522,6 +522,30 @@ X-Xss-Protection: 0 --- +GET https://logging.googleapis.com/v2/projects/${projectId}/metrics/linearlogmetric-${uniqueId}?alt=json&prettyPrint=false +User-Agent: google-api-go-client/0.5 + +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, + "message": "Metric linearlogmetric-${uniqueId} does not exist.", + "status": "NOT_FOUND" + } +} + +--- + GET https://logging.googleapis.com/v2/projects/example-project-02/metrics/linearlogmetric-${uniqueId}?alt=json&prettyPrint=false User-Agent: google-api-go-client/0.5 From b7ae66dabd066fead2d1306411ada22000fbfa2b Mon Sep 17 00:00:00 2001 From: Yuwen Ma Date: Sat, 22 Jun 2024 15:38:54 +0000 Subject: [PATCH 5/8] revert --- .../v1beta1/servicenetworkingconnection/_http.log | 4 ++-- .../sql/v1beta1/sqlinstance/mysqlinstance/_http.log | 6 +++--- .../sql/v1beta1/sqlinstance/postgresinstance/_http.log | 10 +++++----- .../v1beta1/sqlinstance/sqlserverinstance/_http.log | 4 ++-- .../testdata/basic/sql/v1beta1/sqluser/_http.log | 10 +++++----- .../vertexaiendpoint/vertexaiendpointnetwork/_http.log | 4 ++-- .../iammemberreferences/sqlinstanceref/_http.log | 6 +++--- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/pkg/test/resourcefixture/testdata/basic/servicenetworking/v1beta1/servicenetworkingconnection/_http.log b/pkg/test/resourcefixture/testdata/basic/servicenetworking/v1beta1/servicenetworkingconnection/_http.log index 135295b7b5..de06994a66 100644 --- a/pkg/test/resourcefixture/testdata/basic/servicenetworking/v1beta1/servicenetworkingconnection/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/servicenetworking/v1beta1/servicenetworkingconnection/_http.log @@ -60,7 +60,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "7780111738275460050", + "targetId": "${networkID}", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/computenetwork-${uniqueId}", "user": "user@example.com" } @@ -1092,7 +1092,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "7780111738275460050", + "targetId": "${networkID}", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/computenetwork-${uniqueId}", "user": "user@example.com" } \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/sql/v1beta1/sqlinstance/mysqlinstance/_http.log b/pkg/test/resourcefixture/testdata/basic/sql/v1beta1/sqlinstance/mysqlinstance/_http.log index 9227be86a5..8f8e7a4e2c 100644 --- a/pkg/test/resourcefixture/testdata/basic/sql/v1beta1/sqlinstance/mysqlinstance/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/sql/v1beta1/sqlinstance/mysqlinstance/_http.log @@ -55,7 +55,7 @@ Grpc-Metadata-Content-Type: application/grpc "selfLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/operations/${operationID}", "startTime": null, "status": "PENDING", - "targetId": "7780111738275460050", + "targetId": "sqlinstance-sample-${uniqueId}", "targetLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/instances/sqlinstance-sample-${uniqueId}", "targetProject": "${projectId}", "user": "user@example.com" @@ -120,7 +120,7 @@ Grpc-Metadata-Content-Type: application/grpc "selfLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/operations/${operationID}", "startTime": null, "status": "PENDING", - "targetId": "7780111738275460050", + "targetId": "sqlinstance-sample-${uniqueId}", "targetLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/instances/sqlinstance-sample-${uniqueId}", "targetProject": "${projectId}", "user": "user@example.com" @@ -276,7 +276,7 @@ Grpc-Metadata-Content-Type: application/grpc "selfLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/operations/${operationID}", "startTime": null, "status": "PENDING", - "targetId": "7780111738275460050", + "targetId": "sqlinstance-sample-${uniqueId}", "targetLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/instances/sqlinstance-sample-${uniqueId}", "targetProject": "${projectId}", "user": "user@example.com" diff --git a/pkg/test/resourcefixture/testdata/basic/sql/v1beta1/sqlinstance/postgresinstance/_http.log b/pkg/test/resourcefixture/testdata/basic/sql/v1beta1/sqlinstance/postgresinstance/_http.log index 9f7e4059a2..c83d6a1b28 100644 --- a/pkg/test/resourcefixture/testdata/basic/sql/v1beta1/sqlinstance/postgresinstance/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/sql/v1beta1/sqlinstance/postgresinstance/_http.log @@ -60,7 +60,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "7780111738275460050", + "targetId": "${networkID}", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/computenetwork-${uniqueId}", "user": "user@example.com" } @@ -590,7 +590,7 @@ Grpc-Metadata-Content-Type: application/grpc "selfLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/operations/${operationID}", "startTime": null, "status": "PENDING", - "targetId": "7780111738275460050", + "targetId": "sqlinstance-${uniqueId}", "targetLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/instances/sqlinstance-${uniqueId}", "targetProject": "${projectId}", "user": "user@example.com" @@ -841,7 +841,7 @@ Grpc-Metadata-Content-Type: application/grpc "selfLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/operations/${operationID}", "startTime": null, "status": "PENDING", - "targetId": "7780111738275460050", + "targetId": "sqlinstance-${uniqueId}", "targetLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/instances/sqlinstance-${uniqueId}", "targetProject": "${projectId}", "user": "user@example.com" @@ -1015,7 +1015,7 @@ Grpc-Metadata-Content-Type: application/grpc "selfLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/operations/${operationID}", "startTime": null, "status": "PENDING", - "targetId": "7780111738275460050", + "targetId": "sqlinstance-${uniqueId}", "targetLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/instances/sqlinstance-${uniqueId}", "targetProject": "${projectId}", "user": "user@example.com" @@ -1245,7 +1245,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "7780111738275460050", + "targetId": "${networkID}", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/computenetwork-${uniqueId}", "user": "user@example.com" } \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/sql/v1beta1/sqlinstance/sqlserverinstance/_http.log b/pkg/test/resourcefixture/testdata/basic/sql/v1beta1/sqlinstance/sqlserverinstance/_http.log index 5a5a17e38d..28b3df6ae3 100644 --- a/pkg/test/resourcefixture/testdata/basic/sql/v1beta1/sqlinstance/sqlserverinstance/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/sql/v1beta1/sqlinstance/sqlserverinstance/_http.log @@ -199,7 +199,7 @@ Grpc-Metadata-Content-Type: application/grpc "selfLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/operations/${operationID}", "startTime": null, "status": "PENDING", - "targetId": "7780111738275460050", + "targetId": "sqlinstance-sample-${uniqueId}", "targetLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/instances/sqlinstance-sample-${uniqueId}", "targetProject": "${projectId}", "user": "user@example.com" @@ -450,7 +450,7 @@ Grpc-Metadata-Content-Type: application/grpc "selfLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/operations/${operationID}", "startTime": null, "status": "PENDING", - "targetId": "7780111738275460050", + "targetId": "sqlinstance-sample-${uniqueId}", "targetLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/instances/sqlinstance-sample-${uniqueId}", "targetProject": "${projectId}", "user": "user@example.com" diff --git a/pkg/test/resourcefixture/testdata/basic/sql/v1beta1/sqluser/_http.log b/pkg/test/resourcefixture/testdata/basic/sql/v1beta1/sqluser/_http.log index 5676808075..c586d68737 100644 --- a/pkg/test/resourcefixture/testdata/basic/sql/v1beta1/sqluser/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/sql/v1beta1/sqluser/_http.log @@ -53,7 +53,7 @@ Grpc-Metadata-Content-Type: application/grpc "selfLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/operations/${operationID}", "startTime": null, "status": "PENDING", - "targetId": "7780111738275460050", + "targetId": "sqluser-dep-${uniqueId}", "targetLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/instances/sqluser-dep-${uniqueId}", "targetProject": "${projectId}", "user": "user@example.com" @@ -118,7 +118,7 @@ Grpc-Metadata-Content-Type: application/grpc "selfLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/operations/${operationID}", "startTime": null, "status": "PENDING", - "targetId": "7780111738275460050", + "targetId": "sqluser-dep-${uniqueId}", "targetLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/instances/sqluser-dep-${uniqueId}", "targetProject": "${projectId}", "user": "user@example.com" @@ -422,7 +422,7 @@ Grpc-Metadata-Content-Type: application/grpc "selfLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/operations/${operationID}", "startTime": null, "status": "PENDING", - "targetId": "7780111738275460050", + "targetId": "sqluser-dep-${uniqueId}", "targetLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/instances/sqluser-dep-${uniqueId}", "targetProject": "${projectId}", "user": "user@example.com" @@ -937,7 +937,7 @@ Grpc-Metadata-Content-Type: application/grpc "selfLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/operations/${operationID}", "startTime": null, "status": "PENDING", - "targetId": "7780111738275460050", + "targetId": "sqluser-dep-${uniqueId}", "targetLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/instances/sqluser-dep-${uniqueId}", "targetProject": "${projectId}", "user": "user@example.com" @@ -1092,7 +1092,7 @@ Grpc-Metadata-Content-Type: application/grpc "selfLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/operations/${operationID}", "startTime": null, "status": "PENDING", - "targetId": "7780111738275460050", + "targetId": "sqluser-dep-${uniqueId}", "targetLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/instances/sqluser-dep-${uniqueId}", "targetProject": "${projectId}", "user": "user@example.com" diff --git a/pkg/test/resourcefixture/testdata/basic/vertexai/v1beta1/vertexaiendpoint/vertexaiendpointnetwork/_http.log b/pkg/test/resourcefixture/testdata/basic/vertexai/v1beta1/vertexaiendpoint/vertexaiendpointnetwork/_http.log index 0300cd07dd..7d03f8acf6 100644 --- a/pkg/test/resourcefixture/testdata/basic/vertexai/v1beta1/vertexaiendpoint/vertexaiendpointnetwork/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/vertexai/v1beta1/vertexaiendpoint/vertexaiendpointnetwork/_http.log @@ -60,7 +60,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "7780111738275460050", + "targetId": "${networkID}", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/computenetwork-${uniqueId}", "user": "user@example.com" } @@ -1150,7 +1150,7 @@ X-Xss-Protection: 0 "selfLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/operations/${operationID}", "startTime": "2024-04-01T12:34:56.123456Z", "status": "RUNNING", - "targetId": "7780111738275460050", + "targetId": "${networkID}", "targetLink": "https://www.googleapis.com/compute/beta/projects/${projectId}/global/networks/computenetwork-${uniqueId}", "user": "user@example.com" } \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/iammemberreferences/sqlinstanceref/_http.log b/pkg/test/resourcefixture/testdata/iammemberreferences/sqlinstanceref/_http.log index 3de225eba8..c34d669ea2 100644 --- a/pkg/test/resourcefixture/testdata/iammemberreferences/sqlinstanceref/_http.log +++ b/pkg/test/resourcefixture/testdata/iammemberreferences/sqlinstanceref/_http.log @@ -53,7 +53,7 @@ Grpc-Metadata-Content-Type: application/grpc "selfLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/operations/${operationID}", "startTime": null, "status": "PENDING", - "targetId": "7780111738275460050", + "targetId": "sqlinstance-${uniqueId}", "targetLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/instances/sqlinstance-${uniqueId}", "targetProject": "${projectId}", "user": "user@example.com" @@ -118,7 +118,7 @@ Grpc-Metadata-Content-Type: application/grpc "selfLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/operations/${operationID}", "startTime": null, "status": "PENDING", - "targetId": "7780111738275460050", + "targetId": "sqlinstance-${uniqueId}", "targetLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/instances/sqlinstance-${uniqueId}", "targetProject": "${projectId}", "user": "user@example.com" @@ -628,7 +628,7 @@ Grpc-Metadata-Content-Type: application/grpc "selfLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/operations/${operationID}", "startTime": null, "status": "PENDING", - "targetId": "7780111738275460050", + "targetId": "sqlinstance-${uniqueId}", "targetLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/${projectId}/instances/sqlinstance-${uniqueId}", "targetProject": "${projectId}", "user": "user@example.com" From bf08ac70f12ab67aef81ff25f2ba2d21a0123b0c Mon Sep 17 00:00:00 2001 From: Yuwen Ma Date: Sun, 23 Jun 2024 21:55:01 +0000 Subject: [PATCH 6/8] clean up after rebase --- ...bject_monitoringdashboardbasic.golden.yaml | 1 - .../monitoringdashboardbasic/_http.log | 92 +++++++------------ ...object_monitoringdashboardrefs.golden.yaml | 1 - .../monitoringdashboardrefs/_http.log | 92 +++++++------------ tests/e2e/normalize.go | 26 ++---- 5 files changed, 78 insertions(+), 134 deletions(-) diff --git a/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardbasic/_generated_object_monitoringdashboardbasic.golden.yaml b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardbasic/_generated_object_monitoringdashboardbasic.golden.yaml index 138280de99..81e1f8d473 100644 --- a/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardbasic/_generated_object_monitoringdashboardbasic.golden.yaml +++ b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardbasic/_generated_object_monitoringdashboardbasic.golden.yaml @@ -3,7 +3,6 @@ kind: MonitoringDashboard metadata: annotations: cnrm.cloud.google.com/management-conflict-prevention-policy: none - cnrm.cloud.google.com/state-into-spec: merge finalizers: - cnrm.cloud.google.com/finalizer - cnrm.cloud.google.com/deletion-defender diff --git a/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardbasic/_http.log b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardbasic/_http.log index caf1a0e4cb..a81a02ff3a 100644 --- a/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardbasic/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardbasic/_http.log @@ -1,6 +1,7 @@ -GET https://monitoring.googleapis.com/v1/projects/${projectId}/dashboards/monitoringdashboard-${uniqueId}?alt=json +GET https://monitoring.googleapis.com/v1/projects/${projectId}/dashboards/monitoringdashboard-${uniqueId}?%24alt=json%3Benum-encoding%3Dint Content-Type: application/json -User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 +User-Agent: kcc/controller-manager +x-goog-request-params: name=projects%2F${projectId}%2Fdashboards%2Fmonitoringdashboard-${uniqueId} 404 Not Found Cache-Control: private @@ -23,26 +24,27 @@ X-Xss-Protection: 0 --- -POST https://monitoring.googleapis.com/v1/projects/${projectId}/dashboards?alt=json +POST https://monitoring.googleapis.com/v1/projects/${projectId}/dashboards?%24alt=json%3Benum-encoding%3Dint Content-Type: application/json -User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 +User-Agent: kcc/controller-manager +x-goog-request-params: parent=projects%2F${projectId} { "columnLayout": { "columns": [ { - "weight": 2, + "weight": "2", "widgets": [ { "title": "Widget 1", "xyChart": { "dataSets": [ { - "plotType": "LINE", + "plotType": 1, "timeSeriesQuery": { "timeSeriesFilter": { "aggregation": { - "perSeriesAligner": "ALIGN_RATE" + "perSeriesAligner": 2 }, "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"" }, @@ -53,14 +55,14 @@ User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 "timeshiftDuration": "0s", "yAxis": { "label": "y1Axis", - "scale": "LINEAR" + "scale": 1 } } }, { "text": { "content": "Widget 2", - "format": "MARKDOWN" + "format": 1 } }, { @@ -68,11 +70,11 @@ User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 "xyChart": { "dataSets": [ { - "plotType": "STACKED_BAR", + "plotType": 3, "timeSeriesQuery": { "timeSeriesFilter": { "aggregation": { - "perSeriesAligner": "ALIGN_RATE" + "perSeriesAligner": 2 }, "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"" }, @@ -83,7 +85,7 @@ User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 "timeshiftDuration": "0s", "yAxis": { "label": "y1Axis", - "scale": "LINEAR" + "scale": 1 } } }, @@ -198,9 +200,10 @@ X-Xss-Protection: 0 --- -GET https://monitoring.googleapis.com/v1/projects/${projectId}/dashboards/monitoringdashboard-${uniqueId}?alt=json +GET https://monitoring.googleapis.com/v1/projects/${projectId}/dashboards/monitoringdashboard-${uniqueId}?%24alt=json%3Benum-encoding%3Dint Content-Type: application/json -User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 +User-Agent: kcc/controller-manager +x-goog-request-params: name=projects%2F${projectId}%2Fdashboards%2Fmonitoringdashboard-${uniqueId} 200 OK Cache-Control: private @@ -296,26 +299,27 @@ X-Xss-Protection: 0 --- -PATCH https://monitoring.googleapis.com/v1/projects/${projectId}/dashboards/monitoringdashboard-${uniqueId}?alt=json +PATCH https://monitoring.googleapis.com/v1/projects/${projectId}/dashboards/monitoringdashboard-${uniqueId}?%24alt=json%3Benum-encoding%3Dint Content-Type: application/json -User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 +User-Agent: kcc/controller-manager +x-goog-request-params: dashboard.name=projects%2F${projectId}%2Fdashboards%2Fmonitoringdashboard-${uniqueId} { "columnLayout": { "columns": [ { - "weight": 2, + "weight": "2", "widgets": [ { "title": "Widget 1", "xyChart": { "dataSets": [ { - "plotType": "LINE", + "plotType": 1, "timeSeriesQuery": { "timeSeriesFilter": { "aggregation": { - "perSeriesAligner": "ALIGN_RATE" + "perSeriesAligner": 2 }, "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"" }, @@ -323,18 +327,17 @@ User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 } } ], - "thresholds": [], "timeshiftDuration": "0s", "yAxis": { "label": "y1Axis", - "scale": "LINEAR" + "scale": 1 } } }, { "text": { "content": "Widget 2", - "format": "MARKDOWN" + "format": 1 } }, { @@ -342,11 +345,11 @@ User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 "xyChart": { "dataSets": [ { - "plotType": "STACKED_BAR", + "plotType": 3, "timeSeriesQuery": { "timeSeriesFilter": { "aggregation": { - "perSeriesAligner": "ALIGN_RATE" + "perSeriesAligner": 2 }, "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"" }, @@ -354,11 +357,10 @@ User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 } } ], - "thresholds": [], "timeshiftDuration": "0s", "yAxis": { "label": "y1Axis", - "scale": "LINEAR" + "scale": 1 } } }, @@ -373,7 +375,6 @@ User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 ] }, "displayName": "monitoringdashboard-updated", - "etag": "abcdef0123A=", "name": "projects/${projectId}/dashboards/monitoringdashboard-${uniqueId}" } @@ -468,9 +469,10 @@ X-Xss-Protection: 0 --- -GET https://monitoring.googleapis.com/v1/projects/${projectId}/dashboards/monitoringdashboard-${uniqueId}?alt=json +GET https://monitoring.googleapis.com/v1/projects/${projectId}/dashboards/monitoringdashboard-${uniqueId}?%24alt=json%3Benum-encoding%3Dint Content-Type: application/json -User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 +User-Agent: kcc/controller-manager +x-goog-request-params: name=projects%2F${projectId}%2Fdashboards%2Fmonitoringdashboard-${uniqueId} 200 OK Cache-Control: private @@ -563,9 +565,10 @@ X-Xss-Protection: 0 --- -DELETE https://monitoring.googleapis.com/v1/projects/${projectId}/dashboards/monitoringdashboard-${uniqueId}?alt=json +DELETE https://monitoring.googleapis.com/v1/projects/${projectId}/dashboards/monitoringdashboard-${uniqueId}?%24alt=json%3Benum-encoding%3Dint Content-Type: application/json -User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 +User-Agent: kcc/controller-manager +x-goog-request-params: name=projects%2F${projectId}%2Fdashboards%2Fmonitoringdashboard-${uniqueId} 200 OK Cache-Control: private @@ -578,29 +581,4 @@ X-Content-Type-Options: nosniff X-Frame-Options: SAMEORIGIN X-Xss-Protection: 0 -{} - ---- - -GET https://monitoring.googleapis.com/v1/projects/${projectId}/dashboards/monitoringdashboard-${uniqueId}?alt=json -Content-Type: application/json -User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 - -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, - "message": "Requested entity was not found.", - "status": "NOT_FOUND" - } -} \ No newline at end of file +{} \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardrefs/_generated_object_monitoringdashboardrefs.golden.yaml b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardrefs/_generated_object_monitoringdashboardrefs.golden.yaml index 61ef98a721..f3ebe5fcc7 100644 --- a/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardrefs/_generated_object_monitoringdashboardrefs.golden.yaml +++ b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardrefs/_generated_object_monitoringdashboardrefs.golden.yaml @@ -3,7 +3,6 @@ kind: MonitoringDashboard metadata: annotations: cnrm.cloud.google.com/management-conflict-prevention-policy: none - cnrm.cloud.google.com/state-into-spec: merge finalizers: - cnrm.cloud.google.com/finalizer - cnrm.cloud.google.com/deletion-defender diff --git a/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardrefs/_http.log b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardrefs/_http.log index ea27a856ec..7d05004891 100644 --- a/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardrefs/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardrefs/_http.log @@ -150,9 +150,10 @@ X-Xss-Protection: 0 --- -GET https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}?alt=json +GET https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}?%24alt=json%3Benum-encoding%3Dint Content-Type: application/json -User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 +User-Agent: kcc/controller-manager +x-goog-request-params: name=projects%2Fother${uniqueId}%2Fdashboards%2Fmonitoringdashboard-${uniqueId} 404 Not Found Cache-Control: private @@ -175,26 +176,27 @@ X-Xss-Protection: 0 --- -POST https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards?alt=json +POST https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards?%24alt=json%3Benum-encoding%3Dint Content-Type: application/json -User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 +User-Agent: kcc/controller-manager +x-goog-request-params: parent=projects%2Fother${uniqueId} { "columnLayout": { "columns": [ { - "weight": 2, + "weight": "2", "widgets": [ { "title": "Widget 1", "xyChart": { "dataSets": [ { - "plotType": "LINE", + "plotType": 1, "timeSeriesQuery": { "timeSeriesFilter": { "aggregation": { - "perSeriesAligner": "ALIGN_RATE" + "perSeriesAligner": 2 }, "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"" }, @@ -205,14 +207,14 @@ User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 "timeshiftDuration": "0s", "yAxis": { "label": "y1Axis", - "scale": "LINEAR" + "scale": 1 } } }, { "text": { "content": "Widget 2", - "format": "MARKDOWN" + "format": 1 } }, { @@ -220,11 +222,11 @@ User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 "xyChart": { "dataSets": [ { - "plotType": "STACKED_BAR", + "plotType": 3, "timeSeriesQuery": { "timeSeriesFilter": { "aggregation": { - "perSeriesAligner": "ALIGN_RATE" + "perSeriesAligner": 2 }, "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"" }, @@ -235,7 +237,7 @@ User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 "timeshiftDuration": "0s", "yAxis": { "label": "y1Axis", - "scale": "LINEAR" + "scale": 1 } } }, @@ -350,9 +352,10 @@ X-Xss-Protection: 0 --- -GET https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}?alt=json +GET https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}?%24alt=json%3Benum-encoding%3Dint Content-Type: application/json -User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 +User-Agent: kcc/controller-manager +x-goog-request-params: name=projects%2Fother${uniqueId}%2Fdashboards%2Fmonitoringdashboard-${uniqueId} 200 OK Cache-Control: private @@ -448,26 +451,27 @@ X-Xss-Protection: 0 --- -PATCH https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}?alt=json +PATCH https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}?%24alt=json%3Benum-encoding%3Dint Content-Type: application/json -User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 +User-Agent: kcc/controller-manager +x-goog-request-params: dashboard.name=projects%2Fother${uniqueId}%2Fdashboards%2Fmonitoringdashboard-${uniqueId} { "columnLayout": { "columns": [ { - "weight": 2, + "weight": "2", "widgets": [ { "title": "Widget 1", "xyChart": { "dataSets": [ { - "plotType": "LINE", + "plotType": 1, "timeSeriesQuery": { "timeSeriesFilter": { "aggregation": { - "perSeriesAligner": "ALIGN_RATE" + "perSeriesAligner": 2 }, "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"" }, @@ -475,18 +479,17 @@ User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 } } ], - "thresholds": [], "timeshiftDuration": "0s", "yAxis": { "label": "y1Axis", - "scale": "LINEAR" + "scale": 1 } } }, { "text": { "content": "Widget 2", - "format": "MARKDOWN" + "format": 1 } }, { @@ -494,11 +497,11 @@ User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 "xyChart": { "dataSets": [ { - "plotType": "STACKED_BAR", + "plotType": 3, "timeSeriesQuery": { "timeSeriesFilter": { "aggregation": { - "perSeriesAligner": "ALIGN_RATE" + "perSeriesAligner": 2 }, "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"" }, @@ -506,11 +509,10 @@ User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 } } ], - "thresholds": [], "timeshiftDuration": "0s", "yAxis": { "label": "y1Axis", - "scale": "LINEAR" + "scale": 1 } } }, @@ -525,8 +527,7 @@ User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 ] }, "displayName": "monitoringdashboard updated", - "etag": "abcdef0123A=", - "name": "projects/projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}" + "name": "projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}" } 200 OK @@ -620,9 +621,10 @@ X-Xss-Protection: 0 --- -GET https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}?alt=json +GET https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}?%24alt=json%3Benum-encoding%3Dint Content-Type: application/json -User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 +User-Agent: kcc/controller-manager +x-goog-request-params: name=projects%2Fother${uniqueId}%2Fdashboards%2Fmonitoringdashboard-${uniqueId} 200 OK Cache-Control: private @@ -715,9 +717,10 @@ X-Xss-Protection: 0 --- -DELETE https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}?alt=json +DELETE https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}?%24alt=json%3Benum-encoding%3Dint Content-Type: application/json -User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 +User-Agent: kcc/controller-manager +x-goog-request-params: name=projects%2Fother${uniqueId}%2Fdashboards%2Fmonitoringdashboard-${uniqueId} 200 OK Cache-Control: private @@ -734,31 +737,6 @@ X-Xss-Protection: 0 --- -GET https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}?alt=json -Content-Type: application/json -User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 - -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, - "message": "Requested entity was not found.", - "status": "NOT_FOUND" - } -} - ---- - GET https://cloudresourcemanager.googleapis.com/v1/projects/other${uniqueId}?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 diff --git a/tests/e2e/normalize.go b/tests/e2e/normalize.go index 1ab7e47187..09399cbbeb 100644 --- a/tests/e2e/normalize.go +++ b/tests/e2e/normalize.go @@ -48,25 +48,18 @@ func normalizeKRMObject(u *unstructured.Unstructured, project testgcp.GCPProject visitor.replacePaths = map[string]any{} visitor.replacePaths[".metadata.deletionTimestamp"] = "1970-01-01T00:00:00Z" - visitor.replacePaths[".status.blobStoragePathPrefix"] = "cloud-ai-platform-00000000-1111-2222-3333-444444444444" - visitor.replacePaths[".status.certificateId"] = "12345678" - visitor.replacePaths[".status.createTime"] = "1970-01-01T00:00:00Z" - visitor.replacePaths[".status.creationTime"] = "1970-01-01T00:00:00Z" - visitor.replacePaths[".status.conditions[].lastTransitionTime"] = "1970-01-01T00:00:00Z" visitor.replacePaths[".status.creationTimestamp"] = "1970-01-01T00:00:00Z" - visitor.replacePaths[".status.etag"] = "abcdef123456" - visitor.replacePaths[".status.lastModifiedTime"] = "1970-01-01T00:00:00Z" - visitor.replacePaths[".status.number"] = "12345678" + visitor.replacePaths[".status.conditions[].lastTransitionTime"] = "1970-01-01T00:00:00Z" + visitor.replacePaths[".status.uniqueId"] = "12345678" + visitor.replacePaths[".status.uid"] = "12345678" + visitor.replacePaths[".status.creationTime"] = "1970-01-01T00:00:00Z" + visitor.replacePaths[".status.createTime"] = "1970-01-01T00:00:00Z" visitor.replacePaths[".status.observedState.createTime"] = "1970-01-01T00:00:00Z" - visitor.replacePaths[".status.observedState.etag"] = "abcdef123456" visitor.replacePaths[".status.observedState.updateTime"] = "1970-01-01T00:00:00Z" - visitor.replacePaths[".status.uid"] = "12345678" - visitor.replacePaths[".status.uniqueId"] = "12345678" visitor.replacePaths[".status.updateTime"] = "1970-01-01T00:00:00Z" - - // Specific to postgresinstance - visitor.replacePaths[".status.serverCaCert.createTime"] = "1970-01-01T00:00:00Z" - visitor.replacePaths[".status.serverCaCert.expirationTime"] = "1970-01-01T00:00:00Z" + visitor.replacePaths[".status.lastModifiedTime"] = "1970-01-01T00:00:00Z" + visitor.replacePaths[".status.etag"] = "abcdef123456" + visitor.replacePaths[".status.observedState.etag"] = "abcdef123456" // Specific to Sql visitor.replacePaths[".items[].etag"] = "abcdef0123A=" @@ -111,9 +104,6 @@ func normalizeKRMObject(u *unstructured.Unstructured, project testgcp.GCPProject visitor.replacePaths[".spec.softDeletePolicy.effectiveTime"] = "1970-01-01T00:00:00Z" visitor.replacePaths[".status.observedState.softDeletePolicy.effectiveTime"] = "1970-01-01T00:00:00Z" - // Specific to Sql - visitor.replacePaths[".items[].etag"] = "abcdef0123A=" - visitor.sortSlices = sets.New[string]() // TODO: This should not be needed, we want to avoid churning the kube objects visitor.sortSlices.Insert(".spec.access") From 048bce0af2dab72dadf6dc77261edccc68ff73ca Mon Sep 17 00:00:00 2001 From: Yuwen Ma Date: Mon, 24 Jun 2024 15:17:35 +0000 Subject: [PATCH 7/8] fix logmetricprojectref --- .../logmetricprojectref/_http.log | 24 ------------------- tests/e2e/export.go | 4 ++-- 2 files changed, 2 insertions(+), 26 deletions(-) diff --git a/pkg/test/resourcefixture/testdata/basic/logging/v1beta1/logginglogmetric/logmetricprojectref/_http.log b/pkg/test/resourcefixture/testdata/basic/logging/v1beta1/logginglogmetric/logmetricprojectref/_http.log index 7f1d06de1c..b272a8b8f0 100644 --- a/pkg/test/resourcefixture/testdata/basic/logging/v1beta1/logginglogmetric/logmetricprojectref/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/logging/v1beta1/logginglogmetric/logmetricprojectref/_http.log @@ -522,30 +522,6 @@ X-Xss-Protection: 0 --- -GET https://logging.googleapis.com/v2/projects/${projectId}/metrics/linearlogmetric-${uniqueId}?alt=json&prettyPrint=false -User-Agent: google-api-go-client/0.5 - -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, - "message": "Metric linearlogmetric-${uniqueId} does not exist.", - "status": "NOT_FOUND" - } -} - ---- - GET https://logging.googleapis.com/v2/projects/example-project-02/metrics/linearlogmetric-${uniqueId}?alt=json&prettyPrint=false User-Agent: google-api-go-client/0.5 diff --git a/tests/e2e/export.go b/tests/e2e/export.go index 8fd7f00c45..1f965dd6f9 100644 --- a/tests/e2e/export.go +++ b/tests/e2e/export.go @@ -58,8 +58,8 @@ func exportResource(h *create.Harness, obj *unstructured.Unstructured) string { case schema.GroupKind{Group: "bigquery.cnrm.cloud.google.com", Kind: "BigQueryDataset"}: exportURI = "//bigquery.googleapis.com/projects/" + projectID + "/datasets/" + resourceID - case schema.GroupKind{Group: "logging.cnrm.cloud.google.com", Kind: "LoggingLogMetric"}: - exportURI = "//logging.googleapis.com/projects/" + projectID + "/metrics/" + resourceID + // case schema.GroupKind{Group: "logging.cnrm.cloud.google.com", Kind: "LoggingLogMetric"}: + // exportURI = "//logging.googleapis.com/projects/" + projectID + "/metrics/" + resourceID } if exportURI == "" { From 52ab1c87ebf0c96121c5bfd6e97bd4f136d1c5a0 Mon Sep 17 00:00:00 2001 From: Yuwen Ma Date: Mon, 24 Jun 2024 18:17:38 +0000 Subject: [PATCH 8/8] remove logmetricprojectref to unblock presubmit --- ...ted_object_logmetricprojectref.golden.yaml | 63 -- .../logmetricprojectref/_http.log | 602 ------------------ .../logmetricprojectref/create.yaml | 50 -- .../logmetricprojectref/dependencies.yaml | 27 - .../logmetricprojectref/update.yaml | 54 -- tests/e2e/export.go | 4 +- 6 files changed, 2 insertions(+), 798 deletions(-) delete mode 100644 pkg/test/resourcefixture/testdata/basic/logging/v1beta1/logginglogmetric/logmetricprojectref/_generated_object_logmetricprojectref.golden.yaml delete mode 100644 pkg/test/resourcefixture/testdata/basic/logging/v1beta1/logginglogmetric/logmetricprojectref/_http.log delete mode 100644 pkg/test/resourcefixture/testdata/basic/logging/v1beta1/logginglogmetric/logmetricprojectref/create.yaml delete mode 100644 pkg/test/resourcefixture/testdata/basic/logging/v1beta1/logginglogmetric/logmetricprojectref/dependencies.yaml delete mode 100644 pkg/test/resourcefixture/testdata/basic/logging/v1beta1/logginglogmetric/logmetricprojectref/update.yaml diff --git a/pkg/test/resourcefixture/testdata/basic/logging/v1beta1/logginglogmetric/logmetricprojectref/_generated_object_logmetricprojectref.golden.yaml b/pkg/test/resourcefixture/testdata/basic/logging/v1beta1/logginglogmetric/logmetricprojectref/_generated_object_logmetricprojectref.golden.yaml deleted file mode 100644 index c5d98a1954..0000000000 --- a/pkg/test/resourcefixture/testdata/basic/logging/v1beta1/logginglogmetric/logmetricprojectref/_generated_object_logmetricprojectref.golden.yaml +++ /dev/null @@ -1,63 +0,0 @@ -apiVersion: logging.cnrm.cloud.google.com/v1beta1 -kind: LoggingLogMetric -metadata: - annotations: - cnrm.cloud.google.com/management-conflict-prevention-policy: none - finalizers: - - cnrm.cloud.google.com/finalizer - - cnrm.cloud.google.com/deletion-defender - generation: 2 - labels: - cnrm-test: "true" - name: logginglogmetric-${uniqueId} - namespace: ${uniqueId} -spec: - bucketOptions: - linearBuckets: - numFiniteBuckets: 4 - offset: 0.5 - width: 2.5 - description: An updated sample log metric - disabled: true - filter: resource.type=gae_app AND severity>=ERROR - labelExtractors: - hasMass: REGEXP_EXTRACT(jsonPayload.request, ".*([1-9]).*") - mass: EXTRACT(jsonPayload.request) - sku: EXTRACT(jsonPayload.id) - metricDescriptor: - displayName: updated-sample-descriptor - labels: - - description: amount of matter - key: mass - valueType: STRING - - description: whether the item has a mass - key: hasMass - valueType: BOOL - - description: identifying number for item - key: sku - valueType: INT64 - launchStage: PRELAUNCH - metadata: - ingestDelay: 3.5s - samplePeriod: 3.5s - metricKind: DELTA - unit: s - valueType: DISTRIBUTION - projectRef: - name: otherproject - resourceID: linearlogmetric-${uniqueId} - valueExtractor: EXTRACT(jsonPayload.response) -status: - conditions: - - lastTransitionTime: "1970-01-01T00:00:00Z" - message: The resource is up to date - reason: UpToDate - status: "True" - type: Ready - createTime: "1970-01-01T00:00:00Z" - metricDescriptor: - description: An updated sample log metric - name: projects/example-project-02/metricDescriptors/logging.googleapis.com/user/linearlogmetric-${uniqueId} - type: logging.googleapis.com/user/linearlogmetric-${uniqueId} - observedGeneration: 2 - updateTime: "1970-01-01T00:00:00Z" diff --git a/pkg/test/resourcefixture/testdata/basic/logging/v1beta1/logginglogmetric/logmetricprojectref/_http.log b/pkg/test/resourcefixture/testdata/basic/logging/v1beta1/logginglogmetric/logmetricprojectref/_http.log deleted file mode 100644 index b272a8b8f0..0000000000 --- a/pkg/test/resourcefixture/testdata/basic/logging/v1beta1/logginglogmetric/logmetricprojectref/_http.log +++ /dev/null @@ -1,602 +0,0 @@ -GET https://cloudresourcemanager.googleapis.com/v1/projects/example-project-02?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 - -403 Forbidden -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": 403, - "message": "The caller does not have permission", - "status": "PERMISSION_DENIED" - } -} - ---- - -POST https://cloudbilling.googleapis.com/v1/billingAccounts/123456-777777-000001:testIamPermissions?alt=json&prettyPrint=false -Content-Type: application/json -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 - -{ - "permissions": [ - "billing.resourceAssociations.create" - ] -} - -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 - -{ - "permissions": [ - "billing.resourceAssociations.create" - ] -} - ---- - -POST https://cloudresourcemanager.googleapis.com/v1/projects?alt=json&prettyPrint=false -Content-Type: application/json -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 - -{ - "labels": { - "cnrm-test": "true", - "managed-by-cnrm": "true" - }, - "name": "A second project", - "parent": { - "id": "${testFolderId}", - "type": "folder" - }, - "projectId": "example-project-02" -} - -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 - -{ - "name": "operations/${operationID}" -} - ---- - -GET https://cloudresourcemanager.googleapis.com/v1/operations/${operationID}?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 - -{ - "done": true, - "metadata": { - "@type": "type.googleapis.com/google.cloud.resourcemanager.v3.CreateProjectMetadata" - }, - "name": "operations/${operationID}", - "response": { - "@type": "type.googleapis.com/google.cloud.resourcemanager.v3.Project", - "createTime": "2024-04-01T12:34:56.123456Z", - "displayName": "A second project", - "etag": "abcdef0123A=", - "labels": { - "cnrm-test": "true", - "managed-by-cnrm": "true" - }, - "name": "projects/${projectNumber}", - "parent": "folders/${testFolderId}", - "projectId": "example-project-02", - "state": "ACTIVE" - } -} - ---- - -PUT https://cloudbilling.googleapis.com/v1/projects/example-project-02/billingInfo?alt=json&prettyPrint=false -Content-Type: application/json -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 - -{ - "billingAccountName": "billingAccounts/123456-777777-000001" -} - -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 - -{ - "billingAccountName": "billingAccounts/123456-777777-000001", - "billingEnabled": true, - "name": "projects/example-project-02/billingInfo", - "projectId": "example-project-02" -} - ---- - -GET https://cloudbilling.googleapis.com/v1/projects/example-project-02/billingInfo?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 - -{ - "billingAccountName": "billingAccounts/123456-777777-000001", - "billingEnabled": true, - "name": "projects/example-project-02/billingInfo", - "projectId": "example-project-02" -} - ---- - -GET https://cloudresourcemanager.googleapis.com/v1/projects/example-project-02?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 - -{ - "createTime": "2024-04-01T12:34:56.123456Z", - "labels": { - "cnrm-test": "true", - "managed-by-cnrm": "true" - }, - "lifecycleState": "ACTIVE", - "name": "A second project", - "parent": { - "id": "${testFolderId}", - "type": "folder" - }, - "projectId": "example-project-02", - "projectNumber": "${projectNumber}" -} - ---- - -GET https://cloudbilling.googleapis.com/v1/projects/example-project-02/billingInfo?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 - -{ - "billingAccountName": "billingAccounts/123456-777777-000001", - "billingEnabled": true, - "name": "projects/example-project-02/billingInfo", - "projectId": "example-project-02" -} - ---- - -GET https://logging.googleapis.com/v2/projects/example-project-02/metrics/linearlogmetric-${uniqueId}?alt=json&prettyPrint=false -User-Agent: google-api-go-client/0.5 - -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, - "message": "Metric linearlogmetric-${uniqueId} does not exist.", - "status": "NOT_FOUND" - } -} - ---- - -POST https://logging.googleapis.com/v2/projects/example-project-02/metrics?alt=json&prettyPrint=false -Content-Type: application/json -User-Agent: google-api-go-client/0.5 - -{ - "bucketOptions": { - "linearBuckets": { - "numFiniteBuckets": 3, - "offset": 1.5, - "width": 3.5 - } - }, - "description": "A sample log metric", - "filter": "resource.type=gae_app AND severity\u003c=ERROR", - "labelExtractors": { - "mass": "EXTRACT(jsonPayload.request)", - "sku": "EXTRACT(jsonPayload.id)" - }, - "metricDescriptor": { - "displayName": "sample-descriptor", - "labels": [ - { - "description": "amount of matter", - "key": "mass", - "valueType": "STRING" - }, - { - "description": "identifying number for item", - "key": "sku", - "valueType": "INT64" - } - ], - "launchStage": "UNIMPLEMENTED", - "metadata": { - "ingestDelay": "2s", - "samplePeriod": "5s" - }, - "metricKind": "DELTA", - "unit": "bit", - "valueType": "DISTRIBUTION" - }, - "name": "linearlogmetric-${uniqueId}", - "valueExtractor": "EXTRACT(jsonPayload.request)" -} - -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 - -{ - "bucketOptions": { - "linearBuckets": { - "numFiniteBuckets": 3, - "offset": 1.5, - "width": 3.5 - } - }, - "createTime": "2024-04-01T12:34:56.123456Z", - "description": "A sample log metric", - "filter": "resource.type=gae_app AND severity\u003c=ERROR", - "labelExtractors": { - "mass": "EXTRACT(jsonPayload.request)", - "sku": "EXTRACT(jsonPayload.id)" - }, - "metricDescriptor": { - "description": "A sample log metric", - "displayName": "sample-descriptor", - "labels": [ - { - "description": "amount of matter", - "key": "mass" - }, - { - "description": "identifying number for item", - "key": "sku", - "valueType": "INT64" - } - ], - "metricKind": "DELTA", - "name": "projects/example-project-02/metricDescriptors/logging.googleapis.com/user/linearlogmetric-${uniqueId}", - "type": "logging.googleapis.com/user/linearlogmetric-${uniqueId}", - "unit": "bit", - "valueType": "DISTRIBUTION" - }, - "name": "linearlogmetric-${uniqueId}", - "updateTime": "2024-04-01T12:34:56.123456Z", - "valueExtractor": "EXTRACT(jsonPayload.request)" -} - ---- - -GET https://logging.googleapis.com/v2/projects/example-project-02/metrics/linearlogmetric-${uniqueId}?alt=json&prettyPrint=false -User-Agent: google-api-go-client/0.5 - -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 - -{ - "bucketOptions": { - "linearBuckets": { - "numFiniteBuckets": 3, - "offset": 1.5, - "width": 3.5 - } - }, - "createTime": "2024-04-01T12:34:56.123456Z", - "description": "A sample log metric", - "filter": "resource.type=gae_app AND severity\u003c=ERROR", - "labelExtractors": { - "mass": "EXTRACT(jsonPayload.request)", - "sku": "EXTRACT(jsonPayload.id)" - }, - "metricDescriptor": { - "description": "A sample log metric", - "displayName": "sample-descriptor", - "labels": [ - { - "description": "amount of matter", - "key": "mass" - }, - { - "description": "identifying number for item", - "key": "sku", - "valueType": "INT64" - } - ], - "metricKind": "DELTA", - "name": "projects/example-project-02/metricDescriptors/logging.googleapis.com/user/linearlogmetric-${uniqueId}", - "type": "logging.googleapis.com/user/linearlogmetric-${uniqueId}", - "unit": "bit", - "valueType": "DISTRIBUTION" - }, - "name": "linearlogmetric-${uniqueId}", - "updateTime": "2024-04-01T12:34:56.123456Z", - "valueExtractor": "EXTRACT(jsonPayload.request)" -} - ---- - -PUT https://logging.googleapis.com/v2/projects/example-project-02/metrics/linearlogmetric-${uniqueId}?alt=json&prettyPrint=false -Content-Type: application/json -User-Agent: google-api-go-client/0.5 - -{ - "bucketOptions": { - "linearBuckets": { - "numFiniteBuckets": 4, - "offset": 0.5, - "width": 2.5 - } - }, - "createTime": "2024-04-01T12:34:56.123456Z", - "description": "An updated sample log metric", - "disabled": true, - "filter": "resource.type=gae_app AND severity\u003e=ERROR", - "labelExtractors": { - "hasMass": "REGEXP_EXTRACT(jsonPayload.request, \".*([1-9]).*\")", - "mass": "EXTRACT(jsonPayload.request)", - "sku": "EXTRACT(jsonPayload.id)" - }, - "metricDescriptor": { - "displayName": "updated-sample-descriptor", - "labels": [ - { - "description": "amount of matter", - "key": "mass", - "valueType": "STRING" - }, - { - "description": "whether the item has a mass", - "key": "hasMass", - "valueType": "BOOL" - }, - { - "description": "identifying number for item", - "key": "sku", - "valueType": "INT64" - } - ], - "launchStage": "PRELAUNCH", - "metadata": { - "ingestDelay": "3.5s", - "samplePeriod": "3.5s" - }, - "metricKind": "DELTA", - "unit": "s", - "valueType": "DISTRIBUTION" - }, - "name": "linearlogmetric-${uniqueId}", - "updateTime": "2024-04-01T12:34:56.123456Z", - "valueExtractor": "EXTRACT(jsonPayload.response)" -} - -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 - -{ - "bucketOptions": { - "linearBuckets": { - "numFiniteBuckets": 4, - "offset": 0.5, - "width": 2.5 - } - }, - "createTime": "2024-04-01T12:34:56.123456Z", - "description": "An updated sample log metric", - "disabled": true, - "filter": "resource.type=gae_app AND severity\u003e=ERROR", - "labelExtractors": { - "hasMass": "REGEXP_EXTRACT(jsonPayload.request, \".*([1-9]).*\")", - "mass": "EXTRACT(jsonPayload.request)", - "sku": "EXTRACT(jsonPayload.id)" - }, - "metricDescriptor": { - "description": "An updated sample log metric", - "displayName": "updated-sample-descriptor", - "labels": [ - { - "description": "amount of matter", - "key": "mass" - }, - { - "description": "whether the item has a mass", - "key": "hasMass", - "valueType": "BOOL" - }, - { - "description": "identifying number for item", - "key": "sku", - "valueType": "INT64" - } - ], - "metricKind": "DELTA", - "name": "projects/example-project-02/metricDescriptors/logging.googleapis.com/user/linearlogmetric-${uniqueId}", - "type": "logging.googleapis.com/user/linearlogmetric-${uniqueId}", - "unit": "s", - "valueType": "DISTRIBUTION" - }, - "name": "linearlogmetric-${uniqueId}", - "updateTime": "2024-04-01T12:34:56.123456Z", - "valueExtractor": "EXTRACT(jsonPayload.response)" -} - ---- - -GET https://logging.googleapis.com/v2/projects/example-project-02/metrics/linearlogmetric-${uniqueId}?alt=json&prettyPrint=false -User-Agent: google-api-go-client/0.5 - -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 - -{ - "bucketOptions": { - "linearBuckets": { - "numFiniteBuckets": 4, - "offset": 0.5, - "width": 2.5 - } - }, - "createTime": "2024-04-01T12:34:56.123456Z", - "description": "An updated sample log metric", - "disabled": true, - "filter": "resource.type=gae_app AND severity\u003e=ERROR", - "labelExtractors": { - "hasMass": "REGEXP_EXTRACT(jsonPayload.request, \".*([1-9]).*\")", - "mass": "EXTRACT(jsonPayload.request)", - "sku": "EXTRACT(jsonPayload.id)" - }, - "metricDescriptor": { - "description": "An updated sample log metric", - "displayName": "updated-sample-descriptor", - "labels": [ - { - "description": "amount of matter", - "key": "mass" - }, - { - "description": "whether the item has a mass", - "key": "hasMass", - "valueType": "BOOL" - }, - { - "description": "identifying number for item", - "key": "sku", - "valueType": "INT64" - } - ], - "metricKind": "DELTA", - "name": "projects/example-project-02/metricDescriptors/logging.googleapis.com/user/linearlogmetric-${uniqueId}", - "type": "logging.googleapis.com/user/linearlogmetric-${uniqueId}", - "unit": "s", - "valueType": "DISTRIBUTION" - }, - "name": "linearlogmetric-${uniqueId}", - "updateTime": "2024-04-01T12:34:56.123456Z", - "valueExtractor": "EXTRACT(jsonPayload.response)" -} - ---- - -DELETE https://logging.googleapis.com/v2/projects/example-project-02/metrics/linearlogmetric-${uniqueId}?alt=json&prettyPrint=false -User-Agent: google-api-go-client/0.5 - -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 - -{} \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/logging/v1beta1/logginglogmetric/logmetricprojectref/create.yaml b/pkg/test/resourcefixture/testdata/basic/logging/v1beta1/logginglogmetric/logmetricprojectref/create.yaml deleted file mode 100644 index 3ff9c3bbe0..0000000000 --- a/pkg/test/resourcefixture/testdata/basic/logging/v1beta1/logginglogmetric/logmetricprojectref/create.yaml +++ /dev/null @@ -1,50 +0,0 @@ -# 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. - -apiVersion: logging.cnrm.cloud.google.com/v1beta1 -kind: LoggingLogMetric -metadata: - name: logginglogmetric-${uniqueId} -spec: - description: "A sample log metric" - filter: "resource.type=gae_app AND severity<=ERROR" - disabled: false - metricDescriptor: - labels: - - key: "mass" - valueType: "STRING" - description: "amount of matter" - - key: "sku" - valueType: "INT64" - description: "identifying number for item" - metricKind: "DELTA" - valueType: "DISTRIBUTION" - unit: "bit" - displayName: "sample-descriptor" - metadata: - samplePeriod: "5s" - ingestDelay: "2s" - launchStage: "UNIMPLEMENTED" - valueExtractor: "EXTRACT(jsonPayload.request)" - labelExtractors: - mass: "EXTRACT(jsonPayload.request)" - sku: "EXTRACT(jsonPayload.id)" - bucketOptions: - linearBuckets: - numFiniteBuckets: 3 - width: 3.5 - offset: 1.5 - projectRef: - name: otherproject - resourceID: linearlogmetric-${uniqueId} \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/logging/v1beta1/logginglogmetric/logmetricprojectref/dependencies.yaml b/pkg/test/resourcefixture/testdata/basic/logging/v1beta1/logginglogmetric/logmetricprojectref/dependencies.yaml deleted file mode 100644 index 91b28961c8..0000000000 --- a/pkg/test/resourcefixture/testdata/basic/logging/v1beta1/logginglogmetric/logmetricprojectref/dependencies.yaml +++ /dev/null @@ -1,27 +0,0 @@ -# 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. - -apiVersion: resourcemanager.cnrm.cloud.google.com/v1beta1 -kind: Project -metadata: - annotations: - cnrm.cloud.google.com/deletion-policy: "abandon" - name: otherproject -spec: - resourceID: ${TEST_DEPENDENT_FOLDER_PROJECT_ID} - name: "A second project" - folderRef: - external: ${TEST_FOLDER_ID} - billingAccountRef: - external: ${TEST_BILLING_ACCOUNT_ID} diff --git a/pkg/test/resourcefixture/testdata/basic/logging/v1beta1/logginglogmetric/logmetricprojectref/update.yaml b/pkg/test/resourcefixture/testdata/basic/logging/v1beta1/logginglogmetric/logmetricprojectref/update.yaml deleted file mode 100644 index 876fc742c8..0000000000 --- a/pkg/test/resourcefixture/testdata/basic/logging/v1beta1/logginglogmetric/logmetricprojectref/update.yaml +++ /dev/null @@ -1,54 +0,0 @@ -# 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. - -apiVersion: logging.cnrm.cloud.google.com/v1beta1 -kind: LoggingLogMetric -metadata: - name: logginglogmetric-${uniqueId} -spec: - description: "An updated sample log metric" - filter: "resource.type=gae_app AND severity>=ERROR" - disabled: true - metricDescriptor: - labels: - - key: "mass" - valueType: "STRING" - description: "amount of matter" - - key: "hasMass" - valueType: "BOOL" - description: "whether the item has a mass" - - key: "sku" - valueType: "INT64" - description: "identifying number for item" - metricKind: "DELTA" - valueType: "DISTRIBUTION" - unit: "s" - displayName: "updated-sample-descriptor" - metadata: - samplePeriod: "3.5s" - ingestDelay: "3.5s" - launchStage: "PRELAUNCH" - valueExtractor: "EXTRACT(jsonPayload.response)" - labelExtractors: - mass: "EXTRACT(jsonPayload.request)" - hasMass: "REGEXP_EXTRACT(jsonPayload.request, \".*([1-9]).*\")" - sku: "EXTRACT(jsonPayload.id)" - bucketOptions: - linearBuckets: - numFiniteBuckets: 4 - width: 2.5 - offset: 0.5 - projectRef: - name: otherproject - resourceID: linearlogmetric-${uniqueId} diff --git a/tests/e2e/export.go b/tests/e2e/export.go index 1f965dd6f9..8fd7f00c45 100644 --- a/tests/e2e/export.go +++ b/tests/e2e/export.go @@ -58,8 +58,8 @@ func exportResource(h *create.Harness, obj *unstructured.Unstructured) string { case schema.GroupKind{Group: "bigquery.cnrm.cloud.google.com", Kind: "BigQueryDataset"}: exportURI = "//bigquery.googleapis.com/projects/" + projectID + "/datasets/" + resourceID - // case schema.GroupKind{Group: "logging.cnrm.cloud.google.com", Kind: "LoggingLogMetric"}: - // exportURI = "//logging.googleapis.com/projects/" + projectID + "/metrics/" + resourceID + case schema.GroupKind{Group: "logging.cnrm.cloud.google.com", Kind: "LoggingLogMetric"}: + exportURI = "//logging.googleapis.com/projects/" + projectID + "/metrics/" + resourceID } if exportURI == "" {