From d3c664bc2d0e445d07e3c82a65107f1fb6167434 Mon Sep 17 00:00:00 2001 From: Ziyue Yan Date: Tue, 10 Dec 2024 01:10:15 +0000 Subject: [PATCH] only patch membership config for one membership --- mockgcp/mockgkehub/gkehubfeature.go | 12 +- .../gkehub/featuremembership_controller.go | 7 +- .../update_single_membership/_http00.log | 843 ++++++++++++++++++ .../update_single_membership/_http01.log | 843 ++++++++++++++++++ .../update_single_membership/_http02.log | 194 ++++ .../update_single_membership/_http03.log | 384 ++++++++ .../update_single_membership/_http04.log | 384 ++++++++ .../update_single_membership/_http05.log | 118 +++ .../update_single_membership/_http06.log | 144 +++ .../update_single_membership/_http07.log | 155 ++++ .../update_single_membership/_object00.yaml | 34 + .../update_single_membership/_object01.yaml | 34 + .../update_single_membership/_object02.yaml | 26 + .../update_single_membership/_object03.yaml | 39 + .../update_single_membership/_object04.yaml | 39 + .../update_single_membership/_object05.yaml | 34 + .../update_single_membership/_object06.yaml | 34 + .../update_single_membership/_object07.yaml | 34 + .../update_single_membership/script.yaml | 137 +++ 19 files changed, 3490 insertions(+), 5 deletions(-) create mode 100644 tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_http00.log create mode 100644 tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_http01.log create mode 100644 tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_http02.log create mode 100644 tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_http03.log create mode 100644 tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_http04.log create mode 100644 tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_http05.log create mode 100644 tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_http06.log create mode 100644 tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_http07.log create mode 100644 tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_object00.yaml create mode 100644 tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_object01.yaml create mode 100644 tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_object02.yaml create mode 100644 tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_object03.yaml create mode 100644 tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_object04.yaml create mode 100644 tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_object05.yaml create mode 100644 tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_object06.yaml create mode 100644 tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_object07.yaml create mode 100644 tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/script.yaml diff --git a/mockgcp/mockgkehub/gkehubfeature.go b/mockgcp/mockgkehub/gkehubfeature.go index 1aa4d97c29..26f1d86f50 100644 --- a/mockgcp/mockgkehub/gkehubfeature.go +++ b/mockgcp/mockgkehub/gkehubfeature.go @@ -116,7 +116,7 @@ func (s *GKEHubFeature) UpdateFeature(ctx context.Context, req *pb.UpdateFeature case "spec": obj.Spec = req.GetResource().Spec case "membershipSpecs": - obj.MembershipSpecs = req.GetResource().GetMembershipSpecs() + obj.MembershipSpecs = updateMembershipSpecsMap(obj.MembershipSpecs, req.GetResource().GetMembershipSpecs()) default: return nil, status.Errorf(codes.InvalidArgument, "update_mask path %q not valid", path) } @@ -139,6 +139,16 @@ func (s *GKEHubFeature) UpdateFeature(ctx context.Context, req *pb.UpdateFeature }) } +func updateMembershipSpecsMap(membershipSpecs, membershipSpecsPatch map[string]*pb.MembershipFeatureSpec) map[string]*pb.MembershipFeatureSpec { + if membershipSpecs == nil { + membershipSpecs = make(map[string]*pb.MembershipFeatureSpec) + } + for k, v := range membershipSpecsPatch { + membershipSpecs[k] = v + } + return membershipSpecs +} + func (s *GKEHubFeature) DeleteFeature(ctx context.Context, req *pb.DeleteFeatureRequest) (*longrunning.Operation, error) { name, err := s.parseFeatureName(req.Name) if err != nil { diff --git a/pkg/controller/direct/gkehub/featuremembership_controller.go b/pkg/controller/direct/gkehub/featuremembership_controller.go index d5d4cf0313..77da5faf7e 100644 --- a/pkg/controller/direct/gkehub/featuremembership_controller.go +++ b/pkg/controller/direct/gkehub/featuremembership_controller.go @@ -183,16 +183,15 @@ func (a *gkeHubAdapter) Delete(ctx context.Context, deleteOp *directbase.DeleteO func (a *gkeHubAdapter) patchMembershipSpec(ctx context.Context) ([]byte, error) { feature := a.actual - mSpecs := feature.MembershipSpecs - if mSpecs == nil { - mSpecs = make(map[string]featureapi.MembershipFeatureSpec) - } + mSpecs := make(map[string]featureapi.MembershipFeatureSpec) // only change the feature configuration for the associated membership desiredApiObj, err := featureMembershipSpecKRMtoMembershipFeatureSpecAPI(&a.desired.Spec) if err != nil { return nil, err } mSpecs[a.membershipID] = *desiredApiObj + // MembershipSpecs is a map of membership spec. Here we only patch one membership. + // GKE Hub server doesn't patch other memberships if they are not present in the membershipSpecs map. feature.MembershipSpecs = mSpecs op, err := a.hubClient.featureClient.Patch(a.featureID, feature).UpdateMask("membershipSpecs").Context(ctx).Do() if err != nil { diff --git a/tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_http00.log b/tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_http00.log new file mode 100644 index 0000000000..f7f0582230 --- /dev/null +++ b/tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_http00.log @@ -0,0 +1,843 @@ +GET https://container.googleapis.com/v1beta1/projects/${projectId}/locations/us-central1-a/clusters/containercluster1-${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/containercluster1-${uniqueId}.", + "reason": "notFound" + } + ], + "message": "Not found: projects/${projectId}/zones/us-central1-a/clusters/containercluster1-${uniqueId}.", + "status": "NOT_FOUND" + } +} + +--- + +GET https://container.googleapis.com/v1beta1/projects/${projectId}/locations/us-central1-a/clusters/containercluster1-${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/containercluster1-${uniqueId}.", + "reason": "notFound" + } + ], + "message": "Not found: projects/${projectId}/zones/us-central1-a/clusters/containercluster1-${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": "containercluster1-${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/containercluster1-${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/containercluster1-${uniqueId}", + "zone": "us-central1-a" +} + +--- + +GET https://container.googleapis.com/v1beta1/projects/${projectId}/locations/us-central1-a/clusters/containercluster1-${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": "containercluster1-${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/containercluster1-${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/containercluster1-${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": "containercluster1-${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/containercluster1-${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/containercluster1-${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": "containercluster1-${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/containercluster1-${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/gkehubfeaturemembership/update_single_membership/_http01.log b/tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_http01.log new file mode 100644 index 0000000000..f4479cb941 --- /dev/null +++ b/tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_http01.log @@ -0,0 +1,843 @@ +GET https://container.googleapis.com/v1beta1/projects/${projectId}/locations/us-central1-a/clusters/containercluster2-${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/containercluster2-${uniqueId}.", + "reason": "notFound" + } + ], + "message": "Not found: projects/${projectId}/zones/us-central1-a/clusters/containercluster2-${uniqueId}.", + "status": "NOT_FOUND" + } +} + +--- + +GET https://container.googleapis.com/v1beta1/projects/${projectId}/locations/us-central1-a/clusters/containercluster2-${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/containercluster2-${uniqueId}.", + "reason": "notFound" + } + ], + "message": "Not found: projects/${projectId}/zones/us-central1-a/clusters/containercluster2-${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": "containercluster2-${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/containercluster2-${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/containercluster2-${uniqueId}", + "zone": "us-central1-a" +} + +--- + +GET https://container.googleapis.com/v1beta1/projects/${projectId}/locations/us-central1-a/clusters/containercluster2-${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": "containercluster2-${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/containercluster2-${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/containercluster2-${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": "containercluster2-${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/containercluster2-${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/containercluster2-${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": "containercluster2-${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/containercluster2-${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/gkehubfeaturemembership/update_single_membership/_http02.log b/tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_http02.log new file mode 100644 index 0000000000..2162e61d40 --- /dev/null +++ b/tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_http02.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/gkehubfeaturemembership/update_single_membership/_http03.log b/tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_http03.log new file mode 100644 index 0000000000..7fcd077000 --- /dev/null +++ b/tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_http03.log @@ -0,0 +1,384 @@ +GET https://gkehub.googleapis.com/v1beta1/projects/${projectId}/locations/us-central1/memberships/gkehubmembership1-${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/us-central1/memberships/gkehubmembership1-${uniqueId}\" not found", + "status": "NOT_FOUND" + } +} + +--- + +GET https://gkehub.googleapis.com/v1beta1/projects/${projectId}/locations/us-central1/memberships/gkehubmembership1-${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/us-central1/memberships/gkehubmembership1-${uniqueId}\" not found", + "status": "NOT_FOUND" + } +} + +--- + +GET https://gkehub.googleapis.com/v1beta1/projects/${projectId}/locations/us-central1/memberships/gkehubmembership1-${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/us-central1/memberships/gkehubmembership1-${uniqueId}\" not found", + "status": "NOT_FOUND" + } +} + +--- + +POST https://gkehub.googleapis.com/v1beta1/projects/${projectId}/locations/us-central1/memberships?alt=json&membershipId=gkehubmembership1-${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/containercluster1-${uniqueId}" + }, + "description": "A sample GKE Hub membership", + "endpoint": { + "gkeCluster": { + "resourceLink": "//container.googleapis.com/projects/${projectId}/zones/us-central1-a/clusters/containercluster1-${uniqueId}" + } + }, + "labels": { + "managed-by-cnrm": "true" + }, + "name": "projects/${projectId}/locations/us-central1/memberships/gkehubmembership1-${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/us-central1/memberships/gkehubmembership1-${uniqueId}" + }, + "name": "projects/${projectId}/locations/us-central1/memberships/gkehubmembership1-${uniqueId}/operations/${operationID}" +} + +--- + +GET https://gkehub.googleapis.com/v1beta1/projects/${projectId}/locations/us-central1/memberships/gkehubmembership1-${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/us-central1/memberships/gkehubmembership1-${uniqueId}" + }, + "name": "projects/${projectId}/locations/us-central1/memberships/gkehubmembership1-${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/containercluster1-${uniqueId}", + "issuer": "https://container.googleapis.com/v1/projects/${projectId}/locations/us-central1-a/clusters/containercluster1-${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/containercluster1-${uniqueId}" + } + }, + "externalId": "c772f869-1d6c-4d50-a92e-816c48322246", + "infrastructureType": "MULTI_CLOUD", + "labels": { + "managed-by-cnrm": "true" + }, + "name": "projects/${projectId}/locations/us-central1/memberships/gkehubmembership1-${uniqueId}", + "state": { + "code": "READY" + }, + "uniqueId": "12345678", + "updateTime": "2024-04-01T12:34:56.123456Z" + } +} + +--- + +GET https://gkehub.googleapis.com/v1beta1/projects/${projectId}/locations/us-central1/memberships/gkehubmembership1-${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/containercluster1-${uniqueId}", + "issuer": "https://container.googleapis.com/v1/projects/${projectId}/locations/us-central1-a/clusters/containercluster1-${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/containercluster1-${uniqueId}" + } + }, + "externalId": "c772f869-1d6c-4d50-a92e-816c48322246", + "infrastructureType": "MULTI_CLOUD", + "labels": { + "managed-by-cnrm": "true" + }, + "name": "projects/${projectId}/locations/us-central1/memberships/gkehubmembership1-${uniqueId}", + "state": { + "code": "READY" + }, + "uniqueId": "111111111111111111111", + "updateTime": "2024-04-01T12:34:56.123456Z" +} + +--- + +GET https://gkehub.googleapis.com/v1beta1/projects/${projectId}/locations/us-central1/memberships/gkehubmembership1-${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/containercluster1-${uniqueId}", + "issuer": "https://container.googleapis.com/v1/projects/${projectId}/locations/us-central1-a/clusters/containercluster1-${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/containercluster1-${uniqueId}" + } + }, + "externalId": "c772f869-1d6c-4d50-a92e-816c48322246", + "infrastructureType": "MULTI_CLOUD", + "labels": { + "managed-by-cnrm": "true" + }, + "name": "projects/${projectId}/locations/us-central1/memberships/gkehubmembership1-${uniqueId}", + "state": { + "code": "READY" + }, + "uniqueId": "111111111111111111111", + "updateTime": "2024-04-01T12:34:56.123456Z" +} + +--- + +GET https://gkehub.googleapis.com/v1beta1/projects/${projectId}/locations/us-central1/memberships/gkehubmembership1-${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/containercluster1-${uniqueId}", + "issuer": "https://container.googleapis.com/v1/projects/${projectId}/locations/us-central1-a/clusters/containercluster1-${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/containercluster1-${uniqueId}" + } + }, + "externalId": "c772f869-1d6c-4d50-a92e-816c48322246", + "infrastructureType": "MULTI_CLOUD", + "labels": { + "managed-by-cnrm": "true" + }, + "name": "projects/${projectId}/locations/us-central1/memberships/gkehubmembership1-${uniqueId}", + "state": { + "code": "READY" + }, + "uniqueId": "111111111111111111111", + "updateTime": "2024-04-01T12:34:56.123456Z" +} + +--- + +GET https://gkehub.googleapis.com/v1beta1/projects/${projectId}/locations/us-central1/memberships/gkehubmembership1-${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/containercluster1-${uniqueId}", + "issuer": "https://container.googleapis.com/v1/projects/${projectId}/locations/us-central1-a/clusters/containercluster1-${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/containercluster1-${uniqueId}" + } + }, + "externalId": "c772f869-1d6c-4d50-a92e-816c48322246", + "infrastructureType": "MULTI_CLOUD", + "labels": { + "managed-by-cnrm": "true" + }, + "name": "projects/${projectId}/locations/us-central1/memberships/gkehubmembership1-${uniqueId}", + "state": { + "code": "READY" + }, + "uniqueId": "111111111111111111111", + "updateTime": "2024-04-01T12:34:56.123456Z" +} + +--- + +GET https://gkehub.googleapis.com/v1beta1/projects/${projectId}/locations/us-central1/memberships/gkehubmembership1-${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/containercluster1-${uniqueId}", + "issuer": "https://container.googleapis.com/v1/projects/${projectId}/locations/us-central1-a/clusters/containercluster1-${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/containercluster1-${uniqueId}" + } + }, + "externalId": "c772f869-1d6c-4d50-a92e-816c48322246", + "infrastructureType": "MULTI_CLOUD", + "labels": { + "managed-by-cnrm": "true" + }, + "name": "projects/${projectId}/locations/us-central1/memberships/gkehubmembership1-${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/gkehubfeaturemembership/update_single_membership/_http04.log b/tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_http04.log new file mode 100644 index 0000000000..b8ba1ff34c --- /dev/null +++ b/tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_http04.log @@ -0,0 +1,384 @@ +GET https://gkehub.googleapis.com/v1beta1/projects/${projectId}/locations/us-central1/memberships/gkehubmembership2-${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/us-central1/memberships/gkehubmembership2-${uniqueId}\" not found", + "status": "NOT_FOUND" + } +} + +--- + +GET https://gkehub.googleapis.com/v1beta1/projects/${projectId}/locations/us-central1/memberships/gkehubmembership2-${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/us-central1/memberships/gkehubmembership2-${uniqueId}\" not found", + "status": "NOT_FOUND" + } +} + +--- + +GET https://gkehub.googleapis.com/v1beta1/projects/${projectId}/locations/us-central1/memberships/gkehubmembership2-${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/us-central1/memberships/gkehubmembership2-${uniqueId}\" not found", + "status": "NOT_FOUND" + } +} + +--- + +POST https://gkehub.googleapis.com/v1beta1/projects/${projectId}/locations/us-central1/memberships?alt=json&membershipId=gkehubmembership2-${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/containercluster2-${uniqueId}" + }, + "description": "A sample GKE Hub membership", + "endpoint": { + "gkeCluster": { + "resourceLink": "//container.googleapis.com/projects/${projectId}/zones/us-central1-a/clusters/containercluster2-${uniqueId}" + } + }, + "labels": { + "managed-by-cnrm": "true" + }, + "name": "projects/${projectId}/locations/us-central1/memberships/gkehubmembership2-${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/us-central1/memberships/gkehubmembership2-${uniqueId}" + }, + "name": "projects/${projectId}/locations/us-central1/memberships/gkehubmembership2-${uniqueId}/operations/${operationID}" +} + +--- + +GET https://gkehub.googleapis.com/v1beta1/projects/${projectId}/locations/us-central1/memberships/gkehubmembership2-${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/us-central1/memberships/gkehubmembership2-${uniqueId}" + }, + "name": "projects/${projectId}/locations/us-central1/memberships/gkehubmembership2-${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/containercluster2-${uniqueId}", + "issuer": "https://container.googleapis.com/v1/projects/${projectId}/locations/us-central1-a/clusters/containercluster2-${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/containercluster2-${uniqueId}" + } + }, + "externalId": "c772f869-1d6c-4d50-a92e-816c48322246", + "infrastructureType": "MULTI_CLOUD", + "labels": { + "managed-by-cnrm": "true" + }, + "name": "projects/${projectId}/locations/us-central1/memberships/gkehubmembership2-${uniqueId}", + "state": { + "code": "READY" + }, + "uniqueId": "12345678", + "updateTime": "2024-04-01T12:34:56.123456Z" + } +} + +--- + +GET https://gkehub.googleapis.com/v1beta1/projects/${projectId}/locations/us-central1/memberships/gkehubmembership2-${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/containercluster2-${uniqueId}", + "issuer": "https://container.googleapis.com/v1/projects/${projectId}/locations/us-central1-a/clusters/containercluster2-${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/containercluster2-${uniqueId}" + } + }, + "externalId": "c772f869-1d6c-4d50-a92e-816c48322246", + "infrastructureType": "MULTI_CLOUD", + "labels": { + "managed-by-cnrm": "true" + }, + "name": "projects/${projectId}/locations/us-central1/memberships/gkehubmembership2-${uniqueId}", + "state": { + "code": "READY" + }, + "uniqueId": "111111111111111111111", + "updateTime": "2024-04-01T12:34:56.123456Z" +} + +--- + +GET https://gkehub.googleapis.com/v1beta1/projects/${projectId}/locations/us-central1/memberships/gkehubmembership2-${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/containercluster2-${uniqueId}", + "issuer": "https://container.googleapis.com/v1/projects/${projectId}/locations/us-central1-a/clusters/containercluster2-${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/containercluster2-${uniqueId}" + } + }, + "externalId": "c772f869-1d6c-4d50-a92e-816c48322246", + "infrastructureType": "MULTI_CLOUD", + "labels": { + "managed-by-cnrm": "true" + }, + "name": "projects/${projectId}/locations/us-central1/memberships/gkehubmembership2-${uniqueId}", + "state": { + "code": "READY" + }, + "uniqueId": "111111111111111111111", + "updateTime": "2024-04-01T12:34:56.123456Z" +} + +--- + +GET https://gkehub.googleapis.com/v1beta1/projects/${projectId}/locations/us-central1/memberships/gkehubmembership2-${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/containercluster2-${uniqueId}", + "issuer": "https://container.googleapis.com/v1/projects/${projectId}/locations/us-central1-a/clusters/containercluster2-${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/containercluster2-${uniqueId}" + } + }, + "externalId": "c772f869-1d6c-4d50-a92e-816c48322246", + "infrastructureType": "MULTI_CLOUD", + "labels": { + "managed-by-cnrm": "true" + }, + "name": "projects/${projectId}/locations/us-central1/memberships/gkehubmembership2-${uniqueId}", + "state": { + "code": "READY" + }, + "uniqueId": "111111111111111111111", + "updateTime": "2024-04-01T12:34:56.123456Z" +} + +--- + +GET https://gkehub.googleapis.com/v1beta1/projects/${projectId}/locations/us-central1/memberships/gkehubmembership2-${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/containercluster2-${uniqueId}", + "issuer": "https://container.googleapis.com/v1/projects/${projectId}/locations/us-central1-a/clusters/containercluster2-${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/containercluster2-${uniqueId}" + } + }, + "externalId": "c772f869-1d6c-4d50-a92e-816c48322246", + "infrastructureType": "MULTI_CLOUD", + "labels": { + "managed-by-cnrm": "true" + }, + "name": "projects/${projectId}/locations/us-central1/memberships/gkehubmembership2-${uniqueId}", + "state": { + "code": "READY" + }, + "uniqueId": "111111111111111111111", + "updateTime": "2024-04-01T12:34:56.123456Z" +} + +--- + +GET https://gkehub.googleapis.com/v1beta1/projects/${projectId}/locations/us-central1/memberships/gkehubmembership2-${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/containercluster2-${uniqueId}", + "issuer": "https://container.googleapis.com/v1/projects/${projectId}/locations/us-central1-a/clusters/containercluster2-${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/containercluster2-${uniqueId}" + } + }, + "externalId": "c772f869-1d6c-4d50-a92e-816c48322246", + "infrastructureType": "MULTI_CLOUD", + "labels": { + "managed-by-cnrm": "true" + }, + "name": "projects/${projectId}/locations/us-central1/memberships/gkehubmembership2-${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/gkehubfeaturemembership/update_single_membership/_http05.log b/tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_http05.log new file mode 100644 index 0000000000..e470093ce4 --- /dev/null +++ b/tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_http05.log @@ -0,0 +1,118 @@ +GET https://gkehub.googleapis.com/v1beta/projects/${projectId}/locations/global/features/configmanagement?alt=json&prettyPrint=false +User-Agent: 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": { + "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&prettyPrint=false&updateMask=membershipSpecs +Content-Type: application/json +User-Agent: kcc/controller-manager + +{ + "labels": { + "managed-by-cnrm": "true" + }, + "membershipSpecs": { + "projects/${projectId}/locations/global/memberships/gkehubmembership2-${uniqueId}": { + "configmanagement": { + "configSync": { + "git": { + "syncBranch": "main", + "syncRepo": "https://github.com/GoogleCloudPlatform/anthos-config-management-samples" + }, + "sourceFormat": "hierarchy" + } + } + } + }, + "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/v1beta/projects/${projectId}/locations/global/features/configmanagement/operations/${operationID}?alt=json&prettyPrint=false +User-Agent: kcc/controller-manager + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "done": true, + "metadata": { + "@type": "type.googleapis.com/google.cloud.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/gkehubmembership2-${uniqueId}": { + "configmanagement": { + "configSync": { + "git": { + "syncBranch": "main", + "syncRepo": "https://github.com/GoogleCloudPlatform/anthos-config-management-samples" + }, + "sourceFormat": "hierarchy" + } + } + } + }, + "name": "projects/${projectId}/locations/global/features/configmanagement", + "resourceState": { + "state": "ACTIVE" + }, + "updateTime": "2024-04-01T12:34:56.123456Z" + } +} \ No newline at end of file diff --git a/tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_http06.log b/tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_http06.log new file mode 100644 index 0000000000..f9a9d7d198 --- /dev/null +++ b/tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_http06.log @@ -0,0 +1,144 @@ +GET https://gkehub.googleapis.com/v1beta/projects/${projectId}/locations/global/features/configmanagement?alt=json&prettyPrint=false +User-Agent: 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": { + "managed-by-cnrm": "true" + }, + "membershipSpecs": { + "projects/${projectId}/locations/global/memberships/gkehubmembership2-${uniqueId}": { + "configmanagement": { + "configSync": { + "git": { + "syncBranch": "main", + "syncRepo": "https://github.com/GoogleCloudPlatform/anthos-config-management-samples" + }, + "sourceFormat": "hierarchy" + } + } + } + }, + "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&prettyPrint=false&updateMask=membershipSpecs +Content-Type: application/json +User-Agent: kcc/controller-manager + +{ + "labels": { + "managed-by-cnrm": "true" + }, + "membershipSpecs": { + "projects/${projectId}/locations/global/memberships/gkehubmembership1-${uniqueId}": { + "configmanagement": { + "configSync": { + "git": { + "syncBranch": "master", + "syncRepo": "https://github.com/GoogleCloudPlatform/cloud-foundation-toolkit" + }, + "sourceFormat": "hierarchy" + } + } + } + }, + "name": "projects/${projectId}/locations/global/features/configmanagement", + "updateTime": "2024-04-01T12:34:56.123456Z" +} + +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&prettyPrint=false +User-Agent: kcc/controller-manager + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "done": true, + "metadata": { + "@type": "type.googleapis.com/google.cloud.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/gkehubmembership1-${uniqueId}": { + "configmanagement": { + "configSync": { + "git": { + "syncBranch": "master", + "syncRepo": "https://github.com/GoogleCloudPlatform/cloud-foundation-toolkit" + }, + "sourceFormat": "hierarchy" + } + } + }, + "projects/${projectId}/locations/global/memberships/gkehubmembership2-${uniqueId}": { + "configmanagement": { + "configSync": { + "git": { + "syncBranch": "main", + "syncRepo": "https://github.com/GoogleCloudPlatform/anthos-config-management-samples" + }, + "sourceFormat": "hierarchy" + } + } + } + }, + "name": "projects/${projectId}/locations/global/features/configmanagement", + "resourceState": { + "state": "ACTIVE" + }, + "updateTime": "2024-04-01T12:34:56.123456Z" + } +} \ No newline at end of file diff --git a/tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_http07.log b/tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_http07.log new file mode 100644 index 0000000000..28fa8013f5 --- /dev/null +++ b/tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_http07.log @@ -0,0 +1,155 @@ +GET https://gkehub.googleapis.com/v1beta/projects/${projectId}/locations/global/features/configmanagement?alt=json&prettyPrint=false +User-Agent: 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": { + "managed-by-cnrm": "true" + }, + "membershipSpecs": { + "projects/${projectId}/locations/global/memberships/gkehubmembership1-${uniqueId}": { + "configmanagement": { + "configSync": { + "git": { + "syncBranch": "master", + "syncRepo": "https://github.com/GoogleCloudPlatform/cloud-foundation-toolkit" + }, + "sourceFormat": "hierarchy" + } + } + }, + "projects/${projectId}/locations/global/memberships/gkehubmembership2-${uniqueId}": { + "configmanagement": { + "configSync": { + "git": { + "syncBranch": "main", + "syncRepo": "https://github.com/GoogleCloudPlatform/anthos-config-management-samples" + }, + "sourceFormat": "hierarchy" + } + } + } + }, + "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&prettyPrint=false&updateMask=membershipSpecs +Content-Type: application/json +User-Agent: kcc/controller-manager + +{ + "labels": { + "managed-by-cnrm": "true" + }, + "membershipSpecs": { + "projects/${projectId}/locations/global/memberships/gkehubmembership1-${uniqueId}": { + "configmanagement": { + "configSync": { + "git": { + "syncBranch": "master", + "syncRepo": "https://github.com/GoogleCloudPlatform/cloud-foundation-toolkit" + }, + "sourceFormat": "unstructured" + } + } + } + }, + "name": "projects/${projectId}/locations/global/features/configmanagement", + "updateTime": "2024-04-01T12:34:56.123456Z" +} + +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&prettyPrint=false +User-Agent: kcc/controller-manager + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "done": true, + "metadata": { + "@type": "type.googleapis.com/google.cloud.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/gkehubmembership1-${uniqueId}": { + "configmanagement": { + "configSync": { + "git": { + "syncBranch": "master", + "syncRepo": "https://github.com/GoogleCloudPlatform/cloud-foundation-toolkit" + }, + "sourceFormat": "unstructured" + } + } + }, + "projects/${projectId}/locations/global/memberships/gkehubmembership2-${uniqueId}": { + "configmanagement": { + "configSync": { + "git": { + "syncBranch": "main", + "syncRepo": "https://github.com/GoogleCloudPlatform/anthos-config-management-samples" + }, + "sourceFormat": "hierarchy" + } + } + } + }, + "name": "projects/${projectId}/locations/global/features/configmanagement", + "resourceState": { + "state": "ACTIVE" + }, + "updateTime": "2024-04-01T12:34:56.123456Z" + } +} \ No newline at end of file diff --git a/tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_object00.yaml b/tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_object00.yaml new file mode 100644 index 0000000000..754a32871e --- /dev/null +++ b/tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_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: containercluster1-${uniqueId} + namespace: ${projectId} +spec: + location: us-central1-a + resourceID: containercluster1-${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/containercluster1-${uniqueId} + servicesIpv4Cidr: 34.118.224.0/20 diff --git a/tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_object01.yaml b/tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_object01.yaml new file mode 100644 index 0000000000..9332a1f0d5 --- /dev/null +++ b/tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_object01.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: containercluster2-${uniqueId} + namespace: ${projectId} +spec: + location: us-central1-a + resourceID: containercluster2-${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/containercluster2-${uniqueId} + servicesIpv4Cidr: 34.118.224.0/20 diff --git a/tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_object02.yaml b/tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_object02.yaml new file mode 100644 index 0000000000..a0626961fe --- /dev/null +++ b/tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_object02.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/gkehubfeaturemembership/update_single_membership/_object03.yaml b/tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_object03.yaml new file mode 100644 index 0000000000..46cc71ec73 --- /dev/null +++ b/tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_object03.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: gkehubmembership1-${uniqueId} + namespace: ${projectId} +spec: + authority: + issuer: https://container.googleapis.com/v1/projects/${projectId}/locations/us-central1-a/clusters/containercluster1-${uniqueId} + description: A sample GKE Hub membership + endpoint: + gkeCluster: + resourceRef: + name: containercluster1-${uniqueId} + location: us-central1 + resourceID: gkehubmembership1-${uniqueId} +status: + authority: + identityProvider: https://container.googleapis.com/v1/projects/${projectId}/locations/us-central1-a/clusters/containercluster1-${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/gkehubfeaturemembership/update_single_membership/_object04.yaml b/tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_object04.yaml new file mode 100644 index 0000000000..e7f3b05571 --- /dev/null +++ b/tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_object04.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: gkehubmembership2-${uniqueId} + namespace: ${projectId} +spec: + authority: + issuer: https://container.googleapis.com/v1/projects/${projectId}/locations/us-central1-a/clusters/containercluster2-${uniqueId} + description: A sample GKE Hub membership + endpoint: + gkeCluster: + resourceRef: + name: containercluster2-${uniqueId} + location: us-central1 + resourceID: gkehubmembership2-${uniqueId} +status: + authority: + identityProvider: https://container.googleapis.com/v1/projects/${projectId}/locations/us-central1-a/clusters/containercluster2-${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/gkehubfeaturemembership/update_single_membership/_object05.yaml b/tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_object05.yaml new file mode 100644 index 0000000000..426cb7b42e --- /dev/null +++ b/tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_object05.yaml @@ -0,0 +1,34 @@ +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} + finalizers: + - cnrm.cloud.google.com/finalizer + - cnrm.cloud.google.com/deletion-defender + generation: 1 + name: gkehubfeaturemembership2-${uniqueId} + namespace: ${projectId} +spec: + configmanagement: + configSync: + git: + syncBranch: main + syncRepo: https://github.com/GoogleCloudPlatform/anthos-config-management-samples + sourceFormat: hierarchy + featureRef: + name: gkehubfeature-${uniqueId} + location: global + membershipRef: + name: gkehubmembership2-${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/gkehubfeaturemembership/update_single_membership/_object06.yaml b/tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_object06.yaml new file mode 100644 index 0000000000..7d2cf1aa22 --- /dev/null +++ b/tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_object06.yaml @@ -0,0 +1,34 @@ +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} + finalizers: + - cnrm.cloud.google.com/finalizer + - cnrm.cloud.google.com/deletion-defender + generation: 1 + name: gkehubfeaturemembership1-${uniqueId} + namespace: ${projectId} +spec: + configmanagement: + configSync: + git: + syncBranch: master + syncRepo: https://github.com/GoogleCloudPlatform/cloud-foundation-toolkit + sourceFormat: hierarchy + featureRef: + name: gkehubfeature-${uniqueId} + location: global + membershipRef: + name: gkehubmembership1-${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/gkehubfeaturemembership/update_single_membership/_object07.yaml b/tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_object07.yaml new file mode 100644 index 0000000000..eac9970306 --- /dev/null +++ b/tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/_object07.yaml @@ -0,0 +1,34 @@ +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} + finalizers: + - cnrm.cloud.google.com/finalizer + - cnrm.cloud.google.com/deletion-defender + generation: 2 + name: gkehubfeaturemembership1-${uniqueId} + namespace: ${projectId} +spec: + configmanagement: + configSync: + git: + syncBranch: master + syncRepo: https://github.com/GoogleCloudPlatform/cloud-foundation-toolkit + sourceFormat: unstructured + featureRef: + name: gkehubfeature-${uniqueId} + location: global + membershipRef: + name: gkehubmembership1-${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/gkehubfeaturemembership/update_single_membership/script.yaml b/tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/script.yaml new file mode 100644 index 0000000000..c2f97c162d --- /dev/null +++ b/tests/e2e/testdata/scenarios/gkehubfeaturemembership/update_single_membership/script.yaml @@ -0,0 +1,137 @@ +# 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: containercluster1-${uniqueId} +spec: + location: us-central1-a + workloadIdentityConfig: + workloadPool: mock-project.svc.id.goog +--- +apiVersion: container.cnrm.cloud.google.com/v1beta1 +kind: ContainerCluster +metadata: + annotations: + cnrm.cloud.google.com/project-id: mock-project + name: containercluster2-${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: gkehubmembership1-${uniqueId} +spec: + location: us-central1 + authority: + issuer: https://container.googleapis.com/v1/projects/mock-project/locations/us-central1-a/clusters/containercluster1-${uniqueId} + description: A sample GKE Hub membership + endpoint: + gkeCluster: + resourceRef: + name: containercluster1-${uniqueId} +--- +apiVersion: gkehub.cnrm.cloud.google.com/v1beta1 +kind: GKEHubMembership +metadata: + annotations: + cnrm.cloud.google.com/project-id: mock-project + name: gkehubmembership2-${uniqueId} +spec: + location: us-central1 + authority: + issuer: https://container.googleapis.com/v1/projects/mock-project/locations/us-central1-a/clusters/containercluster2-${uniqueId} + description: A sample GKE Hub membership + endpoint: + gkeCluster: + resourceRef: + name: containercluster2-${uniqueId} +--- +# Create a GKEHubFeatureMembership that is not going to be updated. +apiVersion: gkehub.cnrm.cloud.google.com/v1beta1 +kind: GKEHubFeatureMembership +metadata: + name: gkehubfeaturemembership2-${uniqueId} +spec: + projectRef: + external: projects/mock-project + location: global + membershipRef: + name: gkehubmembership2-${uniqueId} + featureRef: + name: gkehubfeature-${uniqueId} + configmanagement: + configSync: + git: + syncBranch: "main" + syncRepo: "https://github.com/GoogleCloudPlatform/anthos-config-management-samples" + sourceFormat: hierarchy +--- +# Create a separate GKEHubFeatureMembership that will be updated later. +apiVersion: gkehub.cnrm.cloud.google.com/v1beta1 +kind: GKEHubFeatureMembership +metadata: + name: gkehubfeaturemembership1-${uniqueId} +spec: + projectRef: + external: projects/mock-project + location: global + membershipRef: + name: gkehubmembership1-${uniqueId} + featureRef: + name: gkehubfeature-${uniqueId} + configmanagement: + configSync: + git: + syncBranch: "master" + syncRepo: "https://github.com/GoogleCloudPlatform/cloud-foundation-toolkit" + sourceFormat: hierarchy +--- +# Update the GKEHubFeatureMembership +# The patch http request should only contain gkehubmembership1-${uniqueId}. +apiVersion: gkehub.cnrm.cloud.google.com/v1beta1 +kind: GKEHubFeatureMembership +metadata: + name: gkehubfeaturemembership1-${uniqueId} +spec: + projectRef: + external: projects/mock-project + location: global + membershipRef: + name: gkehubmembership1-${uniqueId} + featureRef: + name: gkehubfeature-${uniqueId} + configmanagement: + configSync: + git: + syncBranch: "master" + syncRepo: "https://github.com/GoogleCloudPlatform/cloud-foundation-toolkit" + sourceFormat: unstructured \ No newline at end of file