From 1571eda17606d3caa7486398433b5f8ad3d65cda Mon Sep 17 00:00:00 2001 From: Yuwen Ma Date: Thu, 8 Aug 2024 04:14:48 +0000 Subject: [PATCH] feat: Add basic/full test suite for storageNotification --- pkg/test/constants/presubmitconstants_test.go | 3 +- ...object_storagenotificationbase.golden.yaml | 31 + .../storagenotificationbase/_http.log | 637 +++++++++++++++++ .../{ => storagenotificationbase}/create.yaml | 0 .../dependencies.yaml | 0 ...object_storagenotificationfull.golden.yaml | 38 + .../storagenotificationfull/_http.log | 664 ++++++++++++++++++ .../storagenotificationfull/create.yaml | 31 + .../storagenotificationfull/dependencies.yaml | 37 + 9 files changed, 1440 insertions(+), 1 deletion(-) create mode 100644 pkg/test/resourcefixture/testdata/basic/storage/v1beta1/storagenotification/storagenotificationbase/_generated_object_storagenotificationbase.golden.yaml create mode 100644 pkg/test/resourcefixture/testdata/basic/storage/v1beta1/storagenotification/storagenotificationbase/_http.log rename pkg/test/resourcefixture/testdata/basic/storage/v1beta1/storagenotification/{ => storagenotificationbase}/create.yaml (100%) rename pkg/test/resourcefixture/testdata/basic/storage/v1beta1/storagenotification/{ => storagenotificationbase}/dependencies.yaml (100%) create mode 100644 pkg/test/resourcefixture/testdata/basic/storage/v1beta1/storagenotification/storagenotificationfull/_generated_object_storagenotificationfull.golden.yaml create mode 100644 pkg/test/resourcefixture/testdata/basic/storage/v1beta1/storagenotification/storagenotificationfull/_http.log create mode 100644 pkg/test/resourcefixture/testdata/basic/storage/v1beta1/storagenotification/storagenotificationfull/create.yaml create mode 100644 pkg/test/resourcefixture/testdata/basic/storage/v1beta1/storagenotification/storagenotificationfull/dependencies.yaml diff --git a/pkg/test/constants/presubmitconstants_test.go b/pkg/test/constants/presubmitconstants_test.go index 251500938f..b795d18065 100644 --- a/pkg/test/constants/presubmitconstants_test.go +++ b/pkg/test/constants/presubmitconstants_test.go @@ -89,7 +89,7 @@ func TestValidTestName(t *testing.T) { return nil } // Test cases are the names of the leaf-node directory, only match on the lowest subdirectory name - if strings.HasSuffix(filepath.Dir(path), tc) { + if strings.Contains(filepath.Dir(path), tc) { found = true return nil } @@ -104,6 +104,7 @@ func TestValidTestName(t *testing.T) { } } } + func TestGetPresubmitLiteRegexString(t *testing.T) { s := GetPresubmitLiteRegexStringArray() // Check if string slice contains any test cases from the long running or diff --git a/pkg/test/resourcefixture/testdata/basic/storage/v1beta1/storagenotification/storagenotificationbase/_generated_object_storagenotificationbase.golden.yaml b/pkg/test/resourcefixture/testdata/basic/storage/v1beta1/storagenotification/storagenotificationbase/_generated_object_storagenotificationbase.golden.yaml new file mode 100644 index 0000000000..43667cdec0 --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/storage/v1beta1/storagenotification/storagenotificationbase/_generated_object_storagenotificationbase.golden.yaml @@ -0,0 +1,31 @@ +apiVersion: storage.cnrm.cloud.google.com/v1beta1 +kind: StorageNotification +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 + generation: 2 + labels: + cnrm-test: "true" + name: storagenotification-${uniqueId} + namespace: ${uniqueId} +spec: + bucketRef: + name: storagebucket-${uniqueId} + payloadFormat: JSON_API_V1 + resourceID: "1" + topicRef: + name: pubsubtopic-${uniqueId} +status: + conditions: + - lastTransitionTime: "1970-01-01T00:00:00Z" + message: The resource is up to date + reason: UpToDate + status: "True" + type: Ready + notificationId: "1" + observedGeneration: 2 + selfLink: https://www.googleapis.com/storage/v1/b/storagebucket-${uniqueId}/notificationConfigs/1 diff --git a/pkg/test/resourcefixture/testdata/basic/storage/v1beta1/storagenotification/storagenotificationbase/_http.log b/pkg/test/resourcefixture/testdata/basic/storage/v1beta1/storagenotification/storagenotificationbase/_http.log new file mode 100644 index 0000000000..824f863d4a --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/storage/v1beta1/storagenotification/storagenotificationbase/_http.log @@ -0,0 +1,637 @@ +GET https://storage.googleapis.com/storage/v1/b/storagebucket-${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 + +404 Not Found +Cache-Control: no-cache, no-store, max-age=0, must-revalidate +Content-Type: application/json; charset=UTF-8 +Expires: Mon, 01 Jan 1990 00:00:00 GMT +Pragma: no-cache +Server: UploadServer +Vary: Origin +Vary: X-Origin + +{ + "error": { + "code": 404, + "errors": [ + { + "domain": "global", + "message": "The specified bucket does not exist.", + "reason": "notFound" + } + ], + "message": "The specified bucket does not exist." + } +} + +--- + +POST https://storage.googleapis.com/storage/v1/b?alt=json&prettyPrint=false&project=${projectId} +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 + +{ + "iamConfiguration": { + "uniformBucketLevelAccess": { + "enabled": false + } + }, + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "lifecycle": { + "rule": [] + }, + "name": "storagebucket-${uniqueId}", + "storageClass": "STANDARD" +} + +200 OK +Cache-Control: no-cache, no-store, max-age=0, must-revalidate +Content-Type: application/json; charset=UTF-8 +Expires: Mon, 01 Jan 1990 00:00:00 GMT +Pragma: no-cache +Server: UploadServer +Vary: Origin +Vary: X-Origin + +{ + "etag": "abcdef0123A=", + "iamConfiguration": { + "bucketPolicyOnly": { + "enabled": false + }, + "publicAccessPrevention": "inherited", + "uniformBucketLevelAccess": { + "enabled": false + } + }, + "id": "000000000000000000000", + "kind": "storage#bucket", + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "location": "US", + "locationType": "multi-region", + "metageneration": "1", + "name": "storagebucket-${uniqueId}", + "projectNumber": "${projectNumber}", + "rpo": "DEFAULT", + "selfLink": "https://www.googleapis.com/storage/v1/b/storagebucket-${uniqueId}", + "softDeletePolicy": { + "effectiveTime": "2024-04-01T12:34:56.123456Z", + "retentionDurationSeconds": "604800" + }, + "storageClass": "STANDARD", + "timeCreated": "2024-04-01T12:34:56.123456Z", + "updated": "2024-04-01T12:34:56.123456Z" +} + +--- + +GET https://storage.googleapis.com/storage/v1/b/storagebucket-${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 + +200 OK +Cache-Control: private, max-age=0, must-revalidate, no-transform +Content-Type: application/json; charset=UTF-8 +Expires: {now+0m} +Server: UploadServer +Vary: Origin +Vary: X-Origin + +{ + "etag": "abcdef0123A=", + "iamConfiguration": { + "bucketPolicyOnly": { + "enabled": false + }, + "publicAccessPrevention": "inherited", + "uniformBucketLevelAccess": { + "enabled": false + } + }, + "id": "000000000000000000000", + "kind": "storage#bucket", + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "location": "US", + "locationType": "multi-region", + "metageneration": "1", + "name": "storagebucket-${uniqueId}", + "projectNumber": "${projectNumber}", + "rpo": "DEFAULT", + "selfLink": "https://www.googleapis.com/storage/v1/b/storagebucket-${uniqueId}", + "softDeletePolicy": { + "effectiveTime": "2024-04-01T12:34:56.123456Z", + "retentionDurationSeconds": "604800" + }, + "storageClass": "STANDARD", + "timeCreated": "2024-04-01T12:34:56.123456Z", + "updated": "2024-04-01T12:34:56.123456Z" +} + +--- + +GET https://pubsub.googleapis.com/v1/projects/${projectId}/topics/pubsubtopic-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +404 Not Found +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "error": { + "code": 404, + "message": "Resource not found (resource=pubsubtopic-${uniqueId}).", + "status": "NOT_FOUND" + } +} + +--- + +PUT https://pubsub.googleapis.com/v1/projects/${projectId}/topics/pubsubtopic-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +{ + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + } +} + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "messageStoragePolicy": { + "allowedPersistenceRegions": [ + "asia-east1", + "asia-northeast1", + "asia-southeast1", + "australia-southeast1", + "europe-north1", + "europe-west1", + "europe-west2", + "europe-west3", + "europe-west4", + "southamerica-west1", + "us-central1", + "us-central2", + "us-east1", + "us-east4", + "us-east5", + "us-east7", + "us-south1", + "us-west1", + "us-west2", + "us-west3", + "us-west4", + "us-west8" + ] + }, + "name": "projects/${projectId}/topics/pubsubtopic-${uniqueId}" +} + +--- + +GET https://pubsub.googleapis.com/v1/projects/${projectId}/topics/pubsubtopic-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "messageStoragePolicy": { + "allowedPersistenceRegions": [ + "asia-east1", + "asia-northeast1", + "asia-southeast1", + "australia-southeast1", + "europe-north1", + "europe-west1", + "europe-west2", + "europe-west3", + "europe-west4", + "southamerica-west1", + "us-central1", + "us-central2", + "us-east1", + "us-east4", + "us-east5", + "us-east7", + "us-south1", + "us-west1", + "us-west2", + "us-west3", + "us-west4", + "us-west8" + ] + }, + "name": "projects/${projectId}/topics/pubsubtopic-${uniqueId}" +} + +--- + +GET https://pubsub.googleapis.com/v1/projects/${projectId}/topics/pubsubtopic-${uniqueId}:getIamPolicy?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 + +{ + "etag": "abcdef0123A=" +} + +--- + +POST https://pubsub.googleapis.com/v1/projects/${projectId}/topics/pubsubtopic-${uniqueId}:setIamPolicy?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 + +{ + "policy": { + "bindings": [ + { + "members": [ + "serviceAccount:service-${projectNumber}@gs-project-accounts.iam.gserviceaccount.com" + ], + "role": "roles/pubsub.publisher" + } + ], + "version": 3 + } +} + +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 + +{ + "bindings": [ + { + "members": [ + "serviceAccount:service-${projectNumber}@gs-project-accounts.iam.gserviceaccount.com" + ], + "role": "roles/pubsub.publisher" + } + ], + "etag": "abcdef0123A=", + "version": 1 +} + +--- + +GET https://pubsub.googleapis.com/v1/projects/${projectId}/topics/pubsubtopic-${uniqueId}:getIamPolicy?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 + +{ + "bindings": [ + { + "members": [ + "serviceAccount:service-${projectNumber}@gs-project-accounts.iam.gserviceaccount.com" + ], + "role": "roles/pubsub.publisher" + } + ], + "etag": "abcdef0123A=", + "version": 1 +} + +--- + +POST https://storage.googleapis.com/storage/v1/b/storagebucket-${uniqueId}/notificationConfigs?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 + +{ + "payload_format": "JSON_API_V1", + "topic": "projects/${projectId}/topics/pubsubtopic-${uniqueId}" +} + +200 OK +Cache-Control: no-cache, no-store, max-age=0, must-revalidate +Content-Type: application/json; charset=UTF-8 +Expires: Mon, 01 Jan 1990 00:00:00 GMT +Pragma: no-cache +Server: UploadServer +Vary: Origin +Vary: X-Origin + +{ + "etag": "abcdef0123A=", + "id": "000000000000000000000", + "kind": "storage#notification", + "payload_format": "JSON_API_V1", + "selfLink": "https://www.googleapis.com/storage/v1/b/storagebucket-${uniqueId}/notificationConfigs/1", + "topic": "//pubsub.googleapis.com/projects/${projectId}/topics/pubsubtopic-${uniqueId}" +} + +--- + +GET https://storage.googleapis.com/storage/v1/b/storagebucket-${uniqueId}/notificationConfigs/1?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, max-age=0, must-revalidate, no-transform +Content-Type: application/json; charset=UTF-8 +Expires: {now+0m} +Server: UploadServer +Vary: Origin +Vary: X-Origin + +{ + "etag": "abcdef0123A=", + "id": "000000000000000000000", + "kind": "storage#notification", + "payload_format": "JSON_API_V1", + "selfLink": "https://www.googleapis.com/storage/v1/b/storagebucket-${uniqueId}/notificationConfigs/1", + "topic": "//pubsub.googleapis.com/projects/${projectId}/topics/pubsubtopic-${uniqueId}" +} + +--- + +DELETE https://storage.googleapis.com/storage/v1/b/storagebucket-${uniqueId}/notificationConfigs/1?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 + +204 No Content +Cache-Control: no-cache, no-store, max-age=0, must-revalidate +Content-Type: application/json +Expires: Mon, 01 Jan 1990 00:00:00 GMT +Pragma: no-cache +Server: UploadServer +Vary: Origin +Vary: X-Origin + + +--- + +GET https://pubsub.googleapis.com/v1/projects/${projectId}/topics/pubsubtopic-${uniqueId}:getIamPolicy?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 + +{ + "bindings": [ + { + "members": [ + "serviceAccount:service-${projectNumber}@gs-project-accounts.iam.gserviceaccount.com" + ], + "role": "roles/pubsub.publisher" + } + ], + "etag": "abcdef0123A=", + "version": 1 +} + +--- + +POST https://pubsub.googleapis.com/v1/projects/${projectId}/topics/pubsubtopic-${uniqueId}:setIamPolicy?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 + +{ + "policy": { + "etag": "abcdef0123A=", + "version": 3 + } +} + +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 + +{ + "etag": "abcdef0123A=", + "version": 1 +} + +--- + +GET https://pubsub.googleapis.com/v1/projects/${projectId}/topics/pubsubtopic-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "messageStoragePolicy": { + "allowedPersistenceRegions": [ + "asia-east1", + "asia-northeast1", + "asia-southeast1", + "australia-southeast1", + "europe-north1", + "europe-west1", + "europe-west2", + "europe-west3", + "europe-west4", + "southamerica-west1", + "us-central1", + "us-central2", + "us-east1", + "us-east4", + "us-east5", + "us-east7", + "us-south1", + "us-west1", + "us-west2", + "us-west3", + "us-west4", + "us-west8" + ] + }, + "name": "projects/${projectId}/topics/pubsubtopic-${uniqueId}" +} + +--- + +DELETE https://pubsub.googleapis.com/v1/projects/${projectId}/topics/pubsubtopic-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{} + +--- + +GET https://storage.googleapis.com/storage/v1/b/storagebucket-${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 + +200 OK +Cache-Control: private, max-age=0, must-revalidate, no-transform +Content-Type: application/json; charset=UTF-8 +Expires: {now+0m} +Server: UploadServer +Vary: Origin +Vary: X-Origin + +{ + "etag": "abcdef0123A=", + "iamConfiguration": { + "bucketPolicyOnly": { + "enabled": false + }, + "publicAccessPrevention": "inherited", + "uniformBucketLevelAccess": { + "enabled": false + } + }, + "id": "000000000000000000000", + "kind": "storage#bucket", + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "location": "US", + "locationType": "multi-region", + "metageneration": "3", + "name": "storagebucket-${uniqueId}", + "projectNumber": "${projectNumber}", + "rpo": "DEFAULT", + "selfLink": "https://www.googleapis.com/storage/v1/b/storagebucket-${uniqueId}", + "softDeletePolicy": { + "effectiveTime": "2024-04-01T12:34:56.123456Z", + "retentionDurationSeconds": "604800" + }, + "storageClass": "STANDARD", + "timeCreated": "2024-04-01T12:34:56.123456Z", + "updated": "2024-04-01T12:34:56.123456Z" +} + +--- + +GET https://storage.googleapis.com/storage/v1/b/storagebucket-${uniqueId}/o?alt=json&prettyPrint=false&versions=true +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, max-age=0, must-revalidate, no-transform +Content-Type: application/json; charset=UTF-8 +Expires: {now+0m} +Server: UploadServer +Vary: Origin +Vary: X-Origin + +{ + "kind": "storage#objects" +} + +--- + +DELETE https://storage.googleapis.com/storage/v1/b/storagebucket-${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 + +204 No Content +Cache-Control: no-cache, no-store, max-age=0, must-revalidate +Content-Type: application/json +Expires: Mon, 01 Jan 1990 00:00:00 GMT +Pragma: no-cache +Server: UploadServer +Vary: Origin +Vary: X-Origin \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/storage/v1beta1/storagenotification/create.yaml b/pkg/test/resourcefixture/testdata/basic/storage/v1beta1/storagenotification/storagenotificationbase/create.yaml similarity index 100% rename from pkg/test/resourcefixture/testdata/basic/storage/v1beta1/storagenotification/create.yaml rename to pkg/test/resourcefixture/testdata/basic/storage/v1beta1/storagenotification/storagenotificationbase/create.yaml diff --git a/pkg/test/resourcefixture/testdata/basic/storage/v1beta1/storagenotification/dependencies.yaml b/pkg/test/resourcefixture/testdata/basic/storage/v1beta1/storagenotification/storagenotificationbase/dependencies.yaml similarity index 100% rename from pkg/test/resourcefixture/testdata/basic/storage/v1beta1/storagenotification/dependencies.yaml rename to pkg/test/resourcefixture/testdata/basic/storage/v1beta1/storagenotification/storagenotificationbase/dependencies.yaml diff --git a/pkg/test/resourcefixture/testdata/basic/storage/v1beta1/storagenotification/storagenotificationfull/_generated_object_storagenotificationfull.golden.yaml b/pkg/test/resourcefixture/testdata/basic/storage/v1beta1/storagenotification/storagenotificationfull/_generated_object_storagenotificationfull.golden.yaml new file mode 100644 index 0000000000..b0e02f49cd --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/storage/v1beta1/storagenotification/storagenotificationfull/_generated_object_storagenotificationfull.golden.yaml @@ -0,0 +1,38 @@ +apiVersion: storage.cnrm.cloud.google.com/v1beta1 +kind: StorageNotification +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 + generation: 2 + labels: + cnrm-test: "true" + name: storagenotification-${uniqueId} + namespace: ${uniqueId} +spec: + bucketRef: + name: storagebucket-${uniqueId} + customAttributes: + key1: val1 + key2: val2 + eventTypes: + - OBJECT_FINALIZE + - OBJECT_METADATA_UPDATE + objectNamePrefix: configconnector- + payloadFormat: JSON_API_V1 + resourceID: "1" + topicRef: + name: pubsubtopic-${uniqueId} +status: + conditions: + - lastTransitionTime: "1970-01-01T00:00:00Z" + message: The resource is up to date + reason: UpToDate + status: "True" + type: Ready + notificationId: "1" + observedGeneration: 2 + selfLink: https://www.googleapis.com/storage/v1/b/storagebucket-${uniqueId}/notificationConfigs/1 diff --git a/pkg/test/resourcefixture/testdata/basic/storage/v1beta1/storagenotification/storagenotificationfull/_http.log b/pkg/test/resourcefixture/testdata/basic/storage/v1beta1/storagenotification/storagenotificationfull/_http.log new file mode 100644 index 0000000000..8d28bfbc6d --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/storage/v1beta1/storagenotification/storagenotificationfull/_http.log @@ -0,0 +1,664 @@ +GET https://storage.googleapis.com/storage/v1/b/storagebucket-${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 + +404 Not Found +Cache-Control: no-cache, no-store, max-age=0, must-revalidate +Content-Type: application/json; charset=UTF-8 +Expires: Mon, 01 Jan 1990 00:00:00 GMT +Pragma: no-cache +Server: UploadServer +Vary: Origin +Vary: X-Origin + +{ + "error": { + "code": 404, + "errors": [ + { + "domain": "global", + "message": "The specified bucket does not exist.", + "reason": "notFound" + } + ], + "message": "The specified bucket does not exist." + } +} + +--- + +POST https://storage.googleapis.com/storage/v1/b?alt=json&prettyPrint=false&project=${projectId} +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 + +{ + "iamConfiguration": { + "uniformBucketLevelAccess": { + "enabled": false + } + }, + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "lifecycle": { + "rule": [] + }, + "name": "storagebucket-${uniqueId}", + "storageClass": "STANDARD" +} + +200 OK +Cache-Control: no-cache, no-store, max-age=0, must-revalidate +Content-Type: application/json; charset=UTF-8 +Expires: Mon, 01 Jan 1990 00:00:00 GMT +Pragma: no-cache +Server: UploadServer +Vary: Origin +Vary: X-Origin + +{ + "etag": "abcdef0123A=", + "iamConfiguration": { + "bucketPolicyOnly": { + "enabled": false + }, + "publicAccessPrevention": "inherited", + "uniformBucketLevelAccess": { + "enabled": false + } + }, + "id": "000000000000000000000", + "kind": "storage#bucket", + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "location": "US", + "locationType": "multi-region", + "metageneration": "1", + "name": "storagebucket-${uniqueId}", + "projectNumber": "${projectNumber}", + "rpo": "DEFAULT", + "selfLink": "https://www.googleapis.com/storage/v1/b/storagebucket-${uniqueId}", + "softDeletePolicy": { + "effectiveTime": "2024-04-01T12:34:56.123456Z", + "retentionDurationSeconds": "604800" + }, + "storageClass": "STANDARD", + "timeCreated": "2024-04-01T12:34:56.123456Z", + "updated": "2024-04-01T12:34:56.123456Z" +} + +--- + +GET https://storage.googleapis.com/storage/v1/b/storagebucket-${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 + +200 OK +Cache-Control: private, max-age=0, must-revalidate, no-transform +Content-Type: application/json; charset=UTF-8 +Expires: {now+0m} +Server: UploadServer +Vary: Origin +Vary: X-Origin + +{ + "etag": "abcdef0123A=", + "iamConfiguration": { + "bucketPolicyOnly": { + "enabled": false + }, + "publicAccessPrevention": "inherited", + "uniformBucketLevelAccess": { + "enabled": false + } + }, + "id": "000000000000000000000", + "kind": "storage#bucket", + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "location": "US", + "locationType": "multi-region", + "metageneration": "1", + "name": "storagebucket-${uniqueId}", + "projectNumber": "${projectNumber}", + "rpo": "DEFAULT", + "selfLink": "https://www.googleapis.com/storage/v1/b/storagebucket-${uniqueId}", + "softDeletePolicy": { + "effectiveTime": "2024-04-01T12:34:56.123456Z", + "retentionDurationSeconds": "604800" + }, + "storageClass": "STANDARD", + "timeCreated": "2024-04-01T12:34:56.123456Z", + "updated": "2024-04-01T12:34:56.123456Z" +} + +--- + +GET https://pubsub.googleapis.com/v1/projects/${projectId}/topics/pubsubtopic-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +404 Not Found +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "error": { + "code": 404, + "message": "Resource not found (resource=pubsubtopic-${uniqueId}).", + "status": "NOT_FOUND" + } +} + +--- + +PUT https://pubsub.googleapis.com/v1/projects/${projectId}/topics/pubsubtopic-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +{ + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + } +} + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "messageStoragePolicy": { + "allowedPersistenceRegions": [ + "asia-east1", + "asia-northeast1", + "asia-southeast1", + "australia-southeast1", + "europe-north1", + "europe-west1", + "europe-west2", + "europe-west3", + "europe-west4", + "southamerica-west1", + "us-central1", + "us-central2", + "us-east1", + "us-east4", + "us-east5", + "us-east7", + "us-south1", + "us-west1", + "us-west2", + "us-west3", + "us-west4", + "us-west8" + ] + }, + "name": "projects/${projectId}/topics/pubsubtopic-${uniqueId}" +} + +--- + +GET https://pubsub.googleapis.com/v1/projects/${projectId}/topics/pubsubtopic-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "messageStoragePolicy": { + "allowedPersistenceRegions": [ + "asia-east1", + "asia-northeast1", + "asia-southeast1", + "australia-southeast1", + "europe-north1", + "europe-west1", + "europe-west2", + "europe-west3", + "europe-west4", + "southamerica-west1", + "us-central1", + "us-central2", + "us-east1", + "us-east4", + "us-east5", + "us-east7", + "us-south1", + "us-west1", + "us-west2", + "us-west3", + "us-west4", + "us-west8" + ] + }, + "name": "projects/${projectId}/topics/pubsubtopic-${uniqueId}" +} + +--- + +GET https://pubsub.googleapis.com/v1/projects/${projectId}/topics/pubsubtopic-${uniqueId}:getIamPolicy?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 + +{ + "etag": "abcdef0123A=" +} + +--- + +POST https://pubsub.googleapis.com/v1/projects/${projectId}/topics/pubsubtopic-${uniqueId}:setIamPolicy?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 + +{ + "policy": { + "bindings": [ + { + "members": [ + "serviceAccount:service-${projectNumber}@gs-project-accounts.iam.gserviceaccount.com" + ], + "role": "roles/pubsub.publisher" + } + ], + "version": 3 + } +} + +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 + +{ + "bindings": [ + { + "members": [ + "serviceAccount:service-${projectNumber}@gs-project-accounts.iam.gserviceaccount.com" + ], + "role": "roles/pubsub.publisher" + } + ], + "etag": "abcdef0123A=", + "version": 1 +} + +--- + +GET https://pubsub.googleapis.com/v1/projects/${projectId}/topics/pubsubtopic-${uniqueId}:getIamPolicy?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 + +{ + "bindings": [ + { + "members": [ + "serviceAccount:service-${projectNumber}@gs-project-accounts.iam.gserviceaccount.com" + ], + "role": "roles/pubsub.publisher" + } + ], + "etag": "abcdef0123A=", + "version": 1 +} + +--- + +POST https://storage.googleapis.com/storage/v1/b/storagebucket-${uniqueId}/notificationConfigs?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 + +{ + "custom_attributes": { + "key1": "val1", + "key2": "val2" + }, + "event_types": [ + "OBJECT_FINALIZE", + "OBJECT_METADATA_UPDATE" + ], + "object_name_prefix": "configconnector-", + "payload_format": "JSON_API_V1", + "topic": "projects/${projectId}/topics/pubsubtopic-${uniqueId}" +} + +200 OK +Cache-Control: no-cache, no-store, max-age=0, must-revalidate +Content-Type: application/json; charset=UTF-8 +Expires: Mon, 01 Jan 1990 00:00:00 GMT +Pragma: no-cache +Server: UploadServer +Vary: Origin +Vary: X-Origin + +{ + "custom_attributes": { + "key1": "val1", + "key2": "val2" + }, + "etag": "abcdef0123A=", + "event_types": [ + "OBJECT_FINALIZE", + "OBJECT_METADATA_UPDATE" + ], + "id": "000000000000000000000", + "kind": "storage#notification", + "object_name_prefix": "configconnector-", + "payload_format": "JSON_API_V1", + "selfLink": "https://www.googleapis.com/storage/v1/b/storagebucket-${uniqueId}/notificationConfigs/1", + "topic": "//pubsub.googleapis.com/projects/${projectId}/topics/pubsubtopic-${uniqueId}" +} + +--- + +GET https://storage.googleapis.com/storage/v1/b/storagebucket-${uniqueId}/notificationConfigs/1?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, max-age=0, must-revalidate, no-transform +Content-Type: application/json; charset=UTF-8 +Expires: {now+0m} +Server: UploadServer +Vary: Origin +Vary: X-Origin + +{ + "custom_attributes": { + "key1": "val1", + "key2": "val2" + }, + "etag": "abcdef0123A=", + "event_types": [ + "OBJECT_FINALIZE", + "OBJECT_METADATA_UPDATE" + ], + "id": "000000000000000000000", + "kind": "storage#notification", + "object_name_prefix": "configconnector-", + "payload_format": "JSON_API_V1", + "selfLink": "https://www.googleapis.com/storage/v1/b/storagebucket-${uniqueId}/notificationConfigs/1", + "topic": "//pubsub.googleapis.com/projects/${projectId}/topics/pubsubtopic-${uniqueId}" +} + +--- + +DELETE https://storage.googleapis.com/storage/v1/b/storagebucket-${uniqueId}/notificationConfigs/1?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 + +204 No Content +Cache-Control: no-cache, no-store, max-age=0, must-revalidate +Content-Type: application/json +Expires: Mon, 01 Jan 1990 00:00:00 GMT +Pragma: no-cache +Server: UploadServer +Vary: Origin +Vary: X-Origin + + +--- + +GET https://pubsub.googleapis.com/v1/projects/${projectId}/topics/pubsubtopic-${uniqueId}:getIamPolicy?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 + +{ + "bindings": [ + { + "members": [ + "serviceAccount:service-${projectNumber}@gs-project-accounts.iam.gserviceaccount.com" + ], + "role": "roles/pubsub.publisher" + } + ], + "etag": "abcdef0123A=", + "version": 1 +} + +--- + +POST https://pubsub.googleapis.com/v1/projects/${projectId}/topics/pubsubtopic-${uniqueId}:setIamPolicy?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 + +{ + "policy": { + "etag": "abcdef0123A=", + "version": 3 + } +} + +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 + +{ + "etag": "abcdef0123A=", + "version": 1 +} + +--- + +GET https://pubsub.googleapis.com/v1/projects/${projectId}/topics/pubsubtopic-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "messageStoragePolicy": { + "allowedPersistenceRegions": [ + "asia-east1", + "asia-northeast1", + "asia-southeast1", + "australia-southeast1", + "europe-north1", + "europe-west1", + "europe-west2", + "europe-west3", + "europe-west4", + "southamerica-west1", + "us-central1", + "us-central2", + "us-east1", + "us-east4", + "us-east5", + "us-east7", + "us-south1", + "us-west1", + "us-west2", + "us-west3", + "us-west4", + "us-west8" + ] + }, + "name": "projects/${projectId}/topics/pubsubtopic-${uniqueId}" +} + +--- + +DELETE https://pubsub.googleapis.com/v1/projects/${projectId}/topics/pubsubtopic-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{} + +--- + +GET https://storage.googleapis.com/storage/v1/b/storagebucket-${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 + +200 OK +Cache-Control: private, max-age=0, must-revalidate, no-transform +Content-Type: application/json; charset=UTF-8 +Expires: {now+0m} +Server: UploadServer +Vary: Origin +Vary: X-Origin + +{ + "etag": "abcdef0123A=", + "iamConfiguration": { + "bucketPolicyOnly": { + "enabled": false + }, + "publicAccessPrevention": "inherited", + "uniformBucketLevelAccess": { + "enabled": false + } + }, + "id": "000000000000000000000", + "kind": "storage#bucket", + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "location": "US", + "locationType": "multi-region", + "metageneration": "3", + "name": "storagebucket-${uniqueId}", + "projectNumber": "${projectNumber}", + "rpo": "DEFAULT", + "selfLink": "https://www.googleapis.com/storage/v1/b/storagebucket-${uniqueId}", + "softDeletePolicy": { + "effectiveTime": "2024-04-01T12:34:56.123456Z", + "retentionDurationSeconds": "604800" + }, + "storageClass": "STANDARD", + "timeCreated": "2024-04-01T12:34:56.123456Z", + "updated": "2024-04-01T12:34:56.123456Z" +} + +--- + +GET https://storage.googleapis.com/storage/v1/b/storagebucket-${uniqueId}/o?alt=json&prettyPrint=false&versions=true +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, max-age=0, must-revalidate, no-transform +Content-Type: application/json; charset=UTF-8 +Expires: {now+0m} +Server: UploadServer +Vary: Origin +Vary: X-Origin + +{ + "kind": "storage#objects" +} + +--- + +DELETE https://storage.googleapis.com/storage/v1/b/storagebucket-${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 + +204 No Content +Cache-Control: no-cache, no-store, max-age=0, must-revalidate +Content-Type: application/json +Expires: Mon, 01 Jan 1990 00:00:00 GMT +Pragma: no-cache +Server: UploadServer +Vary: Origin +Vary: X-Origin \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/storage/v1beta1/storagenotification/storagenotificationfull/create.yaml b/pkg/test/resourcefixture/testdata/basic/storage/v1beta1/storagenotification/storagenotificationfull/create.yaml new file mode 100644 index 0000000000..0affc6e704 --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/storage/v1beta1/storagenotification/storagenotificationfull/create.yaml @@ -0,0 +1,31 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: storage.cnrm.cloud.google.com/v1beta1 +kind: StorageNotification +metadata: + name: storagenotification-${uniqueId} +spec: + bucketRef: + name: storagebucket-${uniqueId} + payloadFormat: JSON_API_V1 + topicRef: + name: pubsubtopic-${uniqueId} + customAttributes: + "key1": "val1" + "key2": "val2" + eventTypes: + - OBJECT_FINALIZE + - OBJECT_METADATA_UPDATE + objectNamePrefix: "configconnector-" \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/storage/v1beta1/storagenotification/storagenotificationfull/dependencies.yaml b/pkg/test/resourcefixture/testdata/basic/storage/v1beta1/storagenotification/storagenotificationfull/dependencies.yaml new file mode 100644 index 0000000000..3be0dc19af --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/storage/v1beta1/storagenotification/storagenotificationfull/dependencies.yaml @@ -0,0 +1,37 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: storage.cnrm.cloud.google.com/v1beta1 +kind: StorageBucket +metadata: + name: storagebucket-${uniqueId} +--- +apiVersion: pubsub.cnrm.cloud.google.com/v1beta1 +kind: PubSubTopic +metadata: + name: pubsubtopic-${uniqueId} +--- +apiVersion: iam.cnrm.cloud.google.com/v1beta1 +kind: IAMPolicy +metadata: + name: iampolicy-pubsubtopic-${uniqueId} +spec: + resourceRef: + apiVersion: pubsub.cnrm.cloud.google.com/v1beta1 + kind: PubSubTopic + name: pubsubtopic-${uniqueId} + bindings: + - role: roles/pubsub.publisher + members: + - serviceAccount:service-${projectNumber}@gs-project-accounts.iam.gserviceaccount.com