From a929d2f071bff1163953aee9446823efd276a1d0 Mon Sep 17 00:00:00 2001 From: Ziyue Yan Date: Wed, 13 Nov 2024 01:21:26 +0000 Subject: [PATCH] Generate set-unset golden output for gkehubfeaturemembership from DCL --- .../set_unset/_http00.log | 843 ++++++++++++++++++ .../set_unset/_http01.log | 194 ++++ .../set_unset/_http02.log | 384 ++++++++ .../set_unset/_http03.log | 214 +++++ .../set_unset/_http04.log | 288 ++++++ .../set_unset/_http05.log | 331 +++++++ .../set_unset/_object00.yaml | 34 + .../set_unset/_object01.yaml | 26 + .../set_unset/_object02.yaml | 39 + .../set_unset/_object03.yaml | 32 + .../set_unset/_object04.yaml | 44 + .../set_unset/_object05.yaml | 32 + .../set_unset/script.yaml | 115 +++ 13 files changed, 2576 insertions(+) create mode 100644 tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/_http00.log create mode 100644 tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/_http01.log create mode 100644 tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/_http02.log create mode 100644 tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/_http03.log create mode 100644 tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/_http04.log create mode 100644 tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/_http05.log create mode 100644 tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/_object00.yaml create mode 100644 tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/_object01.yaml create mode 100644 tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/_object02.yaml create mode 100644 tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/_object03.yaml create mode 100644 tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/_object04.yaml create mode 100644 tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/_object05.yaml create mode 100644 tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/script.yaml diff --git a/tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/_http00.log b/tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/_http00.log new file mode 100644 index 0000000000..0497ee9f58 --- /dev/null +++ b/tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/_http00.log @@ -0,0 +1,843 @@ +GET https://container.googleapis.com/v1beta1/projects/${projectId}/locations/us-central1-a/clusters/containercluster-${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: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "error": { + "code": 404, + "errors": [ + { + "domain": "global", + "message": "Not found: projects/${projectId}/zones/us-central1-a/clusters/containercluster-${uniqueId}.", + "reason": "notFound" + } + ], + "message": "Not found: projects/${projectId}/zones/us-central1-a/clusters/containercluster-${uniqueId}.", + "status": "NOT_FOUND" + } +} + +--- + +GET https://container.googleapis.com/v1beta1/projects/${projectId}/locations/us-central1-a/clusters/containercluster-${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: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "error": { + "code": 404, + "errors": [ + { + "domain": "global", + "message": "Not found: projects/${projectId}/zones/us-central1-a/clusters/containercluster-${uniqueId}.", + "reason": "notFound" + } + ], + "message": "Not found: projects/${projectId}/zones/us-central1-a/clusters/containercluster-${uniqueId}.", + "status": "NOT_FOUND" + } +} + +--- + +POST https://container.googleapis.com/v1beta1/projects/${projectId}/locations/us-central1-a/clusters?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 + +{ + "cluster": { + "autopilot": { + "enabled": false + }, + "autoscaling": { + "enableNodeAutoprovisioning": false + }, + "binaryAuthorization": { + "enabled": false + }, + "ipAllocationPolicy": { + "stackType": "IPV4", + "useIpAliases": false + }, + "legacyAbac": { + "enabled": false + }, + "maintenancePolicy": { + "window": {} + }, + "masterAuthorizedNetworksConfig": {}, + "name": "containercluster-${uniqueId}", + "network": "projects/${projectId}/global/networks/default", + "networkConfig": {}, + "networkPolicy": {}, + "nodeConfig": { + "oauthScopes": [ + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/logging.write", + "https://www.googleapis.com/auth/monitoring", + "https://www.googleapis.com/auth/service.management.readonly", + "https://www.googleapis.com/auth/servicecontrol", + "https://www.googleapis.com/auth/trace.append" + ] + }, + "notificationConfig": { + "pubsub": {} + }, + "resourceLabels": { + "managed-by-cnrm": "true" + }, + "shieldedNodes": { + "enabled": true + }, + "workloadIdentityConfig": { + "workloadPool": "${projectId}.svc.id.goog" + } + } +} + +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": "${operationID}", + "operationType": "CREATE_CLUSTER", + "selfLink": "https://container.googleapis.com/v1beta1/projects/${projectNumber}/zones/us-central1-a/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "RUNNING", + "targetLink": "https://container.googleapis.com/v1beta1/projects/${projectNumber}/zones/us-central1-a/clusters/containercluster-${uniqueId}", + "zone": "us-central1-a" +} + +--- + +GET https://container.googleapis.com/v1beta1/projects/${projectId}/locations/us-central1-a/operations/${operationID}?alt=json&prettyPrint=false +User-Agent: google-api-go-client/0.5 Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "endTime": "2024-04-01T12:34:56.123456Z", + "name": "${operationID}", + "operationType": "CREATE_CLUSTER", + "progress": { + "metrics": [ + { + "intValue": "10", + "name": "CLUSTER_CONFIGURING" + }, + { + "intValue": "10", + "name": "CLUSTER_CONFIGURING_TOTAL" + }, + { + "intValue": "12", + "name": "CLUSTER_DEPLOYING" + }, + { + "intValue": "12", + "name": "CLUSTER_DEPLOYING_TOTAL" + }, + { + "intValue": "1", + "name": "CLUSTER_HEALTHCHECKING" + }, + { + "intValue": "2", + "name": "CLUSTER_HEALTHCHECKING_TOTAL" + } + ] + }, + "selfLink": "https://container.googleapis.com/v1beta1/projects/${projectNumber}/zones/us-central1-a/operations/${operationID}", + "startTime": "2024-04-01T12:34:56.123456Z", + "status": "DONE", + "targetLink": "https://container.googleapis.com/v1beta1/projects/${projectNumber}/zones/us-central1-a/clusters/containercluster-${uniqueId}", + "zone": "us-central1-a" +} + +--- + +GET https://container.googleapis.com/v1beta1/projects/${projectId}/locations/us-central1-a/clusters/containercluster-${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 +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 + +{ + "addonsConfig": { + "gcePersistentDiskCsiDriverConfig": { + "enabled": true + }, + "kubernetesDashboard": { + "disabled": true + }, + "networkPolicyConfig": { + "disabled": true + } + }, + "autopilot": {}, + "autoscaling": { + "autoprovisioningNodePoolDefaults": { + "management": { + "autoRepair": true, + "autoUpgrade": true + }, + "oauthScopes": [ + "https://www.googleapis.com/auth/userinfo.email", + "https://www.googleapis.com/auth/cloud-platform" + ], + "upgradeSettings": { + "strategy": "SURGE" + } + }, + "autoscalingProfile": "BALANCED" + }, + "binaryAuthorization": {}, + "clusterIpv4Cidr": "10.92.0.0/14", + "clusterTelemetry": { + "type": "ENABLED" + }, + "createTime": "2024-04-01T12:34:56.123456Z", + "currentMasterVersion": "1.30.5-gke.1014001", + "currentNodeCount": 1, + "currentNodeVersion": "1.30.5-gke.1014001", + "databaseEncryption": { + "currentState": "CURRENT_STATE_DECRYPTED", + "state": "DECRYPTED" + }, + "defaultMaxPodsConstraint": { + "maxPodsPerNode": "110" + }, + "enterpriseConfig": { + "clusterTier": "STANDARD" + }, + "initialClusterVersion": "1.30.5-gke.1014001", + "ipAllocationPolicy": { + "stackType": "IPV4" + }, + "legacyAbac": {}, + "location": "us-central1-a", + "locations": [ + "us-central1-a" + ], + "loggingConfig": { + "componentConfig": { + "enableComponents": [ + "SYSTEM_COMPONENTS", + "WORKLOADS" + ] + } + }, + "loggingService": "logging.googleapis.com/kubernetes", + "maintenancePolicy": { + "window": {} + }, + "masterAuthorizedNetworksConfig": { + "gcpPublicCidrsAccessEnabled": true + }, + "monitoringConfig": { + "advancedDatapathObservabilityConfig": {}, + "componentConfig": { + "enableComponents": [ + "SYSTEM_COMPONENTS" + ] + }, + "managedPrometheusConfig": { + "enabled": true + } + }, + "monitoringService": "monitoring.googleapis.com/kubernetes", + "name": "containercluster-${uniqueId}", + "network": "default", + "networkConfig": { + "network": "projects/${projectId}/global/networks/default", + "subnetwork": "default" + }, + "networkPolicy": {}, + "nodeConfig": { + "diskSizeGb": 100, + "diskType": "pd-balanced", + "imageType": "COS_CONTAINERD", + "machineType": "e2-medium", + "metadata": { + "disable-legacy-endpoints": "true" + }, + "oauthScopes": [ + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/logging.write", + "https://www.googleapis.com/auth/monitoring", + "https://www.googleapis.com/auth/service.management.readonly", + "https://www.googleapis.com/auth/servicecontrol", + "https://www.googleapis.com/auth/trace.append" + ], + "serviceAccount": "default", + "shieldedInstanceConfig": { + "enableIntegrityMonitoring": true + }, + "windowsNodeConfig": {} + }, + "nodePools": [ + { + "config": { + "diskSizeGb": 100, + "diskType": "pd-balanced", + "imageType": "COS_CONTAINERD", + "machineType": "e2-medium", + "metadata": { + "disable-legacy-endpoints": "true" + }, + "oauthScopes": [ + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/logging.write", + "https://www.googleapis.com/auth/monitoring", + "https://www.googleapis.com/auth/service.management.readonly", + "https://www.googleapis.com/auth/servicecontrol", + "https://www.googleapis.com/auth/trace.append" + ], + "serviceAccount": "default", + "shieldedInstanceConfig": { + "enableIntegrityMonitoring": true + }, + "windowsNodeConfig": {} + }, + "initialNodeCount": 1, + "locations": [ + "us-central1-a" + ], + "management": { + "autoRepair": true, + "autoUpgrade": true + }, + "maxPodsConstraint": { + "maxPodsPerNode": "110" + }, + "name": "default-pool", + "networkConfig": { + "enablePrivateNodes": false, + "podIpv4CidrBlock": "10.92.0.0/14", + "podIpv4RangeUtilization": 0.001, + "podRange": "default-pool-pods-12345678" + }, + "podIpv4CidrSize": 24, + "status": "RUNNING", + "upgradeSettings": { + "maxSurge": 1, + "strategy": "SURGE" + }, + "version": "1.30.5-gke.1014001" + } + ], + "notificationConfig": { + "pubsub": {} + }, + "privateCluster": true, + "privateClusterConfig": { + "privateEndpoint": "10.128.0.2", + "publicEndpoint": "8.8.8.8" + }, + "protectConfig": { + "workloadConfig": { + "auditMode": "BASIC" + }, + "workloadVulnerabilityMode": "WORKLOAD_VULNERABILITY_MODE_UNSPECIFIED" + }, + "releaseChannel": { + "channel": "REGULAR" + }, + "resourceLabels": { + "managed-by-cnrm": "true" + }, + "securityPostureConfig": { + "mode": "BASIC", + "vulnerabilityMode": "VULNERABILITY_MODE_UNSPECIFIED" + }, + "selfLink": "https://container.googleapis.com/v1beta1/projects/${projectId}/zones/us-central1-a/clusters/containercluster-${uniqueId}", + "servicesIpv4Cidr": "34.118.224.0/20", + "shieldedNodes": { + "enabled": true + }, + "status": "RUNNING", + "subnetwork": "default", + "workloadIdentityConfig": { + "workloadPool": "${projectId}.svc.id.goog" + }, + "zone": "us-central1-a" +} + +--- + +GET https://container.googleapis.com/v1beta1/projects/${projectId}/locations/us-central1-a/clusters/containercluster-${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 +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 + +{ + "addonsConfig": { + "gcePersistentDiskCsiDriverConfig": { + "enabled": true + }, + "kubernetesDashboard": { + "disabled": true + }, + "networkPolicyConfig": { + "disabled": true + } + }, + "autopilot": {}, + "autoscaling": { + "autoprovisioningNodePoolDefaults": { + "management": { + "autoRepair": true, + "autoUpgrade": true + }, + "oauthScopes": [ + "https://www.googleapis.com/auth/userinfo.email", + "https://www.googleapis.com/auth/cloud-platform" + ], + "upgradeSettings": { + "strategy": "SURGE" + } + }, + "autoscalingProfile": "BALANCED" + }, + "binaryAuthorization": {}, + "clusterIpv4Cidr": "10.92.0.0/14", + "clusterTelemetry": { + "type": "ENABLED" + }, + "createTime": "2024-04-01T12:34:56.123456Z", + "currentMasterVersion": "1.30.5-gke.1014001", + "currentNodeCount": 1, + "currentNodeVersion": "1.30.5-gke.1014001", + "databaseEncryption": { + "currentState": "CURRENT_STATE_DECRYPTED", + "state": "DECRYPTED" + }, + "defaultMaxPodsConstraint": { + "maxPodsPerNode": "110" + }, + "enterpriseConfig": { + "clusterTier": "STANDARD" + }, + "initialClusterVersion": "1.30.5-gke.1014001", + "ipAllocationPolicy": { + "stackType": "IPV4" + }, + "legacyAbac": {}, + "location": "us-central1-a", + "locations": [ + "us-central1-a" + ], + "loggingConfig": { + "componentConfig": { + "enableComponents": [ + "SYSTEM_COMPONENTS", + "WORKLOADS" + ] + } + }, + "loggingService": "logging.googleapis.com/kubernetes", + "maintenancePolicy": { + "window": {} + }, + "masterAuthorizedNetworksConfig": { + "gcpPublicCidrsAccessEnabled": true + }, + "monitoringConfig": { + "advancedDatapathObservabilityConfig": {}, + "componentConfig": { + "enableComponents": [ + "SYSTEM_COMPONENTS" + ] + }, + "managedPrometheusConfig": { + "enabled": true + } + }, + "monitoringService": "monitoring.googleapis.com/kubernetes", + "name": "containercluster-${uniqueId}", + "network": "default", + "networkConfig": { + "network": "projects/${projectId}/global/networks/default", + "subnetwork": "default" + }, + "networkPolicy": {}, + "nodeConfig": { + "diskSizeGb": 100, + "diskType": "pd-balanced", + "imageType": "COS_CONTAINERD", + "machineType": "e2-medium", + "metadata": { + "disable-legacy-endpoints": "true" + }, + "oauthScopes": [ + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/logging.write", + "https://www.googleapis.com/auth/monitoring", + "https://www.googleapis.com/auth/service.management.readonly", + "https://www.googleapis.com/auth/servicecontrol", + "https://www.googleapis.com/auth/trace.append" + ], + "serviceAccount": "default", + "shieldedInstanceConfig": { + "enableIntegrityMonitoring": true + }, + "windowsNodeConfig": {} + }, + "nodePools": [ + { + "config": { + "diskSizeGb": 100, + "diskType": "pd-balanced", + "imageType": "COS_CONTAINERD", + "machineType": "e2-medium", + "metadata": { + "disable-legacy-endpoints": "true" + }, + "oauthScopes": [ + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/logging.write", + "https://www.googleapis.com/auth/monitoring", + "https://www.googleapis.com/auth/service.management.readonly", + "https://www.googleapis.com/auth/servicecontrol", + "https://www.googleapis.com/auth/trace.append" + ], + "serviceAccount": "default", + "shieldedInstanceConfig": { + "enableIntegrityMonitoring": true + }, + "windowsNodeConfig": {} + }, + "initialNodeCount": 1, + "locations": [ + "us-central1-a" + ], + "management": { + "autoRepair": true, + "autoUpgrade": true + }, + "maxPodsConstraint": { + "maxPodsPerNode": "110" + }, + "name": "default-pool", + "networkConfig": { + "enablePrivateNodes": false, + "podIpv4CidrBlock": "10.92.0.0/14", + "podIpv4RangeUtilization": 0.001, + "podRange": "default-pool-pods-12345678" + }, + "podIpv4CidrSize": 24, + "status": "RUNNING", + "upgradeSettings": { + "maxSurge": 1, + "strategy": "SURGE" + }, + "version": "1.30.5-gke.1014001" + } + ], + "notificationConfig": { + "pubsub": {} + }, + "privateCluster": true, + "privateClusterConfig": { + "privateEndpoint": "10.128.0.2", + "publicEndpoint": "8.8.8.8" + }, + "protectConfig": { + "workloadConfig": { + "auditMode": "BASIC" + }, + "workloadVulnerabilityMode": "WORKLOAD_VULNERABILITY_MODE_UNSPECIFIED" + }, + "releaseChannel": { + "channel": "REGULAR" + }, + "resourceLabels": { + "managed-by-cnrm": "true" + }, + "securityPostureConfig": { + "mode": "BASIC", + "vulnerabilityMode": "VULNERABILITY_MODE_UNSPECIFIED" + }, + "selfLink": "https://container.googleapis.com/v1beta1/projects/${projectId}/zones/us-central1-a/clusters/containercluster-${uniqueId}", + "servicesIpv4Cidr": "34.118.224.0/20", + "shieldedNodes": { + "enabled": true + }, + "status": "RUNNING", + "subnetwork": "default", + "workloadIdentityConfig": { + "workloadPool": "${projectId}.svc.id.goog" + }, + "zone": "us-central1-a" +} + +--- + +GET https://container.googleapis.com/v1beta1/projects/${projectId}/locations/us-central1-a/clusters/containercluster-${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 +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 + +{ + "addonsConfig": { + "gcePersistentDiskCsiDriverConfig": { + "enabled": true + }, + "kubernetesDashboard": { + "disabled": true + }, + "networkPolicyConfig": { + "disabled": true + } + }, + "autopilot": {}, + "autoscaling": { + "autoprovisioningNodePoolDefaults": { + "management": { + "autoRepair": true, + "autoUpgrade": true + }, + "oauthScopes": [ + "https://www.googleapis.com/auth/userinfo.email", + "https://www.googleapis.com/auth/cloud-platform" + ], + "upgradeSettings": { + "strategy": "SURGE" + } + }, + "autoscalingProfile": "BALANCED" + }, + "binaryAuthorization": {}, + "clusterIpv4Cidr": "10.92.0.0/14", + "clusterTelemetry": { + "type": "ENABLED" + }, + "createTime": "2024-04-01T12:34:56.123456Z", + "currentMasterVersion": "1.30.5-gke.1014001", + "currentNodeCount": 1, + "currentNodeVersion": "1.30.5-gke.1014001", + "databaseEncryption": { + "currentState": "CURRENT_STATE_DECRYPTED", + "state": "DECRYPTED" + }, + "defaultMaxPodsConstraint": { + "maxPodsPerNode": "110" + }, + "enterpriseConfig": { + "clusterTier": "STANDARD" + }, + "initialClusterVersion": "1.30.5-gke.1014001", + "ipAllocationPolicy": { + "stackType": "IPV4" + }, + "legacyAbac": {}, + "location": "us-central1-a", + "locations": [ + "us-central1-a" + ], + "loggingConfig": { + "componentConfig": { + "enableComponents": [ + "SYSTEM_COMPONENTS", + "WORKLOADS" + ] + } + }, + "loggingService": "logging.googleapis.com/kubernetes", + "maintenancePolicy": { + "window": {} + }, + "masterAuthorizedNetworksConfig": { + "gcpPublicCidrsAccessEnabled": true + }, + "monitoringConfig": { + "advancedDatapathObservabilityConfig": {}, + "componentConfig": { + "enableComponents": [ + "SYSTEM_COMPONENTS" + ] + }, + "managedPrometheusConfig": { + "enabled": true + } + }, + "monitoringService": "monitoring.googleapis.com/kubernetes", + "name": "containercluster-${uniqueId}", + "network": "default", + "networkConfig": { + "network": "projects/${projectId}/global/networks/default", + "subnetwork": "default" + }, + "networkPolicy": {}, + "nodeConfig": { + "diskSizeGb": 100, + "diskType": "pd-balanced", + "imageType": "COS_CONTAINERD", + "machineType": "e2-medium", + "metadata": { + "disable-legacy-endpoints": "true" + }, + "oauthScopes": [ + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/logging.write", + "https://www.googleapis.com/auth/monitoring", + "https://www.googleapis.com/auth/service.management.readonly", + "https://www.googleapis.com/auth/servicecontrol", + "https://www.googleapis.com/auth/trace.append" + ], + "serviceAccount": "default", + "shieldedInstanceConfig": { + "enableIntegrityMonitoring": true + }, + "windowsNodeConfig": {} + }, + "nodePools": [ + { + "config": { + "diskSizeGb": 100, + "diskType": "pd-balanced", + "imageType": "COS_CONTAINERD", + "machineType": "e2-medium", + "metadata": { + "disable-legacy-endpoints": "true" + }, + "oauthScopes": [ + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/logging.write", + "https://www.googleapis.com/auth/monitoring", + "https://www.googleapis.com/auth/service.management.readonly", + "https://www.googleapis.com/auth/servicecontrol", + "https://www.googleapis.com/auth/trace.append" + ], + "serviceAccount": "default", + "shieldedInstanceConfig": { + "enableIntegrityMonitoring": true + }, + "windowsNodeConfig": {} + }, + "initialNodeCount": 1, + "locations": [ + "us-central1-a" + ], + "management": { + "autoRepair": true, + "autoUpgrade": true + }, + "maxPodsConstraint": { + "maxPodsPerNode": "110" + }, + "name": "default-pool", + "networkConfig": { + "enablePrivateNodes": false, + "podIpv4CidrBlock": "10.92.0.0/14", + "podIpv4RangeUtilization": 0.001, + "podRange": "default-pool-pods-12345678" + }, + "podIpv4CidrSize": 24, + "status": "RUNNING", + "upgradeSettings": { + "maxSurge": 1, + "strategy": "SURGE" + }, + "version": "1.30.5-gke.1014001" + } + ], + "notificationConfig": { + "pubsub": {} + }, + "privateCluster": true, + "privateClusterConfig": { + "privateEndpoint": "10.128.0.2", + "publicEndpoint": "8.8.8.8" + }, + "protectConfig": { + "workloadConfig": { + "auditMode": "BASIC" + }, + "workloadVulnerabilityMode": "WORKLOAD_VULNERABILITY_MODE_UNSPECIFIED" + }, + "releaseChannel": { + "channel": "REGULAR" + }, + "resourceLabels": { + "managed-by-cnrm": "true" + }, + "securityPostureConfig": { + "mode": "BASIC", + "vulnerabilityMode": "VULNERABILITY_MODE_UNSPECIFIED" + }, + "selfLink": "https://container.googleapis.com/v1beta1/projects/${projectId}/zones/us-central1-a/clusters/containercluster-${uniqueId}", + "servicesIpv4Cidr": "34.118.224.0/20", + "shieldedNodes": { + "enabled": true + }, + "status": "RUNNING", + "subnetwork": "default", + "workloadIdentityConfig": { + "workloadPool": "${projectId}.svc.id.goog" + }, + "zone": "us-central1-a" +} \ No newline at end of file diff --git a/tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/_http01.log b/tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/_http01.log new file mode 100644 index 0000000000..2162e61d40 --- /dev/null +++ b/tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/_http01.log @@ -0,0 +1,194 @@ +GET https://gkehub.googleapis.com/v1beta/projects/${projectId}/locations/global/features/configmanagement?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": "feature \"projects/${projectId}/locations/global/features/configmanagement\" not found", + "status": "NOT_FOUND" + } +} + +--- + +GET https://gkehub.googleapis.com/v1beta/projects/${projectId}/locations/global/features/configmanagement?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": "feature \"projects/${projectId}/locations/global/features/configmanagement\" not found", + "status": "NOT_FOUND" + } +} + +--- + +GET https://gkehub.googleapis.com/v1beta/projects/${projectId}/locations/global/features/configmanagement?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": "feature \"projects/${projectId}/locations/global/features/configmanagement\" not found", + "status": "NOT_FOUND" + } +} + +--- + +POST https://gkehub.googleapis.com/v1beta/projects/${projectId}/locations/global/features?alt=json&featureId=configmanagement +Content-Type: application/json +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 + +{ + "labels": { + "managed-by-cnrm": "true" + }, + "name": "projects/${projectId}/locations/global/features/configmanagement" +} + +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 + +{ + "metadata": { + "@type": "type.googleapis.com/google.cloud.gkehub.v1beta.OperationMetadata", + "createTime": "2024-04-01T12:34:56.123456Z", + "endTime": "2024-04-01T12:34:56.123456Z", + "target": "projects/${projectId}/locations/global/features/configmanagement" + }, + "name": "projects/${projectId}/locations/global/features/configmanagement/operations/${operationID}" +} + +--- + +GET https://gkehub.googleapis.com/v1beta1/projects/${projectId}/locations/global/features/configmanagement/operations/${operationID}?alt=json +Content-Type: application/json +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 + +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.gkehub.v1beta.OperationMetadata", + "createTime": "2024-04-01T12:34:56.123456Z", + "endTime": "2024-04-01T12:34:56.123456Z", + "target": "projects/${projectId}/locations/global/features/configmanagement" + }, + "name": "projects/${projectId}/locations/global/features/configmanagement/operations/${operationID}", + "response": { + "@type": "type.googleapis.com/google.cloud.gkehub.v1beta.Feature", + "createTime": "2024-04-01T12:34:56.123456Z", + "labels": { + "managed-by-cnrm": "true" + }, + "name": "projects/${projectId}/locations/global/features/configmanagement", + "resourceState": { + "state": "ACTIVE" + }, + "updateTime": "2024-04-01T12:34:56.123456Z" + } +} + +--- + +GET https://gkehub.googleapis.com/v1beta/projects/${projectId}/locations/global/features/configmanagement?alt=json +Content-Type: application/json +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 + +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": { + "managed-by-cnrm": "true" + }, + "name": "projects/${projectId}/locations/global/features/configmanagement" +} + +--- + +GET https://gkehub.googleapis.com/v1beta/projects/${projectId}/locations/global/features/configmanagement?alt=json +Content-Type: application/json +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 + +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": { + "managed-by-cnrm": "true" + }, + "name": "projects/${projectId}/locations/global/features/configmanagement" +} \ No newline at end of file diff --git a/tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/_http02.log b/tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/_http02.log new file mode 100644 index 0000000000..eb88935bfb --- /dev/null +++ b/tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/_http02.log @@ -0,0 +1,384 @@ +GET https://gkehub.googleapis.com/v1beta1/projects/${projectId}/locations/global/memberships/gkehubmembership-${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": "membership \"projects/${projectId}/locations/global/memberships/gkehubmembership-${uniqueId}\" not found", + "status": "NOT_FOUND" + } +} + +--- + +GET https://gkehub.googleapis.com/v1beta1/projects/${projectId}/locations/global/memberships/gkehubmembership-${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": "membership \"projects/${projectId}/locations/global/memberships/gkehubmembership-${uniqueId}\" not found", + "status": "NOT_FOUND" + } +} + +--- + +GET https://gkehub.googleapis.com/v1beta1/projects/${projectId}/locations/global/memberships/gkehubmembership-${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": "membership \"projects/${projectId}/locations/global/memberships/gkehubmembership-${uniqueId}\" not found", + "status": "NOT_FOUND" + } +} + +--- + +POST https://gkehub.googleapis.com/v1beta1/projects/${projectId}/locations/global/memberships?alt=json&membershipId=gkehubmembership-${uniqueId} +Content-Type: application/json +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 + +{ + "authority": { + "issuer": "https://container.googleapis.com/v1/projects/${projectId}/locations/us-central1-a/clusters/containercluster-${uniqueId}" + }, + "description": "A sample GKE Hub membership", + "endpoint": { + "gkeCluster": { + "resourceLink": "//container.googleapis.com/projects/${projectId}/zones/us-central1-a/clusters/containercluster-${uniqueId}" + } + }, + "labels": { + "managed-by-cnrm": "true" + }, + "name": "projects/${projectId}/locations/global/memberships/gkehubmembership-${uniqueId}" +} + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "metadata": { + "@type": "type.googleapis.com/google.cloud.gkehub.v1beta1.OperationMetadata", + "createTime": "2024-04-01T12:34:56.123456Z", + "endTime": "2024-04-01T12:34:56.123456Z", + "target": "projects/${projectId}/locations/global/memberships/gkehubmembership-${uniqueId}" + }, + "name": "projects/${projectId}/locations/global/memberships/gkehubmembership-${uniqueId}/operations/${operationID}" +} + +--- + +GET https://gkehub.googleapis.com/v1beta1/projects/${projectId}/locations/global/memberships/gkehubmembership-${uniqueId}/operations/${operationID}?alt=json +Content-Type: application/json +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 + +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.gkehub.v1beta1.OperationMetadata", + "createTime": "2024-04-01T12:34:56.123456Z", + "endTime": "2024-04-01T12:34:56.123456Z", + "target": "projects/${projectId}/locations/global/memberships/gkehubmembership-${uniqueId}" + }, + "name": "projects/${projectId}/locations/global/memberships/gkehubmembership-${uniqueId}/operations/${operationID}", + "response": { + "@type": "type.googleapis.com/google.cloud.gkehub.v1beta1.Membership", + "authority": { + "identityProvider": "https://container.googleapis.com/v1/projects/${projectId}/locations/us-central1-a/clusters/containercluster-${uniqueId}", + "issuer": "https://container.googleapis.com/v1/projects/${projectId}/locations/us-central1-a/clusters/containercluster-${uniqueId}", + "workloadIdentityPool": "${projectId}.svc.id.goog" + }, + "createTime": "2024-04-01T12:34:56.123456Z", + "description": "A sample GKE Hub membership", + "endpoint": { + "gkeCluster": { + "resourceLink": "//container.googleapis.com/projects/${projectId}/zones/us-central1-a/clusters/containercluster-${uniqueId}" + } + }, + "externalId": "c772f869-1d6c-4d50-a92e-816c48322246", + "infrastructureType": "MULTI_CLOUD", + "labels": { + "managed-by-cnrm": "true" + }, + "name": "projects/${projectId}/locations/global/memberships/gkehubmembership-${uniqueId}", + "state": { + "code": "READY" + }, + "uniqueId": "12345678", + "updateTime": "2024-04-01T12:34:56.123456Z" + } +} + +--- + +GET https://gkehub.googleapis.com/v1beta1/projects/${projectId}/locations/global/memberships/gkehubmembership-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 + +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 + +{ + "authority": { + "identityProvider": "https://container.googleapis.com/v1/projects/${projectId}/locations/us-central1-a/clusters/containercluster-${uniqueId}", + "issuer": "https://container.googleapis.com/v1/projects/${projectId}/locations/us-central1-a/clusters/containercluster-${uniqueId}", + "workloadIdentityPool": "${projectId}.svc.id.goog" + }, + "createTime": "2024-04-01T12:34:56.123456Z", + "description": "A sample GKE Hub membership", + "endpoint": { + "gkeCluster": { + "resourceLink": "//container.googleapis.com/projects/${projectId}/zones/us-central1-a/clusters/containercluster-${uniqueId}" + } + }, + "externalId": "c772f869-1d6c-4d50-a92e-816c48322246", + "infrastructureType": "MULTI_CLOUD", + "labels": { + "managed-by-cnrm": "true" + }, + "name": "projects/${projectId}/locations/global/memberships/gkehubmembership-${uniqueId}", + "state": { + "code": "READY" + }, + "uniqueId": "111111111111111111111", + "updateTime": "2024-04-01T12:34:56.123456Z" +} + +--- + +GET https://gkehub.googleapis.com/v1beta1/projects/${projectId}/locations/global/memberships/gkehubmembership-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 + +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 + +{ + "authority": { + "identityProvider": "https://container.googleapis.com/v1/projects/${projectId}/locations/us-central1-a/clusters/containercluster-${uniqueId}", + "issuer": "https://container.googleapis.com/v1/projects/${projectId}/locations/us-central1-a/clusters/containercluster-${uniqueId}", + "workloadIdentityPool": "${projectId}.svc.id.goog" + }, + "createTime": "2024-04-01T12:34:56.123456Z", + "description": "A sample GKE Hub membership", + "endpoint": { + "gkeCluster": { + "resourceLink": "//container.googleapis.com/projects/${projectId}/zones/us-central1-a/clusters/containercluster-${uniqueId}" + } + }, + "externalId": "c772f869-1d6c-4d50-a92e-816c48322246", + "infrastructureType": "MULTI_CLOUD", + "labels": { + "managed-by-cnrm": "true" + }, + "name": "projects/${projectId}/locations/global/memberships/gkehubmembership-${uniqueId}", + "state": { + "code": "READY" + }, + "uniqueId": "111111111111111111111", + "updateTime": "2024-04-01T12:34:56.123456Z" +} + +--- + +GET https://gkehub.googleapis.com/v1beta1/projects/${projectId}/locations/global/memberships/gkehubmembership-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 + +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 + +{ + "authority": { + "identityProvider": "https://container.googleapis.com/v1/projects/${projectId}/locations/us-central1-a/clusters/containercluster-${uniqueId}", + "issuer": "https://container.googleapis.com/v1/projects/${projectId}/locations/us-central1-a/clusters/containercluster-${uniqueId}", + "workloadIdentityPool": "${projectId}.svc.id.goog" + }, + "createTime": "2024-04-01T12:34:56.123456Z", + "description": "A sample GKE Hub membership", + "endpoint": { + "gkeCluster": { + "resourceLink": "//container.googleapis.com/projects/${projectId}/zones/us-central1-a/clusters/containercluster-${uniqueId}" + } + }, + "externalId": "c772f869-1d6c-4d50-a92e-816c48322246", + "infrastructureType": "MULTI_CLOUD", + "labels": { + "managed-by-cnrm": "true" + }, + "name": "projects/${projectId}/locations/global/memberships/gkehubmembership-${uniqueId}", + "state": { + "code": "READY" + }, + "uniqueId": "111111111111111111111", + "updateTime": "2024-04-01T12:34:56.123456Z" +} + +--- + +GET https://gkehub.googleapis.com/v1beta1/projects/${projectId}/locations/global/memberships/gkehubmembership-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 + +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 + +{ + "authority": { + "identityProvider": "https://container.googleapis.com/v1/projects/${projectId}/locations/us-central1-a/clusters/containercluster-${uniqueId}", + "issuer": "https://container.googleapis.com/v1/projects/${projectId}/locations/us-central1-a/clusters/containercluster-${uniqueId}", + "workloadIdentityPool": "${projectId}.svc.id.goog" + }, + "createTime": "2024-04-01T12:34:56.123456Z", + "description": "A sample GKE Hub membership", + "endpoint": { + "gkeCluster": { + "resourceLink": "//container.googleapis.com/projects/${projectId}/zones/us-central1-a/clusters/containercluster-${uniqueId}" + } + }, + "externalId": "c772f869-1d6c-4d50-a92e-816c48322246", + "infrastructureType": "MULTI_CLOUD", + "labels": { + "managed-by-cnrm": "true" + }, + "name": "projects/${projectId}/locations/global/memberships/gkehubmembership-${uniqueId}", + "state": { + "code": "READY" + }, + "uniqueId": "111111111111111111111", + "updateTime": "2024-04-01T12:34:56.123456Z" +} + +--- + +GET https://gkehub.googleapis.com/v1beta1/projects/${projectId}/locations/global/memberships/gkehubmembership-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 + +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 + +{ + "authority": { + "identityProvider": "https://container.googleapis.com/v1/projects/${projectId}/locations/us-central1-a/clusters/containercluster-${uniqueId}", + "issuer": "https://container.googleapis.com/v1/projects/${projectId}/locations/us-central1-a/clusters/containercluster-${uniqueId}", + "workloadIdentityPool": "${projectId}.svc.id.goog" + }, + "createTime": "2024-04-01T12:34:56.123456Z", + "description": "A sample GKE Hub membership", + "endpoint": { + "gkeCluster": { + "resourceLink": "//container.googleapis.com/projects/${projectId}/zones/us-central1-a/clusters/containercluster-${uniqueId}" + } + }, + "externalId": "c772f869-1d6c-4d50-a92e-816c48322246", + "infrastructureType": "MULTI_CLOUD", + "labels": { + "managed-by-cnrm": "true" + }, + "name": "projects/${projectId}/locations/global/memberships/gkehubmembership-${uniqueId}", + "state": { + "code": "READY" + }, + "uniqueId": "111111111111111111111", + "updateTime": "2024-04-01T12:34:56.123456Z" +} \ No newline at end of file diff --git a/tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/_http03.log b/tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/_http03.log new file mode 100644 index 0000000000..36c9513408 --- /dev/null +++ b/tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/_http03.log @@ -0,0 +1,214 @@ +GET https://gkehub.googleapis.com/v1beta/projects/${projectId}/locations/global/features/configmanagement?alt=json +Content-Type: application/json +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 + +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": { + "managed-by-cnrm": "true" + }, + "name": "projects/${projectId}/locations/global/features/configmanagement" +} + +--- + +GET https://gkehub.googleapis.com/v1beta/projects/${projectId}/locations/global/features/configmanagement?alt=json +Content-Type: application/json +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 + +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": { + "managed-by-cnrm": "true" + }, + "name": "projects/${projectId}/locations/global/features/configmanagement" +} + +--- + +GET https://gkehub.googleapis.com/v1beta/projects/${projectId}/locations/global/features/configmanagement?alt=json +Content-Type: application/json +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 + +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": { + "managed-by-cnrm": "true" + }, + "name": "projects/${projectId}/locations/global/features/configmanagement" +} + +--- + +GET https://gkehub.googleapis.com/v1beta/projects/${projectId}/locations/global/features/configmanagement?alt=json +Content-Type: application/json +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 + +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": { + "managed-by-cnrm": "true" + }, + "name": "projects/${projectId}/locations/global/features/configmanagement" +} + +--- + +PATCH https://gkehub.googleapis.com/v1beta/projects/${projectId}/locations/global/features/configmanagement?alt=json&updateMask=membershipSpecs +Content-Type: application/json +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 + +{ + "membershipSpecs": { + "projects/${projectId}/locations/global/memberships/gkehubmembership-${uniqueId}": { + "configmanagement": { + "configSync": { + "sourceFormat": "unstructured" + } + } + } + } +} + +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 + +{ + "metadata": { + "@type": "type.googleapis.com/google.cloud.gkehub.v1beta.OperationMetadata", + "createTime": "2024-04-01T12:34:56.123456Z", + "endTime": "2024-04-01T12:34:56.123456Z", + "target": "projects/${projectId}/locations/global/features/configmanagement" + }, + "name": "projects/${projectId}/locations/global/features/configmanagement/operations/${operationID}" +} + +--- + +GET https://gkehub.googleapis.com/v1beta/projects/${projectId}/locations/global/features/configmanagement/operations/${operationID}?alt=json +Content-Type: application/json +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 + +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.gkehub.v1beta.OperationMetadata", + "createTime": "2024-04-01T12:34:56.123456Z", + "endTime": "2024-04-01T12:34:56.123456Z", + "target": "projects/${projectId}/locations/global/features/configmanagement" + }, + "name": "projects/${projectId}/locations/global/features/configmanagement/operations/${operationID}", + "response": { + "@type": "type.googleapis.com/google.cloud.gkehub.v1beta.Feature", + "labels": { + "managed-by-cnrm": "true" + }, + "membershipSpecs": { + "projects/${projectId}/locations/global/memberships/gkehubmembership-${uniqueId}": { + "configmanagement": { + "configSync": { + "sourceFormat": "unstructured" + } + } + } + }, + "name": "projects/${projectId}/locations/global/features/configmanagement", + "resourceState": { + "state": "ACTIVE" + }, + "updateTime": "2024-04-01T12:34:56.123456Z" + } +} + +--- + +GET https://gkehub.googleapis.com/v1beta/projects/${projectId}/locations/global/features/configmanagement?alt=json +Content-Type: application/json +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 + +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": { + "managed-by-cnrm": "true" + }, + "membershipSpecs": { + "projects/${projectId}/locations/global/memberships/gkehubmembership-${uniqueId}": { + "configmanagement": { + "configSync": { + "sourceFormat": "unstructured" + } + } + } + }, + "name": "projects/${projectId}/locations/global/features/configmanagement", + "updateTime": "2024-04-01T12:34:56.123456Z" +} \ No newline at end of file diff --git a/tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/_http04.log b/tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/_http04.log new file mode 100644 index 0000000000..8753389218 --- /dev/null +++ b/tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/_http04.log @@ -0,0 +1,288 @@ +GET https://gkehub.googleapis.com/v1beta/projects/${projectId}/locations/global/features/configmanagement?alt=json +Content-Type: application/json +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 + +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": { + "managed-by-cnrm": "true" + }, + "membershipSpecs": { + "projects/${projectId}/locations/global/memberships/gkehubmembership-${uniqueId}": { + "configmanagement": { + "configSync": { + "sourceFormat": "unstructured" + } + } + } + }, + "name": "projects/${projectId}/locations/global/features/configmanagement", + "updateTime": "2024-04-01T12:34:56.123456Z" +} + +--- + +GET https://gkehub.googleapis.com/v1beta/projects/${projectId}/locations/global/features/configmanagement?alt=json +Content-Type: application/json +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 + +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": { + "managed-by-cnrm": "true" + }, + "membershipSpecs": { + "projects/${projectId}/locations/global/memberships/gkehubmembership-${uniqueId}": { + "configmanagement": { + "configSync": { + "sourceFormat": "unstructured" + } + } + } + }, + "name": "projects/${projectId}/locations/global/features/configmanagement", + "updateTime": "2024-04-01T12:34:56.123456Z" +} + +--- + +GET https://gkehub.googleapis.com/v1beta/projects/${projectId}/locations/global/features/configmanagement?alt=json +Content-Type: application/json +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 + +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": { + "managed-by-cnrm": "true" + }, + "membershipSpecs": { + "projects/${projectId}/locations/global/memberships/gkehubmembership-${uniqueId}": { + "configmanagement": { + "configSync": { + "sourceFormat": "unstructured" + } + } + } + }, + "name": "projects/${projectId}/locations/global/features/configmanagement", + "updateTime": "2024-04-01T12:34:56.123456Z" +} + +--- + +GET https://gkehub.googleapis.com/v1beta/projects/${projectId}/locations/global/features/configmanagement?alt=json +Content-Type: application/json +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 + +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": { + "managed-by-cnrm": "true" + }, + "membershipSpecs": { + "projects/${projectId}/locations/global/memberships/gkehubmembership-${uniqueId}": { + "configmanagement": { + "configSync": { + "sourceFormat": "unstructured" + } + } + } + }, + "name": "projects/${projectId}/locations/global/features/configmanagement", + "updateTime": "2024-04-01T12:34:56.123456Z" +} + +--- + +PATCH https://gkehub.googleapis.com/v1beta/projects/${projectId}/locations/global/features/configmanagement?alt=json&updateMask=membershipSpecs +Content-Type: application/json +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 + +{ + "membershipSpecs": { + "projects/${projectId}/locations/global/memberships/gkehubmembership-${uniqueId}": { + "configmanagement": { + "configSync": { + "git": { + "gcpServiceAccountEmail": "dummy@${projectId}.iam.gserviceaccount.com", + "httpsProxy": "https://github.com", + "policyDir": "config-connector", + "secretType": "none", + "syncBranch": "master", + "syncRepo": "https://github.com/GoogleCloudPlatform/cloud-foundation-toolkit", + "syncRev": "HEAD\"", + "syncWaitSecs": "20" + }, + "preventDrift": false, + "sourceFormat": "hierarchy" + }, + "version": "1.18.1" + } + } + } +} + +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 + +{ + "metadata": { + "@type": "type.googleapis.com/google.cloud.gkehub.v1beta.OperationMetadata", + "createTime": "2024-04-01T12:34:56.123456Z", + "endTime": "2024-04-01T12:34:56.123456Z", + "target": "projects/${projectId}/locations/global/features/configmanagement" + }, + "name": "projects/${projectId}/locations/global/features/configmanagement/operations/${operationID}" +} + +--- + +GET https://gkehub.googleapis.com/v1beta/projects/${projectId}/locations/global/features/configmanagement/operations/${operationID}?alt=json +Content-Type: application/json +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 + +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.gkehub.v1beta.OperationMetadata", + "createTime": "2024-04-01T12:34:56.123456Z", + "endTime": "2024-04-01T12:34:56.123456Z", + "target": "projects/${projectId}/locations/global/features/configmanagement" + }, + "name": "projects/${projectId}/locations/global/features/configmanagement/operations/${operationID}", + "response": { + "@type": "type.googleapis.com/google.cloud.gkehub.v1beta.Feature", + "labels": { + "managed-by-cnrm": "true" + }, + "membershipSpecs": { + "projects/${projectId}/locations/global/memberships/gkehubmembership-${uniqueId}": { + "configmanagement": { + "configSync": { + "git": { + "gcpServiceAccountEmail": "dummy@${projectId}.iam.gserviceaccount.com", + "httpsProxy": "https://github.com", + "policyDir": "config-connector", + "secretType": "none", + "syncBranch": "master", + "syncRepo": "https://github.com/GoogleCloudPlatform/cloud-foundation-toolkit", + "syncRev": "HEAD\"", + "syncWaitSecs": "20" + }, + "sourceFormat": "hierarchy" + }, + "version": "1.18.1" + } + } + }, + "name": "projects/${projectId}/locations/global/features/configmanagement", + "resourceState": { + "state": "ACTIVE" + }, + "updateTime": "2024-04-01T12:34:56.123456Z" + } +} + +--- + +GET https://gkehub.googleapis.com/v1beta/projects/${projectId}/locations/global/features/configmanagement?alt=json +Content-Type: application/json +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 + +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": { + "managed-by-cnrm": "true" + }, + "membershipSpecs": { + "projects/${projectId}/locations/global/memberships/gkehubmembership-${uniqueId}": { + "configmanagement": { + "configSync": { + "git": { + "gcpServiceAccountEmail": "dummy@${projectId}.iam.gserviceaccount.com", + "httpsProxy": "https://github.com", + "policyDir": "config-connector", + "secretType": "none", + "syncBranch": "master", + "syncRepo": "https://github.com/GoogleCloudPlatform/cloud-foundation-toolkit", + "syncRev": "HEAD\"", + "syncWaitSecs": "20" + }, + "sourceFormat": "hierarchy" + }, + "version": "1.18.1" + } + } + }, + "name": "projects/${projectId}/locations/global/features/configmanagement", + "updateTime": "2024-04-01T12:34:56.123456Z" +} \ No newline at end of file diff --git a/tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/_http05.log b/tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/_http05.log new file mode 100644 index 0000000000..930217ccd1 --- /dev/null +++ b/tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/_http05.log @@ -0,0 +1,331 @@ +GET https://gkehub.googleapis.com/v1beta/projects/${projectId}/locations/global/features/configmanagement?alt=json +Content-Type: application/json +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 + +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": { + "managed-by-cnrm": "true" + }, + "membershipSpecs": { + "projects/${projectId}/locations/global/memberships/gkehubmembership-${uniqueId}": { + "configmanagement": { + "configSync": { + "git": { + "gcpServiceAccountEmail": "dummy@${projectId}.iam.gserviceaccount.com", + "httpsProxy": "https://github.com", + "policyDir": "config-connector", + "secretType": "none", + "syncBranch": "master", + "syncRepo": "https://github.com/GoogleCloudPlatform/cloud-foundation-toolkit", + "syncRev": "HEAD\"", + "syncWaitSecs": "20" + }, + "sourceFormat": "hierarchy" + }, + "version": "1.18.1" + } + } + }, + "name": "projects/${projectId}/locations/global/features/configmanagement", + "updateTime": "2024-04-01T12:34:56.123456Z" +} + +--- + +GET https://gkehub.googleapis.com/v1beta/projects/${projectId}/locations/global/features/configmanagement?alt=json +Content-Type: application/json +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 + +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": { + "managed-by-cnrm": "true" + }, + "membershipSpecs": { + "projects/${projectId}/locations/global/memberships/gkehubmembership-${uniqueId}": { + "configmanagement": { + "configSync": { + "git": { + "gcpServiceAccountEmail": "dummy@${projectId}.iam.gserviceaccount.com", + "httpsProxy": "https://github.com", + "policyDir": "config-connector", + "secretType": "none", + "syncBranch": "master", + "syncRepo": "https://github.com/GoogleCloudPlatform/cloud-foundation-toolkit", + "syncRev": "HEAD\"", + "syncWaitSecs": "20" + }, + "sourceFormat": "hierarchy" + }, + "version": "1.18.1" + } + } + }, + "name": "projects/${projectId}/locations/global/features/configmanagement", + "updateTime": "2024-04-01T12:34:56.123456Z" +} + +--- + +GET https://gkehub.googleapis.com/v1beta/projects/${projectId}/locations/global/features/configmanagement?alt=json +Content-Type: application/json +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 + +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": { + "managed-by-cnrm": "true" + }, + "membershipSpecs": { + "projects/${projectId}/locations/global/memberships/gkehubmembership-${uniqueId}": { + "configmanagement": { + "configSync": { + "git": { + "gcpServiceAccountEmail": "dummy@${projectId}.iam.gserviceaccount.com", + "httpsProxy": "https://github.com", + "policyDir": "config-connector", + "secretType": "none", + "syncBranch": "master", + "syncRepo": "https://github.com/GoogleCloudPlatform/cloud-foundation-toolkit", + "syncRev": "HEAD\"", + "syncWaitSecs": "20" + }, + "sourceFormat": "hierarchy" + }, + "version": "1.18.1" + } + } + }, + "name": "projects/${projectId}/locations/global/features/configmanagement", + "updateTime": "2024-04-01T12:34:56.123456Z" +} + +--- + +GET https://gkehub.googleapis.com/v1beta/projects/${projectId}/locations/global/features/configmanagement?alt=json +Content-Type: application/json +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 + +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": { + "managed-by-cnrm": "true" + }, + "membershipSpecs": { + "projects/${projectId}/locations/global/memberships/gkehubmembership-${uniqueId}": { + "configmanagement": { + "configSync": { + "git": { + "gcpServiceAccountEmail": "dummy@${projectId}.iam.gserviceaccount.com", + "httpsProxy": "https://github.com", + "policyDir": "config-connector", + "secretType": "none", + "syncBranch": "master", + "syncRepo": "https://github.com/GoogleCloudPlatform/cloud-foundation-toolkit", + "syncRev": "HEAD\"", + "syncWaitSecs": "20" + }, + "sourceFormat": "hierarchy" + }, + "version": "1.18.1" + } + } + }, + "name": "projects/${projectId}/locations/global/features/configmanagement", + "updateTime": "2024-04-01T12:34:56.123456Z" +} + +--- + +PATCH https://gkehub.googleapis.com/v1beta/projects/${projectId}/locations/global/features/configmanagement?alt=json&updateMask=membershipSpecs +Content-Type: application/json +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 + +{ + "membershipSpecs": { + "projects/${projectId}/locations/global/memberships/gkehubmembership-${uniqueId}": { + "configmanagement": { + "configSync": { + "git": { + "gcpServiceAccountEmail": "dummy@${projectId}.iam.gserviceaccount.com", + "httpsProxy": "https://github.com", + "policyDir": "config-connector", + "secretType": "none", + "syncBranch": "master", + "syncRepo": "https://github.com/GoogleCloudPlatform/cloud-foundation-toolkit", + "syncRev": "HEAD\"", + "syncWaitSecs": "20" + }, + "sourceFormat": "unstructured" + }, + "version": "1.18.1" + } + } + } +} + +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 + +{ + "metadata": { + "@type": "type.googleapis.com/google.cloud.gkehub.v1beta.OperationMetadata", + "createTime": "2024-04-01T12:34:56.123456Z", + "endTime": "2024-04-01T12:34:56.123456Z", + "target": "projects/${projectId}/locations/global/features/configmanagement" + }, + "name": "projects/${projectId}/locations/global/features/configmanagement/operations/${operationID}" +} + +--- + +GET https://gkehub.googleapis.com/v1beta/projects/${projectId}/locations/global/features/configmanagement/operations/${operationID}?alt=json +Content-Type: application/json +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 + +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.gkehub.v1beta.OperationMetadata", + "createTime": "2024-04-01T12:34:56.123456Z", + "endTime": "2024-04-01T12:34:56.123456Z", + "target": "projects/${projectId}/locations/global/features/configmanagement" + }, + "name": "projects/${projectId}/locations/global/features/configmanagement/operations/${operationID}", + "response": { + "@type": "type.googleapis.com/google.cloud.gkehub.v1beta.Feature", + "labels": { + "managed-by-cnrm": "true" + }, + "membershipSpecs": { + "projects/${projectId}/locations/global/memberships/gkehubmembership-${uniqueId}": { + "configmanagement": { + "configSync": { + "git": { + "gcpServiceAccountEmail": "dummy@${projectId}.iam.gserviceaccount.com", + "httpsProxy": "https://github.com", + "policyDir": "config-connector", + "secretType": "none", + "syncBranch": "master", + "syncRepo": "https://github.com/GoogleCloudPlatform/cloud-foundation-toolkit", + "syncRev": "HEAD\"", + "syncWaitSecs": "20" + }, + "sourceFormat": "unstructured" + }, + "version": "1.18.1" + } + } + }, + "name": "projects/${projectId}/locations/global/features/configmanagement", + "resourceState": { + "state": "ACTIVE" + }, + "updateTime": "2024-04-01T12:34:56.123456Z" + } +} + +--- + +GET https://gkehub.googleapis.com/v1beta/projects/${projectId}/locations/global/features/configmanagement?alt=json +Content-Type: application/json +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 + +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": { + "managed-by-cnrm": "true" + }, + "membershipSpecs": { + "projects/${projectId}/locations/global/memberships/gkehubmembership-${uniqueId}": { + "configmanagement": { + "configSync": { + "git": { + "gcpServiceAccountEmail": "dummy@${projectId}.iam.gserviceaccount.com", + "httpsProxy": "https://github.com", + "policyDir": "config-connector", + "secretType": "none", + "syncBranch": "master", + "syncRepo": "https://github.com/GoogleCloudPlatform/cloud-foundation-toolkit", + "syncRev": "HEAD\"", + "syncWaitSecs": "20" + }, + "sourceFormat": "unstructured" + }, + "version": "1.18.1" + } + } + }, + "name": "projects/${projectId}/locations/global/features/configmanagement", + "updateTime": "2024-04-01T12:34:56.123456Z" +} \ No newline at end of file diff --git a/tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/_object00.yaml b/tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/_object00.yaml new file mode 100644 index 0000000000..88dc96c7f1 --- /dev/null +++ b/tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/_object00.yaml @@ -0,0 +1,34 @@ +apiVersion: container.cnrm.cloud.google.com/v1beta1 +kind: ContainerCluster +metadata: + annotations: + cnrm.cloud.google.com/management-conflict-prevention-policy: none + cnrm.cloud.google.com/observed-secret-versions: (removed) + cnrm.cloud.google.com/project-id: ${projectId} + cnrm.cloud.google.com/state-into-spec: absent + finalizers: + - cnrm.cloud.google.com/finalizer + - cnrm.cloud.google.com/deletion-defender + generation: 2 + name: containercluster-${uniqueId} + namespace: ${projectId} +spec: + location: us-central1-a + resourceID: containercluster-${uniqueId} + workloadIdentityConfig: + workloadPool: ${projectId}.svc.id.goog +status: + conditions: + - lastTransitionTime: "1970-01-01T00:00:00Z" + message: The resource is up to date + reason: UpToDate + status: "True" + type: Ready + masterVersion: 1.30.5-gke.1014001 + observedGeneration: 2 + observedState: + privateClusterConfig: + privateEndpoint: 10.128.0.2 + publicEndpoint: 8.8.8.8 + selfLink: https://container.googleapis.com/v1beta1/projects/${projectId}/zones/us-central1-a/clusters/containercluster-${uniqueId} + servicesIpv4Cidr: 34.118.224.0/20 diff --git a/tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/_object01.yaml b/tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/_object01.yaml new file mode 100644 index 0000000000..a0626961fe --- /dev/null +++ b/tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/_object01.yaml @@ -0,0 +1,26 @@ +apiVersion: gkehub.cnrm.cloud.google.com/v1beta1 +kind: GKEHubFeature +metadata: + annotations: + cnrm.cloud.google.com/management-conflict-prevention-policy: none + cnrm.cloud.google.com/project-id: ${projectId} + cnrm.cloud.google.com/state-into-spec: absent + finalizers: + - cnrm.cloud.google.com/finalizer + - cnrm.cloud.google.com/deletion-defender + generation: 1 + name: gkehubfeature-${uniqueId} + namespace: ${projectId} +spec: + location: global + projectRef: + external: projects/${projectId} + resourceID: configmanagement +status: + conditions: + - lastTransitionTime: "1970-01-01T00:00:00Z" + message: The resource is up to date + reason: UpToDate + status: "True" + type: Ready + observedGeneration: 1 diff --git a/tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/_object02.yaml b/tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/_object02.yaml new file mode 100644 index 0000000000..24625e0b11 --- /dev/null +++ b/tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/_object02.yaml @@ -0,0 +1,39 @@ +apiVersion: gkehub.cnrm.cloud.google.com/v1beta1 +kind: GKEHubMembership +metadata: + annotations: + cnrm.cloud.google.com/management-conflict-prevention-policy: none + cnrm.cloud.google.com/project-id: ${projectId} + cnrm.cloud.google.com/state-into-spec: absent + finalizers: + - cnrm.cloud.google.com/finalizer + - cnrm.cloud.google.com/deletion-defender + generation: 2 + name: gkehubmembership-${uniqueId} + namespace: ${projectId} +spec: + authority: + issuer: https://container.googleapis.com/v1/projects/${projectId}/locations/us-central1-a/clusters/containercluster-${uniqueId} + description: A sample GKE Hub membership + endpoint: + gkeCluster: + resourceRef: + name: containercluster-${uniqueId} + location: global + resourceID: gkehubmembership-${uniqueId} +status: + authority: + identityProvider: https://container.googleapis.com/v1/projects/${projectId}/locations/us-central1-a/clusters/containercluster-${uniqueId} + workloadIdentityPool: ${projectId}.svc.id.goog + 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" + observedGeneration: 2 + state: + code: READY + uniqueId: "12345678" + updateTime: "1970-01-01T00:00:00Z" diff --git a/tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/_object03.yaml b/tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/_object03.yaml new file mode 100644 index 0000000000..62a36a652f --- /dev/null +++ b/tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/_object03.yaml @@ -0,0 +1,32 @@ +apiVersion: gkehub.cnrm.cloud.google.com/v1beta1 +kind: GKEHubFeatureMembership +metadata: + annotations: + cnrm.cloud.google.com/management-conflict-prevention-policy: none + cnrm.cloud.google.com/project-id: ${projectId} + cnrm.cloud.google.com/state-into-spec: absent + finalizers: + - cnrm.cloud.google.com/finalizer + - cnrm.cloud.google.com/deletion-defender + generation: 1 + name: gkehubfeaturemembership-${uniqueId} + namespace: ${projectId} +spec: + configmanagement: + configSync: + sourceFormat: unstructured + featureRef: + name: gkehubfeature-${uniqueId} + location: global + membershipRef: + name: gkehubmembership-${uniqueId} + projectRef: + external: projects/${projectId} +status: + conditions: + - lastTransitionTime: "1970-01-01T00:00:00Z" + message: The resource is up to date + reason: UpToDate + status: "True" + type: Ready + observedGeneration: 1 diff --git a/tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/_object04.yaml b/tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/_object04.yaml new file mode 100644 index 0000000000..e2194566ff --- /dev/null +++ b/tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/_object04.yaml @@ -0,0 +1,44 @@ +apiVersion: gkehub.cnrm.cloud.google.com/v1beta1 +kind: GKEHubFeatureMembership +metadata: + annotations: + cnrm.cloud.google.com/management-conflict-prevention-policy: none + cnrm.cloud.google.com/project-id: ${projectId} + cnrm.cloud.google.com/state-into-spec: absent + finalizers: + - cnrm.cloud.google.com/finalizer + - cnrm.cloud.google.com/deletion-defender + generation: 2 + name: gkehubfeaturemembership-${uniqueId} + namespace: ${projectId} +spec: + configmanagement: + configSync: + git: + gcpServiceAccountRef: + external: dummy@${projectId}.iam.gserviceaccount.com + httpsProxy: https://github.com + policyDir: config-connector + secretType: none + syncBranch: master + syncRepo: https://github.com/GoogleCloudPlatform/cloud-foundation-toolkit + syncRev: HEAD" + syncWaitSecs: "20" + preventDrift: false + sourceFormat: hierarchy + version: 1.18.1 + featureRef: + name: gkehubfeature-${uniqueId} + location: global + membershipRef: + name: gkehubmembership-${uniqueId} + projectRef: + external: projects/${projectId} +status: + conditions: + - lastTransitionTime: "1970-01-01T00:00:00Z" + message: The resource is up to date + reason: UpToDate + status: "True" + type: Ready + observedGeneration: 2 diff --git a/tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/_object05.yaml b/tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/_object05.yaml new file mode 100644 index 0000000000..85acb467c0 --- /dev/null +++ b/tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/_object05.yaml @@ -0,0 +1,32 @@ +apiVersion: gkehub.cnrm.cloud.google.com/v1beta1 +kind: GKEHubFeatureMembership +metadata: + annotations: + cnrm.cloud.google.com/management-conflict-prevention-policy: none + cnrm.cloud.google.com/project-id: ${projectId} + cnrm.cloud.google.com/state-into-spec: absent + finalizers: + - cnrm.cloud.google.com/finalizer + - cnrm.cloud.google.com/deletion-defender + generation: 3 + name: gkehubfeaturemembership-${uniqueId} + namespace: ${projectId} +spec: + configmanagement: + configSync: + sourceFormat: unstructured + featureRef: + name: gkehubfeature-${uniqueId} + location: global + membershipRef: + name: gkehubmembership-${uniqueId} + projectRef: + external: projects/${projectId} +status: + conditions: + - lastTransitionTime: "1970-01-01T00:00:00Z" + message: The resource is up to date + reason: UpToDate + status: "True" + type: Ready + observedGeneration: 3 diff --git a/tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/script.yaml b/tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/script.yaml new file mode 100644 index 0000000000..4d16d1b873 --- /dev/null +++ b/tests/e2e/testdata/scenarios/fields/gkehubfeaturemembership/set_unset/script.yaml @@ -0,0 +1,115 @@ +# 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: container.cnrm.cloud.google.com/v1beta1 +kind: ContainerCluster +metadata: + annotations: + cnrm.cloud.google.com/project-id: mock-project + name: containercluster-${uniqueId} +spec: + location: us-central1-a + workloadIdentityConfig: + workloadPool: mock-project.svc.id.goog +--- +apiVersion: gkehub.cnrm.cloud.google.com/v1beta1 +kind: GKEHubFeature +metadata: + name: gkehubfeature-${uniqueId} +spec: + projectRef: + external: projects/mock-project + location: global + resourceID: configmanagement +--- +apiVersion: gkehub.cnrm.cloud.google.com/v1beta1 +kind: GKEHubMembership +metadata: + annotations: + cnrm.cloud.google.com/project-id: mock-project + name: gkehubmembership-${uniqueId} +spec: + location: global + authority: + issuer: https://container.googleapis.com/v1/projects/mock-project/locations/us-central1-a/clusters/containercluster-${uniqueId} + description: A sample GKE Hub membership + endpoint: + gkeCluster: + resourceRef: + name: containercluster-${uniqueId} +--- +apiVersion: gkehub.cnrm.cloud.google.com/v1beta1 +kind: GKEHubFeatureMembership +metadata: + name: gkehubfeaturemembership-${uniqueId} + annotations: + cnrm.cloud.google.com/state-into-spec: absent +spec: + projectRef: + external: projects/mock-project + location: global + membershipRef: + name: gkehubmembership-${uniqueId} + featureRef: + name: gkehubfeature-${uniqueId} + configmanagement: + configSync: + sourceFormat: unstructured +--- +apiVersion: gkehub.cnrm.cloud.google.com/v1beta1 +kind: GKEHubFeatureMembership +metadata: + name: gkehubfeaturemembership-${uniqueId} + annotations: + cnrm.cloud.google.com/state-into-spec: absent +spec: + projectRef: + external: projects/mock-project + location: global + membershipRef: + name: gkehubmembership-${uniqueId} + featureRef: + name: gkehubfeature-${uniqueId} + configmanagement: + configSync: + git: + gcpServiceAccountRef: + external: dummy@mock-project.iam.gserviceaccount.com + httpsProxy: "https://github.com" + policyDir: "config-connector" + secretType: "none" + syncBranch: "master" + syncRepo: "https://github.com/GoogleCloudPlatform/cloud-foundation-toolkit" + syncRev: HEAD" + syncWaitSecs: "20" + preventDrift: false + sourceFormat: hierarchy + version: "1.18.1" +--- +apiVersion: gkehub.cnrm.cloud.google.com/v1beta1 +kind: GKEHubFeatureMembership +metadata: + name: gkehubfeaturemembership-${uniqueId} + annotations: + cnrm.cloud.google.com/state-into-spec: absent +spec: + projectRef: + external: projects/mock-project + location: global + membershipRef: + name: gkehubmembership-${uniqueId} + featureRef: + name: gkehubfeature-${uniqueId} + configmanagement: + configSync: + sourceFormat: unstructured \ No newline at end of file