diff --git a/config/tests/samples/create/harness.go b/config/tests/samples/create/harness.go index 466ebfc2fa..f451c6a275 100644 --- a/config/tests/samples/create/harness.go +++ b/config/tests/samples/create/harness.go @@ -824,6 +824,8 @@ func MaybeSkip(t *testing.T, name string, resources []*unstructured.Unstructured case schema.GroupKind{Group: "logging.cnrm.cloud.google.com", Kind: "LoggingLogSink"}: case schema.GroupKind{Group: "logging.cnrm.cloud.google.com", Kind: "LoggingLogView"}: + case schema.GroupKind{Group: "managedkafka.cnrm.cloud.google.com", Kind: "ManagedKafkaCluster"}: + case schema.GroupKind{Group: "monitoring.cnrm.cloud.google.com", Kind: "MonitoringAlertPolicy"}: case schema.GroupKind{Group: "monitoring.cnrm.cloud.google.com", Kind: "MonitoringDashboard"}: case schema.GroupKind{Group: "monitoring.cnrm.cloud.google.com", Kind: "MonitoringGroup"}: diff --git a/mockgcp/mock_http_roundtrip.go b/mockgcp/mock_http_roundtrip.go index 9f2746e7f6..0f703c17b6 100644 --- a/mockgcp/mock_http_roundtrip.go +++ b/mockgcp/mock_http_roundtrip.go @@ -66,6 +66,7 @@ import ( "github.com/GoogleCloudPlatform/k8s-config-connector/mockgcp/mockiam" "github.com/GoogleCloudPlatform/k8s-config-connector/mockgcp/mockkms" "github.com/GoogleCloudPlatform/k8s-config-connector/mockgcp/mocklogging" + "github.com/GoogleCloudPlatform/k8s-config-connector/mockgcp/mockmanagedkafka" "github.com/GoogleCloudPlatform/k8s-config-connector/mockgcp/mockmonitoring" "github.com/GoogleCloudPlatform/k8s-config-connector/mockgcp/mocknetworkconnectivity" "github.com/GoogleCloudPlatform/k8s-config-connector/mockgcp/mocknetworkservices" @@ -221,6 +222,7 @@ func NewMockRoundTripper(ctx context.Context, k8sClient client.Client, storage s services = append(services, mockvpcaccess.New(env, storage)) services = append(services, mockapigee.New(env, storage)) services = append(services, mockbigqueryreservation.New(env, storage)) + services = append(services, mockmanagedkafka.New(env, storage)) for _, service := range services { service.Register(server) diff --git a/mockgcp/mockmanagedkafka/cluster.go b/mockgcp/mockmanagedkafka/cluster.go new file mode 100644 index 0000000000..adb3776465 --- /dev/null +++ b/mockgcp/mockmanagedkafka/cluster.go @@ -0,0 +1,213 @@ +// Copyright 2025 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. + +// +tool:mockgcp-support +// proto.service: google.cloud.managedkafka.v1.ManagedKafka +// proto.message: google.cloud.managedkafka.v1.Cluster + +package mockmanagedkafka + +import ( + "context" + "fmt" + "strings" + "time" + + "google.golang.org/genproto/googleapis/longrunning" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/emptypb" + "google.golang.org/protobuf/types/known/timestamppb" + + "github.com/GoogleCloudPlatform/k8s-config-connector/mockgcp/common/projects" + pb "github.com/GoogleCloudPlatform/k8s-config-connector/mockgcp/generated/mockgcp/cloud/managedkafka/v1" +) + +type managedKafka struct { + *MockService + pb.UnimplementedManagedKafkaServer +} + +func (s *managedKafka) CreateCluster(ctx context.Context, req *pb.CreateClusterRequest) (*longrunning.Operation, error) { + reqName := fmt.Sprintf("%s/clusters/%s", req.GetParent(), req.GetClusterId()) + name, err := s.parseClusterName(reqName) + if err != nil { + return nil, err + } + + fqn := name.String() + now := time.Now() + + obj := proto.Clone(req.GetCluster()).(*pb.Cluster) + obj.Name = fqn + obj.CreateTime = timestamppb.New(now) + obj.State = pb.Cluster_CREATING + if err := s.storage.Create(ctx, fqn, obj); err != nil { + return nil, err + } + + prefix := fmt.Sprintf("projects/%s/locations/%s", name.Project.ID, name.Location) + metadata := &pb.OperationMetadata{ + ApiVersion: "v1", + CreateTime: timestamppb.New(now), + RequestedCancellation: false, + Target: name.String(), + Verb: "create", + } + return s.operations.StartLRO(ctx, prefix, metadata, func() (proto.Message, error) { + obj.State = pb.Cluster_ACTIVE + obj.UpdateTime = timestamppb.New(now) + if !obj.GetSatisfiesPzi() { // hack: we don't support PZI yet. This is to match the real GCP + obj.SatisfiesPzi = proto.Bool(false) + } + if !obj.GetSatisfiesPzs() { // hack: we don't support PZS yet. This is to match the real GCP + obj.SatisfiesPzs = proto.Bool(false) + } + metadata.EndTime = timestamppb.Now() + if err := s.storage.Update(ctx, fqn, obj); err != nil { + return nil, err + } + return obj, nil + }) +} + +func (s *managedKafka) GetCluster(ctx context.Context, req *pb.GetClusterRequest) (*pb.Cluster, error) { + name, err := s.parseClusterName(req.Name) + if err != nil { + return nil, err + } + + fqn := name.String() + + obj := &pb.Cluster{} + if err := s.storage.Get(ctx, fqn, obj); err != nil { + if status.Code(err) == codes.NotFound { + return nil, status.Errorf(codes.NotFound, "Resource '%v' was not found", name) + } + return nil, err + } + + return obj, nil +} + +func (s *managedKafka) UpdateCluster(ctx context.Context, req *pb.UpdateClusterRequest) (*longrunning.Operation, error) { + name, err := s.parseClusterName(req.GetCluster().GetName()) + if err != nil { + return nil, err + } + fqn := name.String() + obj := &pb.Cluster{} + if err := s.storage.Get(ctx, fqn, obj); err != nil { + return nil, err + } + paths := req.GetUpdateMask().GetPaths() + if len(paths) == 0 { + return nil, status.Errorf(codes.InvalidArgument, "update_mask must be provided") + } + // updateMask=capacityConfig.memoryBytes%2CcapacityConfig.vcpuCount%2CgcpConfig.accessConfig.networkConfigs%2Cname%2CrebalanceConfig.mode + for _, path := range paths { + switch path { + case "capacityConfig.memoryBytes": + obj.CapacityConfig.MemoryBytes = req.GetCluster().GetCapacityConfig().GetMemoryBytes() + case "capacityConfig.vcpuCount": + obj.CapacityConfig.VcpuCount = req.GetCluster().GetCapacityConfig().GetVcpuCount() + case "gcpConfig.accessConfig.networkConfigs": + obj.GetGcpConfig().AccessConfig.NetworkConfigs = req.GetCluster().GetGcpConfig().GetAccessConfig().GetNetworkConfigs() + case "name": + obj.Name = req.GetCluster().GetName() + case "rebalanceConfig.mode": + obj.RebalanceConfig.Mode = req.GetCluster().GetRebalanceConfig().GetMode() + default: + return nil, status.Errorf(codes.InvalidArgument, "field %q is not yet handled in mock", path) + } + } + + obj.UpdateTime = timestamppb.Now() + + if err := s.storage.Update(ctx, fqn, obj); err != nil { + return nil, err + } + + prefix := fmt.Sprintf("projects/%s/locations/%s", name.Project.ID, name.Location) + metadata := &pb.OperationMetadata{ + ApiVersion: "v1", + CreateTime: timestamppb.Now(), + RequestedCancellation: false, + Target: name.String(), + Verb: "update", + } + + return s.operations.StartLRO(ctx, prefix, metadata, func() (proto.Message, error) { + obj.State = pb.Cluster_ACTIVE + metadata.EndTime = timestamppb.Now() + if err := s.storage.Update(ctx, fqn, obj); err != nil { + return nil, err + } + return obj, nil + }) +} + +func (s *managedKafka) DeleteCluster(ctx context.Context, req *pb.DeleteClusterRequest) (*longrunning.Operation, error) { + name, err := s.parseClusterName(req.Name) + if err != nil { + return nil, err + } + + fqn := name.String() + + deleted := &pb.Cluster{} + if err := s.storage.Delete(ctx, fqn, deleted); err != nil { + return nil, err + } + + prefix := fmt.Sprintf("projects/%s/locations/%s", name.Project.ID, name.Location) + metadata := &pb.OperationMetadata{ + ApiVersion: "v1", + CreateTime: timestamppb.Now(), + EndTime: timestamppb.Now(), + RequestedCancellation: false, + Target: name.String(), + Verb: "delete", + } + return s.operations.DoneLRO(ctx, prefix, metadata, &emptypb.Empty{}) +} + +type clusterName struct { + Project *projects.ProjectData + Location string + Cluster string +} + +func (n *clusterName) String() string { + return fmt.Sprintf("projects/%s/locations/%s/clusters/%s", n.Project.ID, n.Location, n.Cluster) +} + +func (s *MockService) parseClusterName(name string) (*clusterName, error) { + tokens := strings.Split(name, "/") + if len(tokens) == 6 && tokens[0] == "projects" && tokens[2] == "locations" && tokens[4] == "clusters" { + project, err := s.Projects.GetProjectByID(tokens[1]) + if err != nil { + return nil, err + } + + return &clusterName{ + Project: project, + Location: tokens[3], + Cluster: tokens[5], + }, nil + } + + return nil, status.Errorf(codes.InvalidArgument, "invalid cluster name %q", name) +} diff --git a/mockgcp/mockmanagedkafka/service.go b/mockgcp/mockmanagedkafka/service.go new file mode 100644 index 0000000000..62f35ad2b1 --- /dev/null +++ b/mockgcp/mockmanagedkafka/service.go @@ -0,0 +1,76 @@ +// Copyright 2025 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. + +package mockmanagedkafka + +import ( + "context" + "net/http" + + "google.golang.org/grpc" + + "github.com/GoogleCloudPlatform/k8s-config-connector/mockgcp/common" + "github.com/GoogleCloudPlatform/k8s-config-connector/mockgcp/common/httpmux" + "github.com/GoogleCloudPlatform/k8s-config-connector/mockgcp/common/operations" + pb "github.com/GoogleCloudPlatform/k8s-config-connector/mockgcp/generated/mockgcp/cloud/managedkafka/v1" + "github.com/GoogleCloudPlatform/k8s-config-connector/mockgcp/pkg/storage" +) + +// MockService represents a mocked managedkafka service. +type MockService struct { + *common.MockEnvironment + storage storage.Storage + + operations *operations.Operations + + v1 *managedKafka +} + +// New creates a MockService. +func New(env *common.MockEnvironment, storage storage.Storage) *MockService { + s := &MockService{ + MockEnvironment: env, + storage: storage, + operations: operations.NewOperationsService(storage), + } + s.v1 = &managedKafka{MockService: s} + return s +} + +func (s *MockService) ExpectedHosts() []string { + return []string{"managedkafka.googleapis.com"} +} + +func (s *MockService) Register(grpcServer *grpc.Server) { + pb.RegisterManagedKafkaServer(grpcServer, s.v1) +} + +func (s *MockService) NewHTTPMux(ctx context.Context, conn *grpc.ClientConn) (http.Handler, error) { + mux, err := httpmux.NewServeMux(ctx, conn, httpmux.Options{}, + pb.RegisterManagedKafkaHandler, + s.operations.RegisterOperationsPath("/v1/{prefix=**}/operations/{name}"), + ) + if err != nil { + return nil, err + } + + // Returns slightly non-standard errors + mux.RewriteError = func(ctx context.Context, error *httpmux.ErrorResponse) { + if error.Code == 404 { + error.Errors = nil + } + } + + return mux, nil +} diff --git a/mockgcp/mockserviceusage/knownservices.go b/mockgcp/mockserviceusage/knownservices.go index 71094dcf34..1ed4517737 100644 --- a/mockgcp/mockserviceusage/knownservices.go +++ b/mockgcp/mockserviceusage/knownservices.go @@ -25,6 +25,7 @@ var allServices = []string{ "anthos.googleapis.com", "anthosconfigmanagement.googleapis.com", "anthospolicycontroller.googleapis.com", + "managedkafka.googleapis.com", "multiclusteringress.googleapis.com", "multiclusterservicediscovery.googleapis.com", "mesh.googleapis.com", diff --git a/mockgcp/mockserviceusage/serviceusagev1beta1.go b/mockgcp/mockserviceusage/serviceusagev1beta1.go index 97e2069f48..60c3607baa 100644 --- a/mockgcp/mockserviceusage/serviceusagev1beta1.go +++ b/mockgcp/mockserviceusage/serviceusagev1beta1.go @@ -71,6 +71,8 @@ func (s *ServiceUsageV1Beta1) GenerateServiceIdentity(ctx context.Context, req * case "apigee.googleapis.com": identity.Email = "service-" + strconv.FormatInt(name.Project.Number, 10) + "@gcp-sa-apigee.iam.gserviceaccount.com" identity.UniqueId = "123456789008" + case "managedkafka.googleapis.com": + identity.Email = "service-" + strconv.FormatInt(name.Project.Number, 10) + "@gcp-sa-managedkafka.iam.gserviceaccount.com" default: return nil, fmt.Errorf("generating serviceIdentity for service %q not implemented in mock", name.ServiceName) } diff --git a/pkg/test/resourcefixture/testdata/basic/managedkafka/v1alpha1/managedkafkacluster/managedkafkacluster-basic/_http.log b/pkg/test/resourcefixture/testdata/basic/managedkafka/v1alpha1/managedkafkacluster/managedkafkacluster-basic/_http.log index d6e61776c4..b1ad740569 100644 --- a/pkg/test/resourcefixture/testdata/basic/managedkafka/v1alpha1/managedkafkacluster/managedkafkacluster-basic/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/managedkafka/v1alpha1/managedkafkacluster/managedkafkacluster-basic/_http.log @@ -3,6 +3,7 @@ Content-Type: application/json User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} 404 Not Found +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -39,6 +40,7 @@ User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-confi } 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -69,6 +71,7 @@ GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/opera User-Agent: google-api-go-client/0.5 kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -101,6 +104,7 @@ Content-Type: application/json User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -117,10 +121,6 @@ X-Xss-Protection: 0 "kind": "compute#network", "name": "computenetwork-${uniqueId}-1", "networkFirewallPolicyEnforcementOrder": "AFTER_CLASSIC_FIREWALL", - "routingConfig": { - "bgpBestPathSelectionMode": "LEGACY", - "routingMode": "REGIONAL" - }, "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/networks/computenetwork-${uniqueId}-1", "selfLinkWithId": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/networks/${networkID}" } @@ -132,6 +132,7 @@ Content-Type: application/json User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} 404 Not Found +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -168,6 +169,7 @@ User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-confi } 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -198,6 +200,7 @@ GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/opera User-Agent: google-api-go-client/0.5 kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -230,6 +233,7 @@ Content-Type: application/json User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -246,10 +250,6 @@ X-Xss-Protection: 0 "kind": "compute#network", "name": "computenetwork-${uniqueId}-2", "networkFirewallPolicyEnforcementOrder": "AFTER_CLASSIC_FIREWALL", - "routingConfig": { - "bgpBestPathSelectionMode": "LEGACY", - "routingMode": "REGIONAL" - }, "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/networks/computenetwork-${uniqueId}-2", "selfLinkWithId": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/networks/${networkID}" } @@ -261,6 +261,7 @@ Content-Type: application/json User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} 404 Not Found +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -301,6 +302,7 @@ User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-confi } 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -332,6 +334,7 @@ GET https://compute.googleapis.com/compute/v1/projects/${projectId}/regions/us-c User-Agent: google-api-go-client/0.5 kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -365,6 +368,7 @@ Content-Type: application/json User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -375,11 +379,10 @@ X-Frame-Options: SAMEORIGIN X-Xss-Protection: 0 { - "allowSubnetCidrRoutesOverlap": false, "creationTimestamp": "2024-04-01T12:34:56.123456Z", "enableFlowLogs": false, "fingerprint": "abcdef0123A=", - "gatewayAddress": "10.0.0.1", + "gatewayAddress": "10.2.0.1", "id": "000000000000000000000", "ipCidrRange": "10.0.0.0/24", "kind": "compute#subnetwork", @@ -403,6 +406,7 @@ Content-Type: application/json User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} 404 Not Found +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -443,6 +447,7 @@ User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-confi } 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -474,6 +479,7 @@ GET https://compute.googleapis.com/compute/v1/projects/${projectId}/regions/us-c User-Agent: google-api-go-client/0.5 kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -507,6 +513,7 @@ Content-Type: application/json User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -517,11 +524,10 @@ X-Frame-Options: SAMEORIGIN X-Xss-Protection: 0 { - "allowSubnetCidrRoutesOverlap": false, "creationTimestamp": "2024-04-01T12:34:56.123456Z", "enableFlowLogs": false, "fingerprint": "abcdef0123A=", - "gatewayAddress": "10.0.1.1", + "gatewayAddress": "10.2.0.1", "id": "000000000000000000000", "ipCidrRange": "10.0.1.0/24", "kind": "compute#subnetwork", @@ -546,6 +552,7 @@ User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-confi X-Goog-Request-Params: name=projects%2F${projectId}%2Flocations%2Fus-central1%2Fclusters%2Fmanagedkafkacluster-${uniqueId} 404 Not Found +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -590,6 +597,7 @@ X-Goog-Request-Params: parent=projects%2F${projectId}%2Flocations%2Fus-central1 } 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -600,12 +608,10 @@ X-Frame-Options: SAMEORIGIN X-Xss-Protection: 0 { - "done": false, "metadata": { "@type": "type.googleapis.com/google.cloud.managedkafka.v1.OperationMetadata", "apiVersion": "v1", "createTime": "2024-04-01T12:34:56.123456Z", - "requestedCancellation": false, "target": "projects/${projectId}/locations/us-central1/clusters/managedkafkacluster-${uniqueId}", "verb": "create" }, @@ -614,118 +620,13 @@ X-Xss-Protection: 0 --- -GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/networks/${networkID}?alt=json -Content-Type: application/json -User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} - -200 OK -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 - -{ - "autoCreateSubnetworks": false, - "creationTimestamp": "2024-04-01T12:34:56.123456Z", - "id": "000000000000000000000", - "kind": "compute#network", - "name": "computenetwork-${uniqueId}-1", - "networkFirewallPolicyEnforcementOrder": "AFTER_CLASSIC_FIREWALL", - "routingConfig": { - "bgpBestPathSelectionMode": "LEGACY", - "routingMode": "REGIONAL" - }, - "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/networks/computenetwork-${uniqueId}-1", - "selfLinkWithId": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/networks/${networkID}", - "subnetworks": [ - "https://www.googleapis.com/compute/v1/projects/${projectId}/regions/us-central1/subnetworks/computesubnetwork-${uniqueId}-1" - ] -} - ---- - -GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/networks/${networkID}?alt=json -Content-Type: application/json -User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} - -200 OK -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 - -{ - "autoCreateSubnetworks": false, - "creationTimestamp": "2024-04-01T12:34:56.123456Z", - "id": "000000000000000000000", - "kind": "compute#network", - "name": "computenetwork-${uniqueId}-2", - "networkFirewallPolicyEnforcementOrder": "AFTER_CLASSIC_FIREWALL", - "routingConfig": { - "bgpBestPathSelectionMode": "LEGACY", - "routingMode": "REGIONAL" - }, - "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/networks/computenetwork-${uniqueId}-2", - "selfLinkWithId": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/networks/${networkID}", - "subnetworks": [ - "https://www.googleapis.com/compute/v1/projects/${projectId}/regions/us-central1/subnetworks/computesubnetwork-${uniqueId}-2" - ] -} - ---- - -GET https://compute.googleapis.com/compute/v1/projects/${projectId}/regions/us-central1/subnetworks/${subnetworkID}?alt=json -Content-Type: application/json -User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} - -200 OK -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 - -{ - "allowSubnetCidrRoutesOverlap": false, - "creationTimestamp": "2024-04-01T12:34:56.123456Z", - "enableFlowLogs": false, - "fingerprint": "abcdef0123A=", - "gatewayAddress": "10.0.1.1", - "id": "000000000000000000000", - "ipCidrRange": "10.0.1.0/24", - "kind": "compute#subnetwork", - "logConfig": { - "enable": false - }, - "name": "computesubnetwork-${uniqueId}-2", - "network": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/networks/computenetwork-${uniqueId}-2", - "privateIpGoogleAccess": false, - "privateIpv6GoogleAccess": "DISABLE_GOOGLE_ACCESS", - "purpose": "PRIVATE", - "region": "https://www.googleapis.com/compute/v1/projects/${projectId}/regions/us-central1", - "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/regions/us-central1/subnetworks/computesubnetwork-${uniqueId}-2", - "stackType": "IPV4_ONLY" -} - ---- - GET https://managedkafka.googleapis.com/v1/projects/${projectId}/locations/us-central1/operations/${operationID} Content-Type: application/json User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} X-Goog-Request-Params: name=projects%2F${projectId}%2Flocations%2Fus-central1%2Foperations%2F${operationID} 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -742,7 +643,6 @@ X-Xss-Protection: 0 "apiVersion": "v1", "createTime": "2024-04-01T12:34:56.123456Z", "endTime": "2024-04-01T12:34:56.123456Z", - "requestedCancellation": false, "target": "projects/${projectId}/locations/us-central1/clusters/managedkafkacluster-${uniqueId}", "verb": "create" }, @@ -782,6 +682,7 @@ User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-confi X-Goog-Request-Params: name=projects%2F${projectId}%2Flocations%2Fus-central1%2Fclusters%2Fmanagedkafkacluster-${uniqueId} 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -847,6 +748,7 @@ X-Goog-Request-Params: cluster.name=projects%2F${projectId}%2Flocations%2Fus-cen } 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -857,12 +759,10 @@ X-Frame-Options: SAMEORIGIN X-Xss-Protection: 0 { - "done": false, "metadata": { "@type": "type.googleapis.com/google.cloud.managedkafka.v1.OperationMetadata", "apiVersion": "v1", "createTime": "2024-04-01T12:34:56.123456Z", - "requestedCancellation": false, "target": "projects/${projectId}/locations/us-central1/clusters/managedkafkacluster-${uniqueId}", "verb": "update" }, @@ -877,6 +777,7 @@ User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-confi X-Goog-Request-Params: name=projects%2F${projectId}%2Flocations%2Fus-central1%2Foperations%2F${operationID} 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -893,7 +794,6 @@ X-Xss-Protection: 0 "apiVersion": "v1", "createTime": "2024-04-01T12:34:56.123456Z", "endTime": "2024-04-01T12:34:56.123456Z", - "requestedCancellation": false, "target": "projects/${projectId}/locations/us-central1/clusters/managedkafkacluster-${uniqueId}", "verb": "update" }, @@ -936,6 +836,7 @@ User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-confi X-Goog-Request-Params: name=projects%2F${projectId}%2Flocations%2Fus-central1%2Fclusters%2Fmanagedkafkacluster-${uniqueId} 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -981,74 +882,7 @@ User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-confi X-Goog-Request-Params: name=projects%2F${projectId}%2Flocations%2Fus-central1%2Fclusters%2Fmanagedkafkacluster-${uniqueId} 200 OK -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": false, - "metadata": { - "@type": "type.googleapis.com/google.cloud.managedkafka.v1.OperationMetadata", - "apiVersion": "v1", - "createTime": "2024-04-01T12:34:56.123456Z", - "requestedCancellation": false, - "target": "projects/${projectId}/locations/us-central1/clusters/managedkafkacluster-${uniqueId}", - "verb": "delete" - }, - "name": "projects/${projectId}/locations/us-central1/operations/${operationID}" -} - ---- - -GET https://compute.googleapis.com/compute/v1/projects/${projectId}/regions/us-central1/subnetworks/${subnetworkID}?alt=json -Content-Type: application/json -User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} - -200 OK -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 - -{ - "allowSubnetCidrRoutesOverlap": false, - "creationTimestamp": "2024-04-01T12:34:56.123456Z", - "enableFlowLogs": false, - "fingerprint": "abcdef0123A=", - "gatewayAddress": "10.0.0.1", - "id": "000000000000000000000", - "ipCidrRange": "10.0.0.0/24", - "kind": "compute#subnetwork", - "logConfig": { - "enable": false - }, - "name": "computesubnetwork-${uniqueId}-1", - "network": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/networks/computenetwork-${uniqueId}-1", - "privateIpGoogleAccess": false, - "privateIpv6GoogleAccess": "DISABLE_GOOGLE_ACCESS", - "purpose": "PRIVATE", - "region": "https://www.googleapis.com/compute/v1/projects/${projectId}/regions/us-central1", - "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/regions/us-central1/subnetworks/computesubnetwork-${uniqueId}-1", - "stackType": "IPV4_ONLY" -} - ---- - -GET https://managedkafka.googleapis.com/v1/projects/${projectId}/locations/us-central1/operations/${operationID} -Content-Type: application/json -User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} -X-Goog-Request-Params: name=projects%2F${projectId}%2Flocations%2Fus-central1%2Foperations%2F${operationID} - -200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -1065,7 +899,6 @@ X-Xss-Protection: 0 "apiVersion": "v1", "createTime": "2024-04-01T12:34:56.123456Z", "endTime": "2024-04-01T12:34:56.123456Z", - "requestedCancellation": false, "target": "projects/${projectId}/locations/us-central1/clusters/managedkafkacluster-${uniqueId}", "verb": "delete" }, @@ -1082,6 +915,7 @@ Content-Type: application/json User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -1092,11 +926,10 @@ X-Frame-Options: SAMEORIGIN X-Xss-Protection: 0 { - "allowSubnetCidrRoutesOverlap": false, "creationTimestamp": "2024-04-01T12:34:56.123456Z", "enableFlowLogs": false, "fingerprint": "abcdef0123A=", - "gatewayAddress": "10.0.1.1", + "gatewayAddress": "10.2.0.1", "id": "000000000000000000000", "ipCidrRange": "10.0.1.0/24", "kind": "compute#subnetwork", @@ -1120,6 +953,7 @@ Content-Type: application/json User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -1151,6 +985,7 @@ GET https://compute.googleapis.com/compute/v1/projects/${projectId}/regions/us-c User-Agent: google-api-go-client/0.5 kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -1184,6 +1019,7 @@ Content-Type: application/json User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -1194,11 +1030,10 @@ X-Frame-Options: SAMEORIGIN X-Xss-Protection: 0 { - "allowSubnetCidrRoutesOverlap": false, "creationTimestamp": "2024-04-01T12:34:56.123456Z", "enableFlowLogs": false, "fingerprint": "abcdef0123A=", - "gatewayAddress": "10.0.0.1", + "gatewayAddress": "10.2.0.1", "id": "000000000000000000000", "ipCidrRange": "10.0.0.0/24", "kind": "compute#subnetwork", @@ -1222,6 +1057,7 @@ Content-Type: application/json User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -1253,6 +1089,7 @@ GET https://compute.googleapis.com/compute/v1/projects/${projectId}/regions/us-c User-Agent: google-api-go-client/0.5 kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -1286,6 +1123,7 @@ Content-Type: application/json User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -1302,10 +1140,6 @@ X-Xss-Protection: 0 "kind": "compute#network", "name": "computenetwork-${uniqueId}-2", "networkFirewallPolicyEnforcementOrder": "AFTER_CLASSIC_FIREWALL", - "routingConfig": { - "bgpBestPathSelectionMode": "LEGACY", - "routingMode": "REGIONAL" - }, "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/networks/computenetwork-${uniqueId}-2", "selfLinkWithId": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/networks/${networkID}" } @@ -1317,6 +1151,7 @@ Content-Type: application/json User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -1347,6 +1182,7 @@ GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/opera User-Agent: google-api-go-client/0.5 kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -1379,6 +1215,7 @@ Content-Type: application/json User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -1395,10 +1232,6 @@ X-Xss-Protection: 0 "kind": "compute#network", "name": "computenetwork-${uniqueId}-1", "networkFirewallPolicyEnforcementOrder": "AFTER_CLASSIC_FIREWALL", - "routingConfig": { - "bgpBestPathSelectionMode": "LEGACY", - "routingMode": "REGIONAL" - }, "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/networks/computenetwork-${uniqueId}-1", "selfLinkWithId": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/networks/${networkID}" } @@ -1410,6 +1243,7 @@ Content-Type: application/json User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -1440,6 +1274,7 @@ GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/opera User-Agent: google-api-go-client/0.5 kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin diff --git a/pkg/test/resourcefixture/testdata/basic/managedkafka/v1alpha1/managedkafkacluster/managedkafkacluster-cmek/_http.log b/pkg/test/resourcefixture/testdata/basic/managedkafka/v1alpha1/managedkafkacluster/managedkafkacluster-cmek/_http.log index 78af4e91ed..6e90042aab 100644 --- a/pkg/test/resourcefixture/testdata/basic/managedkafka/v1alpha1/managedkafkacluster/managedkafkacluster-cmek/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/managedkafka/v1alpha1/managedkafkacluster/managedkafkacluster-cmek/_http.log @@ -3,6 +3,7 @@ Content-Type: application/json User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -16,9 +17,8 @@ X-Xss-Protection: 0 "done": true, "name": "operations/${operationID}", "response": { - "@type": "type.googleapis.com/google.api.serviceusage.v1beta1.ServiceIdentity", - "email": "service-${projectNumber}@gcp-sa-managedkafka.iam.gserviceaccount.com", - "uniqueId": "12345678" + "@type": "type.googleapis.com/mockgcp.api.serviceusage.v1beta1.ServiceIdentity", + "email": "service-${projectNumber}@gcp-sa-managedkafka.iam.gserviceaccount.com" } } @@ -29,6 +29,7 @@ Content-Type: application/json User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} 404 Not Found +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -53,6 +54,7 @@ Content-Type: application/json User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -74,6 +76,7 @@ Content-Type: application/json User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -95,6 +98,7 @@ Content-Type: application/json User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} 404 Not Found +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -127,6 +131,7 @@ User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-confi } 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -166,6 +171,7 @@ Content-Type: application/json User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -204,6 +210,7 @@ GET https://cloudkms.googleapis.com/v1/projects/${projectId}/locations/us-centra User-Agent: google-api-go-client/0.5 kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -239,6 +246,7 @@ User-Agent: google-api-go-client/0.5 kcc/${kccVersion} (+https://github.com/Goog } 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -267,6 +275,7 @@ GET https://cloudkms.googleapis.com/v1/projects/${projectId}/locations/us-centra User-Agent: google-api-go-client/0.5 kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -296,6 +305,7 @@ Content-Type: application/json User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} 404 Not Found +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -332,6 +342,7 @@ User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-confi } 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -362,6 +373,7 @@ GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/opera User-Agent: google-api-go-client/0.5 kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -394,6 +406,7 @@ Content-Type: application/json User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -410,10 +423,6 @@ X-Xss-Protection: 0 "kind": "compute#network", "name": "computenetwork-${uniqueId}", "networkFirewallPolicyEnforcementOrder": "AFTER_CLASSIC_FIREWALL", - "routingConfig": { - "bgpBestPathSelectionMode": "LEGACY", - "routingMode": "REGIONAL" - }, "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/networks/computenetwork-${uniqueId}", "selfLinkWithId": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/networks/${networkID}" } @@ -425,6 +434,7 @@ Content-Type: application/json User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} 404 Not Found +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -465,6 +475,7 @@ User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-confi } 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -496,6 +507,7 @@ GET https://compute.googleapis.com/compute/v1/projects/${projectId}/regions/us-c User-Agent: google-api-go-client/0.5 kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -529,6 +541,7 @@ Content-Type: application/json User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -539,11 +552,10 @@ X-Frame-Options: SAMEORIGIN X-Xss-Protection: 0 { - "allowSubnetCidrRoutesOverlap": false, "creationTimestamp": "2024-04-01T12:34:56.123456Z", "enableFlowLogs": false, "fingerprint": "abcdef0123A=", - "gatewayAddress": "10.0.0.1", + "gatewayAddress": "10.2.0.1", "id": "000000000000000000000", "ipCidrRange": "10.0.0.0/24", "kind": "compute#subnetwork", @@ -568,6 +580,7 @@ User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-confi X-Goog-Request-Params: name=projects%2F${projectId}%2Flocations%2Fus-central1%2Fclusters%2Fmanagedkafkacluster-${uniqueId} 404 Not Found +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -613,6 +626,7 @@ X-Goog-Request-Params: parent=projects%2F${projectId}%2Flocations%2Fus-central1 } 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -623,12 +637,10 @@ X-Frame-Options: SAMEORIGIN X-Xss-Protection: 0 { - "done": false, "metadata": { "@type": "type.googleapis.com/google.cloud.managedkafka.v1.OperationMetadata", "apiVersion": "v1", "createTime": "2024-04-01T12:34:56.123456Z", - "requestedCancellation": false, "target": "projects/${projectId}/locations/us-central1/clusters/managedkafkacluster-${uniqueId}", "verb": "create" }, @@ -637,71 +649,13 @@ X-Xss-Protection: 0 --- -GET https://cloudkms.googleapis.com/v1/projects/${projectId}/locations/us-central1/keyRings/kmskeyring-${uniqueId}?alt=json -Content-Type: application/json -User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} - -200 OK -Content-Type: application/json; charset=UTF-8 -Server: ESF -Vary: Origin -Vary: X-Origin -Vary: Referer -X-Content-Type-Options: nosniff -X-Frame-Options: SAMEORIGIN -X-Xss-Protection: 0 - -{ - "createTime": "2024-04-01T12:34:56.123456Z", - "name": "projects/${projectId}/locations/us-central1/keyRings/kmskeyring-${uniqueId}" -} - ---- - -GET https://compute.googleapis.com/compute/v1/projects/${projectId}/regions/us-central1/subnetworks/${subnetworkID}?alt=json -Content-Type: application/json -User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} - -200 OK -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 - -{ - "allowSubnetCidrRoutesOverlap": false, - "creationTimestamp": "2024-04-01T12:34:56.123456Z", - "enableFlowLogs": false, - "fingerprint": "abcdef0123A=", - "gatewayAddress": "10.0.0.1", - "id": "000000000000000000000", - "ipCidrRange": "10.0.0.0/24", - "kind": "compute#subnetwork", - "logConfig": { - "enable": false - }, - "name": "computesubnetwork-${uniqueId}", - "network": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/networks/computenetwork-${uniqueId}", - "privateIpGoogleAccess": false, - "privateIpv6GoogleAccess": "DISABLE_GOOGLE_ACCESS", - "purpose": "PRIVATE", - "region": "https://www.googleapis.com/compute/v1/projects/${projectId}/regions/us-central1", - "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/regions/us-central1/subnetworks/computesubnetwork-${uniqueId}", - "stackType": "IPV4_ONLY" -} - ---- - GET https://managedkafka.googleapis.com/v1/projects/${projectId}/locations/us-central1/operations/${operationID} Content-Type: application/json User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} X-Goog-Request-Params: name=projects%2F${projectId}%2Flocations%2Fus-central1%2Foperations%2F${operationID} 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -718,7 +672,6 @@ X-Xss-Protection: 0 "apiVersion": "v1", "createTime": "2024-04-01T12:34:56.123456Z", "endTime": "2024-04-01T12:34:56.123456Z", - "requestedCancellation": false, "target": "projects/${projectId}/locations/us-central1/clusters/managedkafkacluster-${uniqueId}", "verb": "create" }, @@ -759,6 +712,7 @@ User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-confi X-Goog-Request-Params: name=projects%2F${projectId}%2Flocations%2Fus-central1%2Fclusters%2Fmanagedkafkacluster-${uniqueId} 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -823,6 +777,7 @@ X-Goog-Request-Params: cluster.name=projects%2F${projectId}%2Flocations%2Fus-cen } 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -833,12 +788,10 @@ X-Frame-Options: SAMEORIGIN X-Xss-Protection: 0 { - "done": false, "metadata": { "@type": "type.googleapis.com/google.cloud.managedkafka.v1.OperationMetadata", "apiVersion": "v1", "createTime": "2024-04-01T12:34:56.123456Z", - "requestedCancellation": false, "target": "projects/${projectId}/locations/us-central1/clusters/managedkafkacluster-${uniqueId}", "verb": "update" }, @@ -847,134 +800,13 @@ X-Xss-Protection: 0 --- -GET https://cloudkms.googleapis.com/v1/projects/${projectId}/locations/us-central1/keyRings/kmskeyring-${uniqueId}/cryptoKeys/kmscryptokey-${uniqueId}:getIamPolicy?alt=json&options.requestedPolicyVersion=3&prettyPrint=false -User-Agent: google-api-go-client/0.5 kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} - -200 OK -Content-Type: application/json; charset=UTF-8 -Server: ESF -Vary: Origin -Vary: X-Origin -Vary: Referer -X-Content-Type-Options: nosniff -X-Frame-Options: SAMEORIGIN -X-Xss-Protection: 0 - -{ - "bindings": [ - { - "members": [ - "serviceAccount:service-${projectNumber}@gcp-sa-managedkafka.iam.gserviceaccount.com" - ], - "role": "roles/cloudkms.cryptoKeyEncrypterDecrypter" - } - ], - "etag": "abcdef0123A=", - "version": 1 -} - ---- - -GET https://cloudkms.googleapis.com/v1/projects/${projectId}/locations/us-central1/keyRings/kmskeyring-${uniqueId}/cryptoKeys/kmscryptokey-${uniqueId}?alt=json -Content-Type: application/json -User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} - -200 OK -Content-Type: application/json; charset=UTF-8 -Server: ESF -Vary: Origin -Vary: X-Origin -Vary: Referer -X-Content-Type-Options: nosniff -X-Frame-Options: SAMEORIGIN -X-Xss-Protection: 0 - -{ - "createTime": "2024-04-01T12:34:56.123456Z", - "destroyScheduledDuration": "2592000s", - "labels": { - "cnrm-test": "true", - "managed-by-cnrm": "true" - }, - "name": "projects/${projectId}/locations/us-central1/keyRings/kmskeyring-${uniqueId}/cryptoKeys/kmscryptokey-${uniqueId}", - "primary": { - "algorithm": "GOOGLE_SYMMETRIC_ENCRYPTION", - "createTime": "2024-04-01T12:34:56.123456Z", - "generateTime": "2024-04-01T12:34:56.123456Z", - "name": "projects/${projectId}/locations/us-central1/keyRings/kmskeyring-${uniqueId}/cryptoKeys/kmscryptokey-${uniqueId}/cryptoKeyVersions/1", - "protectionLevel": "SOFTWARE", - "state": "ENABLED" - }, - "purpose": "ENCRYPT_DECRYPT", - "versionTemplate": { - "algorithm": "GOOGLE_SYMMETRIC_ENCRYPTION", - "protectionLevel": "SOFTWARE" - } -} - ---- - -GET https://cloudkms.googleapis.com/v1/projects/${projectId}/locations/us-central1/keyRings/kmskeyring-${uniqueId}?alt=json -Content-Type: application/json -User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} - -200 OK -Content-Type: application/json; charset=UTF-8 -Server: ESF -Vary: Origin -Vary: X-Origin -Vary: Referer -X-Content-Type-Options: nosniff -X-Frame-Options: SAMEORIGIN -X-Xss-Protection: 0 - -{ - "createTime": "2024-04-01T12:34:56.123456Z", - "name": "projects/${projectId}/locations/us-central1/keyRings/kmskeyring-${uniqueId}" -} - ---- - -GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/networks/${networkID}?alt=json -Content-Type: application/json -User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} - -200 OK -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 - -{ - "autoCreateSubnetworks": false, - "creationTimestamp": "2024-04-01T12:34:56.123456Z", - "id": "000000000000000000000", - "kind": "compute#network", - "name": "computenetwork-${uniqueId}", - "networkFirewallPolicyEnforcementOrder": "AFTER_CLASSIC_FIREWALL", - "routingConfig": { - "bgpBestPathSelectionMode": "LEGACY", - "routingMode": "REGIONAL" - }, - "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/networks/computenetwork-${uniqueId}", - "selfLinkWithId": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/networks/${networkID}", - "subnetworks": [ - "https://www.googleapis.com/compute/v1/projects/${projectId}/regions/us-central1/subnetworks/computesubnetwork-${uniqueId}" - ] -} - ---- - GET https://managedkafka.googleapis.com/v1/projects/${projectId}/locations/us-central1/operations/${operationID} Content-Type: application/json User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} X-Goog-Request-Params: name=projects%2F${projectId}%2Flocations%2Fus-central1%2Foperations%2F${operationID} 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -991,7 +823,6 @@ X-Xss-Protection: 0 "apiVersion": "v1", "createTime": "2024-04-01T12:34:56.123456Z", "endTime": "2024-04-01T12:34:56.123456Z", - "requestedCancellation": false, "target": "projects/${projectId}/locations/us-central1/clusters/managedkafkacluster-${uniqueId}", "verb": "update" }, @@ -1032,6 +863,7 @@ User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-confi X-Goog-Request-Params: name=projects%2F${projectId}%2Flocations%2Fus-central1%2Fclusters%2Fmanagedkafkacluster-${uniqueId} 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -1075,141 +907,7 @@ User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-confi X-Goog-Request-Params: name=projects%2F${projectId}%2Flocations%2Fus-central1%2Fclusters%2Fmanagedkafkacluster-${uniqueId} 200 OK -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": false, - "metadata": { - "@type": "type.googleapis.com/google.cloud.managedkafka.v1.OperationMetadata", - "apiVersion": "v1", - "createTime": "2024-04-01T12:34:56.123456Z", - "requestedCancellation": false, - "target": "projects/${projectId}/locations/us-central1/clusters/managedkafkacluster-${uniqueId}", - "verb": "delete" - }, - "name": "projects/${projectId}/locations/us-central1/operations/${operationID}" -} - ---- - -GET https://cloudkms.googleapis.com/v1/projects/${projectId}/locations/us-central1/keyRings/kmskeyring-${uniqueId}/cryptoKeys/kmscryptokey-${uniqueId}:getIamPolicy?alt=json&options.requestedPolicyVersion=3&prettyPrint=false -User-Agent: google-api-go-client/0.5 kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} - -200 OK -Content-Type: application/json; charset=UTF-8 -Server: ESF -Vary: Origin -Vary: X-Origin -Vary: Referer -X-Content-Type-Options: nosniff -X-Frame-Options: SAMEORIGIN -X-Xss-Protection: 0 - -{ - "bindings": [ - { - "members": [ - "serviceAccount:service-${projectNumber}@gcp-sa-managedkafka.iam.gserviceaccount.com" - ], - "role": "roles/cloudkms.cryptoKeyEncrypterDecrypter" - } - ], - "etag": "abcdef0123A=", - "version": 1 -} - ---- - -GET https://cloudkms.googleapis.com/v1/projects/${projectId}/locations/us-central1/keyRings/kmskeyring-${uniqueId}/cryptoKeys/kmscryptokey-${uniqueId}?alt=json -Content-Type: application/json -User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} - -200 OK -Content-Type: application/json; charset=UTF-8 -Server: ESF -Vary: Origin -Vary: X-Origin -Vary: Referer -X-Content-Type-Options: nosniff -X-Frame-Options: SAMEORIGIN -X-Xss-Protection: 0 - -{ - "createTime": "2024-04-01T12:34:56.123456Z", - "destroyScheduledDuration": "2592000s", - "labels": { - "cnrm-test": "true", - "managed-by-cnrm": "true" - }, - "name": "projects/${projectId}/locations/us-central1/keyRings/kmskeyring-${uniqueId}/cryptoKeys/kmscryptokey-${uniqueId}", - "primary": { - "algorithm": "GOOGLE_SYMMETRIC_ENCRYPTION", - "createTime": "2024-04-01T12:34:56.123456Z", - "generateTime": "2024-04-01T12:34:56.123456Z", - "name": "projects/${projectId}/locations/us-central1/keyRings/kmskeyring-${uniqueId}/cryptoKeys/kmscryptokey-${uniqueId}/cryptoKeyVersions/1", - "protectionLevel": "SOFTWARE", - "state": "ENABLED" - }, - "purpose": "ENCRYPT_DECRYPT", - "versionTemplate": { - "algorithm": "GOOGLE_SYMMETRIC_ENCRYPTION", - "protectionLevel": "SOFTWARE" - } -} - ---- - -GET https://compute.googleapis.com/compute/v1/projects/${projectId}/regions/us-central1/subnetworks/${subnetworkID}?alt=json -Content-Type: application/json -User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} - -200 OK -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 - -{ - "allowSubnetCidrRoutesOverlap": false, - "creationTimestamp": "2024-04-01T12:34:56.123456Z", - "enableFlowLogs": false, - "fingerprint": "abcdef0123A=", - "gatewayAddress": "10.0.0.1", - "id": "000000000000000000000", - "ipCidrRange": "10.0.0.0/24", - "kind": "compute#subnetwork", - "logConfig": { - "enable": false - }, - "name": "computesubnetwork-${uniqueId}", - "network": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/networks/computenetwork-${uniqueId}", - "privateIpGoogleAccess": false, - "privateIpv6GoogleAccess": "DISABLE_GOOGLE_ACCESS", - "purpose": "PRIVATE", - "region": "https://www.googleapis.com/compute/v1/projects/${projectId}/regions/us-central1", - "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/regions/us-central1/subnetworks/computesubnetwork-${uniqueId}", - "stackType": "IPV4_ONLY" -} - ---- - -GET https://managedkafka.googleapis.com/v1/projects/${projectId}/locations/us-central1/operations/${operationID} -Content-Type: application/json -User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} -X-Goog-Request-Params: name=projects%2F${projectId}%2Flocations%2Fus-central1%2Foperations%2F${operationID} - -200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -1226,7 +924,6 @@ X-Xss-Protection: 0 "apiVersion": "v1", "createTime": "2024-04-01T12:34:56.123456Z", "endTime": "2024-04-01T12:34:56.123456Z", - "requestedCancellation": false, "target": "projects/${projectId}/locations/us-central1/clusters/managedkafkacluster-${uniqueId}", "verb": "delete" }, @@ -1243,6 +940,7 @@ Content-Type: application/json User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -1253,11 +951,10 @@ X-Frame-Options: SAMEORIGIN X-Xss-Protection: 0 { - "allowSubnetCidrRoutesOverlap": false, "creationTimestamp": "2024-04-01T12:34:56.123456Z", "enableFlowLogs": false, "fingerprint": "abcdef0123A=", - "gatewayAddress": "10.0.0.1", + "gatewayAddress": "10.2.0.1", "id": "000000000000000000000", "ipCidrRange": "10.0.0.0/24", "kind": "compute#subnetwork", @@ -1281,6 +978,7 @@ Content-Type: application/json User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -1312,6 +1010,7 @@ GET https://compute.googleapis.com/compute/v1/projects/${projectId}/regions/us-c User-Agent: google-api-go-client/0.5 kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -1345,6 +1044,7 @@ Content-Type: application/json User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -1361,10 +1061,6 @@ X-Xss-Protection: 0 "kind": "compute#network", "name": "computenetwork-${uniqueId}", "networkFirewallPolicyEnforcementOrder": "AFTER_CLASSIC_FIREWALL", - "routingConfig": { - "bgpBestPathSelectionMode": "LEGACY", - "routingMode": "REGIONAL" - }, "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/networks/computenetwork-${uniqueId}", "selfLinkWithId": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/networks/${networkID}" } @@ -1376,6 +1072,7 @@ Content-Type: application/json User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -1406,6 +1103,7 @@ GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/opera User-Agent: google-api-go-client/0.5 kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -1437,6 +1135,7 @@ GET https://cloudkms.googleapis.com/v1/projects/${projectId}/locations/us-centra User-Agent: google-api-go-client/0.5 kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -1473,6 +1172,7 @@ User-Agent: google-api-go-client/0.5 kcc/${kccVersion} (+https://github.com/Goog } 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -1493,6 +1193,7 @@ GET https://cloudkms.googleapis.com/v1/projects/${projectId}/locations/us-centra User-Agent: google-api-go-client/0.5 kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -1514,6 +1215,7 @@ Content-Type: application/json User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -1552,6 +1254,7 @@ GET https://cloudkms.googleapis.com/v1/projects/${projectId}/locations/us-centra User-Agent: google-api-go-client/0.5 kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -1584,6 +1287,7 @@ User-Agent: google-api-go-client/0.5 kcc/${kccVersion} (+https://github.com/Goog {} 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -1610,6 +1314,7 @@ Content-Type: application/json User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin