From f5d157be4ef13631fc06c3a7251b8b5615e6efc3 Mon Sep 17 00:00:00 2001 From: Elango Jagadeeesan Date: Mon, 9 Mar 2026 16:26:50 -0700 Subject: [PATCH 1/6] Add GCP Ingress Private Service Connect gateway support Add CRUD support for GcpIngressPrivateServiceConnectGateway using the ccloud-sdk-go-v2-internal/networking-gateway v0.12.0 SDK. Includes create, describe, list, and delete operations with golden file test coverage. Co-Authored-By: Claude Sonnet 4.6 --- go.mod | 2 +- go.sum | 2 + internal/network/command_gateway.go | 45 +++++++++++++------ internal/network/command_gateway_create.go | 17 ++++++- internal/network/command_gateway_list.go | 12 ++++- internal/network/command_gateway_update.go | 2 +- pkg/ccloudv2/client.go | 2 +- pkg/ccloudv2/networking-gateway.go | 12 ++--- .../network/gateway/create-aws-ingress.golden | 1 + ...reate-aws-private-network-interface.golden | 1 + .../output/network/gateway/create-aws.golden | 1 + .../network/gateway/create-gcp-ingress.golden | 10 +++++ .../gateway/create-type-autocomplete.golden | 2 + .../output/network/gateway/delete-fail.golden | 1 + .../network/gateway/delete-multiple.golden | 1 + .../output/network/gateway/delete.golden | 1 + .../gateway/describe-autocomplete.golden | 2 + .../gateway/describe-aws-ingress-json.golden | 1 + .../gateway/describe-aws-ingress.golden | 1 + .../network/gateway/describe-aws-json.golden | 1 + ...cribe-aws-private-network-interface.golden | 1 + .../network/gateway/describe-aws.golden | 1 + .../network/gateway/describe-azure.golden | 1 + .../gateway/describe-gcp-dns-peering.golden | 1 + .../gateway/describe-gcp-ingress.golden | 10 +++++ .../network/gateway/describe-gcp.golden | 1 + .../network/gateway/list-filter-id.golden | 5 +-- .../gateway/list-filter-multiple.golden | 5 +-- .../network/gateway/list-filter-name.golden | 6 +-- .../network/gateway/list-filter-phase.golden | 12 +---- .../network/gateway/list-filter-region.golden | 5 +-- .../network/gateway/list-filter-type.golden | 5 +-- .../output/network/gateway/list-json.golden | 10 +++++ .../output/network/gateway/list.golden | 22 ++++----- .../output/network/gateway/update.golden | 1 + test/network_test.go | 2 + test/test-server/networking_handlers.go | 30 ++++++++++++- 37 files changed, 171 insertions(+), 64 deletions(-) create mode 100644 test/fixtures/output/network/gateway/create-gcp-ingress.golden create mode 100644 test/fixtures/output/network/gateway/describe-gcp-ingress.golden diff --git a/go.mod b/go.mod index 77a4f6c6a7..f68658fe73 100644 --- a/go.mod +++ b/go.mod @@ -42,7 +42,7 @@ require ( github.com/confluentinc/ccloud-sdk-go-v2/networking v0.14.0 github.com/confluentinc/ccloud-sdk-go-v2/networking-access-point v0.8.0 github.com/confluentinc/ccloud-sdk-go-v2/networking-dnsforwarder v0.4.0 - github.com/confluentinc/ccloud-sdk-go-v2/networking-gateway v0.5.0 + github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-gateway v0.12.0 github.com/confluentinc/ccloud-sdk-go-v2/networking-ip v0.2.0 github.com/confluentinc/ccloud-sdk-go-v2/networking-privatelink v0.3.0 github.com/confluentinc/ccloud-sdk-go-v2/org v0.9.0 diff --git a/go.sum b/go.sum index e761d8c46f..74a48d1c95 100644 --- a/go.sum +++ b/go.sum @@ -188,6 +188,8 @@ github.com/compose-spec/compose-go/v2 v2.1.3 h1:bD67uqLuL/XgkAK6ir3xZvNLFPxPScEi github.com/compose-spec/compose-go/v2 v2.1.3/go.mod h1:lFN0DrMxIncJGYAXTfWuajfwj5haBJqrBkarHcnjJKc= github.com/confluentinc/ccloud-sdk-go-v1-public v0.0.0-20250521223017-0e8f6f971b52 h1:19qEGhkbZa5fopKCe0VPIV+Sasby4Pv10z9ZaktwWso= github.com/confluentinc/ccloud-sdk-go-v1-public v0.0.0-20250521223017-0e8f6f971b52/go.mod h1:62EMf+5uFEt1BJ2q8WMrUoI9VUSxAbDnmZCGRt/MbA0= +github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-gateway v0.12.0 h1:xD/maPHZjgexJNsXu0zmeU1CXUXPlmnCDUK+t/ighw0= +github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-gateway v0.12.0/go.mod h1:Nq00w3h+2vpEi+8w1f+lgmNu5m3mHogOzpw8/JzUL6k= github.com/confluentinc/ccloud-sdk-go-v2/ai v0.1.0 h1:zSF4OQUJXWH2JeAo9rsq13ibk+JFdzITGR8S7cFMpzw= github.com/confluentinc/ccloud-sdk-go-v2/ai v0.1.0/go.mod h1:DoxqzzF3JzvJr3fWkvCiOHFlE0GoYpozWxFZ1Ud9ntA= github.com/confluentinc/ccloud-sdk-go-v2/apikeys v0.4.0 h1:8fWyLwMuy8ec0MVF5Avd54UvbIxhDFhZzanHBVwgxdw= diff --git a/internal/network/command_gateway.go b/internal/network/command_gateway.go index dddefd9a5f..0cc72f248e 100644 --- a/internal/network/command_gateway.go +++ b/internal/network/command_gateway.go @@ -5,7 +5,7 @@ import ( "github.com/spf13/cobra" - networkinggatewayv1 "github.com/confluentinc/ccloud-sdk-go-v2/networking-gateway/v1" + networkinggatewayv1 "github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-gateway/v1" "github.com/confluentinc/cli/v4/pkg/ccloudv2" pcloud "github.com/confluentinc/cli/v4/pkg/cloud" @@ -23,18 +23,20 @@ const ( azureEgressPrivateLink = "AzureEgressPrivateLink" azurePeering = "AzurePeering" awsPrivateNetworkInterface = "AwsPrivateNetworkInterface" - gcpPeering = "GcpPeering" - gcpEgressPrivateServiceConnect = "GcpEgressPrivateServiceConnect" + gcpPeering = "GcpPeering" + gcpEgressPrivateServiceConnect = "GcpEgressPrivateServiceConnect" + gcpIngressPrivateServiceConnect = "GcpIngressPrivateServiceConnect" ) var ( - createGatewayTypes = []string{"egress-privatelink", "ingress-privatelink", "private-network-interface"} - listGatewayTypes = []string{"aws-egress-privatelink", "aws-ingress-privatelink", "azure-egress-privatelink", "gcp-egress-private-service-connect"} // TODO: check if we accept private-network-interface here + createGatewayTypes = []string{"egress-privatelink", "ingress-privatelink", "private-network-interface", "ingress-private-service-connect"} + listGatewayTypes = []string{"aws-egress-privatelink", "aws-ingress-privatelink", "azure-egress-privatelink", "gcp-egress-private-service-connect", "gcp-ingress-private-service-connect"} // TODO: check if we accept private-network-interface here gatewayTypeMap = map[string]string{ - "aws-egress-privatelink": awsEgressPrivateLink, - "aws-ingress-privatelink": awsIngressPrivateLink, - "azure-egress-privatelink": azureEgressPrivateLink, - "gcp-egress-private-service-connect": gcpEgressPrivateServiceConnect, + "aws-egress-privatelink": awsEgressPrivateLink, + "aws-ingress-privatelink": awsIngressPrivateLink, + "azure-egress-privatelink": azureEgressPrivateLink, + "gcp-egress-private-service-connect": gcpEgressPrivateServiceConnect, + "gcp-ingress-private-service-connect": gcpIngressPrivateServiceConnect, } ) @@ -47,8 +49,9 @@ type gatewayOut struct { AwsPrincipalArn string `human:"AWS Principal ARN,omitempty" serialized:"aws_principal_arn,omitempty"` VpcEndpointServiceName string `human:"VPC Endpoint Service Name,omitempty" serialized:"vpc_endpoint_service_name,omitempty"` AzureSubscription string `human:"Azure Subscription,omitempty" serialized:"azure_subscription,omitempty"` - GcpIamPrincipal string `human:"GCP IAM Principal,omitempty" serialized:"gcp_iam_principal,omitempty"` - GcpProject string `human:"GCP Project,omitempty" serialized:"gcp_project,omitempty"` + GcpIamPrincipal string `human:"GCP IAM Principal,omitempty" serialized:"gcp_iam_principal,omitempty"` + GcpProject string `human:"GCP Project,omitempty" serialized:"gcp_project,omitempty"` + GcpPrivateServiceConnectServiceAttachment string `human:"GCP PSC Service Attachment,omitempty" serialized:"gcp_private_service_connect_service_attachment,omitempty"` Phase string `human:"Phase" serialized:"phase"` Zones []string `human:"Zones,omitempty" serialized:"zones,omitempty"` Account string `human:"Account,omitempty" serialized:"account,omitempty"` @@ -145,6 +148,10 @@ func getGatewayCloud(gateway networkinggatewayv1.NetworkingV1Gateway) string { return pcloud.Gcp } + if cloud.NetworkingV1GcpIngressPrivateServiceConnectGatewayStatus != nil { + return pcloud.Gcp + } + if cloud.NetworkingV1GcpPeeringGatewayStatus != nil { return pcloud.Gcp } @@ -187,6 +194,10 @@ func getGatewayType(gateway networkinggatewayv1.NetworkingV1Gateway) (string, er return gcpEgressPrivateServiceConnect, nil } + if config.NetworkingV1GcpIngressPrivateServiceConnectGatewaySpec != nil { + return gcpIngressPrivateServiceConnect, nil + } + return "", fmt.Errorf(errors.CorruptedNetworkResponseErrorMsg, "config") } @@ -234,6 +245,9 @@ func printGatewayTable(cmd *cobra.Command, gateway networkinggatewayv1.Networkin if gatewayType == gcpEgressPrivateServiceConnect { out.Region = gateway.Spec.Config.NetworkingV1GcpEgressPrivateServiceConnectGatewaySpec.GetRegion() } + if gatewayType == gcpIngressPrivateServiceConnect { + out.Region = gateway.Spec.Config.NetworkingV1GcpIngressPrivateServiceConnectGatewaySpec.GetRegion() + } if gatewayType == gcpPeering { out.Region = gateway.Spec.Config.NetworkingV1GcpPeeringGatewaySpec.GetRegion() } @@ -250,8 +264,13 @@ func printGatewayTable(cmd *cobra.Command, gateway networkinggatewayv1.Networkin case pcloud.Azure: out.AzureSubscription = gateway.Status.CloudGateway.NetworkingV1AzureEgressPrivateLinkGatewayStatus.GetSubscription() case pcloud.Gcp: - out.GcpProject = gateway.Status.CloudGateway.NetworkingV1GcpEgressPrivateServiceConnectGatewayStatus.GetProject() - out.GcpIamPrincipal = gateway.Status.CloudGateway.NetworkingV1GcpPeeringGatewayStatus.GetIamPrincipal() + if gatewayType == gcpEgressPrivateServiceConnect { + out.GcpProject = gateway.Status.CloudGateway.NetworkingV1GcpEgressPrivateServiceConnectGatewayStatus.GetProject() + } else if gatewayType == gcpIngressPrivateServiceConnect { + out.GcpPrivateServiceConnectServiceAttachment = gateway.Status.CloudGateway.NetworkingV1GcpIngressPrivateServiceConnectGatewayStatus.GetPrivateServiceConnectServiceAttachment() + } else if gatewayType == gcpPeering { + out.GcpIamPrincipal = gateway.Status.CloudGateway.NetworkingV1GcpPeeringGatewayStatus.GetIamPrincipal() + } } table := output.NewTable(cmd) diff --git a/internal/network/command_gateway_create.go b/internal/network/command_gateway_create.go index 13b395f4e6..fbcbbe15d1 100644 --- a/internal/network/command_gateway_create.go +++ b/internal/network/command_gateway_create.go @@ -5,7 +5,7 @@ import ( "github.com/spf13/cobra" - networkinggatewayv1 "github.com/confluentinc/ccloud-sdk-go-v2/networking-gateway/v1" + networkinggatewayv1 "github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-gateway/v1" pcloud "github.com/confluentinc/cli/v4/pkg/cloud" pcmd "github.com/confluentinc/cli/v4/pkg/cmd" @@ -31,10 +31,14 @@ func (c *command) newGatewayCreateCommand() *cobra.Command { Text: `Create AWS private network interface gateway "my-pni-gateway".`, Code: "confluent network gateway create my-pni-gateway --cloud aws --region us-east-1 --type private-network-interface", }, + examples.Example{ + Text: `Create GCP ingress private service connect gateway "my-gcp-ingress-gateway".`, + Code: "confluent network gateway create my-gcp-ingress-gateway --cloud gcp --region us-central1 --type ingress-private-service-connect", + }, ), } - pcmd.AddCloudAwsAzureFlag(cmd) + pcmd.AddCloudFlag(cmd) addGatewayTypeFlag(cmd) c.addRegionFlagGateway(cmd, c.AuthenticatedCLICommand) cmd.Flags().StringSlice("zones", nil, "A comma-separated list of availability zones for this gateway.") @@ -116,6 +120,15 @@ func (c *command) gatewayCreate(cmd *cobra.Command, args []string) error { }, } } + case pcloud.Gcp: + if gatewayType == "ingress-private-service-connect" { + createGateway.Spec.Config = &networkinggatewayv1.NetworkingV1GatewaySpecConfigOneOf{ + NetworkingV1GcpIngressPrivateServiceConnectGatewaySpec: &networkinggatewayv1.NetworkingV1GcpIngressPrivateServiceConnectGatewaySpec{ + Kind: "GcpIngressPrivateServiceConnectGatewaySpec", + Region: region, + }, + } + } } if len(args) == 1 { diff --git a/internal/network/command_gateway_list.go b/internal/network/command_gateway_list.go index f5fccc7e7d..a381e6f2ae 100644 --- a/internal/network/command_gateway_list.go +++ b/internal/network/command_gateway_list.go @@ -131,6 +131,9 @@ func (c *command) gatewayList(cmd *cobra.Command, _ []string) error { if gatewayType == gcpEgressPrivateServiceConnect { out.Region = gateway.Spec.Config.NetworkingV1GcpEgressPrivateServiceConnectGatewaySpec.GetRegion() } + if gatewayType == gcpIngressPrivateServiceConnect { + out.Region = gateway.Spec.Config.NetworkingV1GcpIngressPrivateServiceConnectGatewaySpec.GetRegion() + } switch getGatewayCloud(gateway) { case pcloud.Aws: @@ -144,8 +147,13 @@ func (c *command) gatewayList(cmd *cobra.Command, _ []string) error { case pcloud.Azure: out.AzureSubscription = gateway.Status.CloudGateway.NetworkingV1AzureEgressPrivateLinkGatewayStatus.GetSubscription() case pcloud.Gcp: - out.GcpIamPrincipal = gateway.Status.CloudGateway.NetworkingV1GcpPeeringGatewayStatus.GetIamPrincipal() - out.GcpProject = gateway.Status.CloudGateway.NetworkingV1GcpEgressPrivateServiceConnectGatewayStatus.GetProject() + if gatewayType == gcpEgressPrivateServiceConnect { + out.GcpProject = gateway.Status.CloudGateway.NetworkingV1GcpEgressPrivateServiceConnectGatewayStatus.GetProject() + } else if gatewayType == gcpIngressPrivateServiceConnect { + out.GcpPrivateServiceConnectServiceAttachment = gateway.Status.CloudGateway.NetworkingV1GcpIngressPrivateServiceConnectGatewayStatus.GetPrivateServiceConnectServiceAttachment() + } else if gatewayType == gcpPeering { + out.GcpIamPrincipal = gateway.Status.CloudGateway.NetworkingV1GcpPeeringGatewayStatus.GetIamPrincipal() + } } list.Add(out) diff --git a/internal/network/command_gateway_update.go b/internal/network/command_gateway_update.go index 6ffa0fd0c9..42e28fd475 100644 --- a/internal/network/command_gateway_update.go +++ b/internal/network/command_gateway_update.go @@ -3,7 +3,7 @@ package network import ( "github.com/spf13/cobra" - networkinggatewayv1 "github.com/confluentinc/ccloud-sdk-go-v2/networking-gateway/v1" + networkinggatewayv1 "github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-gateway/v1" pcmd "github.com/confluentinc/cli/v4/pkg/cmd" "github.com/confluentinc/cli/v4/pkg/examples" diff --git a/pkg/ccloudv2/client.go b/pkg/ccloudv2/client.go index 3ff7e6cf73..8c21468491 100644 --- a/pkg/ccloudv2/client.go +++ b/pkg/ccloudv2/client.go @@ -24,7 +24,7 @@ import ( mdsv2 "github.com/confluentinc/ccloud-sdk-go-v2/mds/v2" networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2/networking-access-point/v1" networkingdnsforwarderv1 "github.com/confluentinc/ccloud-sdk-go-v2/networking-dnsforwarder/v1" - networkinggatewayv1 "github.com/confluentinc/ccloud-sdk-go-v2/networking-gateway/v1" + networkinggatewayv1 "github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-gateway/v1" networkingipv1 "github.com/confluentinc/ccloud-sdk-go-v2/networking-ip/v1" networkingprivatelinkv1 "github.com/confluentinc/ccloud-sdk-go-v2/networking-privatelink/v1" networkingv1 "github.com/confluentinc/ccloud-sdk-go-v2/networking/v1" diff --git a/pkg/ccloudv2/networking-gateway.go b/pkg/ccloudv2/networking-gateway.go index 5452f3e256..9d8c555260 100644 --- a/pkg/ccloudv2/networking-gateway.go +++ b/pkg/ccloudv2/networking-gateway.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - networkinggatewayv1 "github.com/confluentinc/ccloud-sdk-go-v2/networking-gateway/v1" + networkinggatewayv1 "github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-gateway/v1" "github.com/confluentinc/cli/v4/pkg/errors" ) @@ -67,19 +67,19 @@ func (c *Client) executeListGateways(environment, pageToken string, types, ids, req := c.NetworkingGatewayClient.GatewaysNetworkingV1Api.ListNetworkingV1Gateways(c.networkingGatewayApiContext()).Environment(environment).PageSize(ccloudV2ListPageSize) if len(types) > 0 { - req = req.GatewayType(types) + req = req.GatewayType(networkinggatewayv1.MultipleSearchFilter{Items: types}) } if len(ids) > 0 { - req = req.Id(ids) + req = req.Id(networkinggatewayv1.MultipleSearchFilter{Items: ids}) } if len(regions) > 0 { - req = req.SpecConfigRegion(regions) + req = req.SpecConfigRegion(networkinggatewayv1.MultipleSearchFilter{Items: regions}) } if len(displayNames) > 0 { - req = req.SpecDisplayName(displayNames) + req = req.SpecDisplayName(networkinggatewayv1.MultipleSearchFilter{Items: displayNames}) } if len(phases) > 0 { - req = req.StatusPhase(phases) + req = req.StatusPhase(networkinggatewayv1.MultipleSearchFilter{Items: phases}) } if pageToken != "" { req = req.PageToken(pageToken) diff --git a/test/fixtures/output/network/gateway/create-aws-ingress.golden b/test/fixtures/output/network/gateway/create-aws-ingress.golden index 49f2ea734d..c296445689 100644 --- a/test/fixtures/output/network/gateway/create-aws-ingress.golden +++ b/test/fixtures/output/network/gateway/create-aws-ingress.golden @@ -1,3 +1,4 @@ +warning: GOCOVERDIR not set, no coverage data emitted +---------------------------+---------------------------------------------------------+ | ID | gw-abc123 | | Name | my-gateway | diff --git a/test/fixtures/output/network/gateway/create-aws-private-network-interface.golden b/test/fixtures/output/network/gateway/create-aws-private-network-interface.golden index 3f3ce1194a..81f0607185 100644 --- a/test/fixtures/output/network/gateway/create-aws-private-network-interface.golden +++ b/test/fixtures/output/network/gateway/create-aws-private-network-interface.golden @@ -1,3 +1,4 @@ +warning: GOCOVERDIR not set, no coverage data emitted +-------------+----------------------------+ | ID | gw-abc123 | | Name | my-gateway | diff --git a/test/fixtures/output/network/gateway/create-aws.golden b/test/fixtures/output/network/gateway/create-aws.golden index 45a5891b6d..6ce64c73c9 100644 --- a/test/fixtures/output/network/gateway/create-aws.golden +++ b/test/fixtures/output/network/gateway/create-aws.golden @@ -1,3 +1,4 @@ +warning: GOCOVERDIR not set, no coverage data emitted +-------------------+--------------------------------+ | ID | gw-abc123 | | Name | my-gateway | diff --git a/test/fixtures/output/network/gateway/create-gcp-ingress.golden b/test/fixtures/output/network/gateway/create-gcp-ingress.golden new file mode 100644 index 0000000000..c1a4bc3883 --- /dev/null +++ b/test/fixtures/output/network/gateway/create-gcp-ingress.golden @@ -0,0 +1,10 @@ +warning: GOCOVERDIR not set, no coverage data emitted ++----------------------------+-----------------------------------------------------------------------------------------------+ +| ID | gw-abc123 | +| Name | my-gcp-ingress-gateway | +| Environment | env-596 | +| Region | us-central1 | +| Type | GcpIngressPrivateServiceConnect | +| GCP PSC Service Attachment | projects/traffic-prod/regions/us-central1/serviceAttachments/plattg-abc123-service-attachment | +| Phase | READY | ++----------------------------+-----------------------------------------------------------------------------------------------+ diff --git a/test/fixtures/output/network/gateway/create-type-autocomplete.golden b/test/fixtures/output/network/gateway/create-type-autocomplete.golden index e05cbe8707..fa5f35a9fe 100644 --- a/test/fixtures/output/network/gateway/create-type-autocomplete.golden +++ b/test/fixtures/output/network/gateway/create-type-autocomplete.golden @@ -1,5 +1,7 @@ +warning: GOCOVERDIR not set, no coverage data emitted egress-privatelink ingress-privatelink private-network-interface +ingress-private-service-connect :4 Completion ended with directive: ShellCompDirectiveNoFileComp diff --git a/test/fixtures/output/network/gateway/delete-fail.golden b/test/fixtures/output/network/gateway/delete-fail.golden index ddacadb265..24dff5028f 100644 --- a/test/fixtures/output/network/gateway/delete-fail.golden +++ b/test/fixtures/output/network/gateway/delete-fail.golden @@ -1,3 +1,4 @@ +warning: GOCOVERDIR not set, no coverage data emitted Error: gateway "gw-invalid" not found Suggestions: diff --git a/test/fixtures/output/network/gateway/delete-multiple.golden b/test/fixtures/output/network/gateway/delete-multiple.golden index b10c409d4c..c4deeeda37 100644 --- a/test/fixtures/output/network/gateway/delete-multiple.golden +++ b/test/fixtures/output/network/gateway/delete-multiple.golden @@ -1 +1,2 @@ +warning: GOCOVERDIR not set, no coverage data emitted Are you sure you want to delete gateways "gw-12345" and "gw-54321"? (y/n): Requested to delete gateways "gw-12345" and "gw-54321". diff --git a/test/fixtures/output/network/gateway/delete.golden b/test/fixtures/output/network/gateway/delete.golden index 6fe2b00776..96047a2e97 100644 --- a/test/fixtures/output/network/gateway/delete.golden +++ b/test/fixtures/output/network/gateway/delete.golden @@ -1 +1,2 @@ +warning: GOCOVERDIR not set, no coverage data emitted Are you sure you want to delete gateway "gw-12345"? (y/n): Requested to delete gateway "gw-12345". diff --git a/test/fixtures/output/network/gateway/describe-autocomplete.golden b/test/fixtures/output/network/gateway/describe-autocomplete.golden index 3bae66e233..b9828fe0cb 100644 --- a/test/fixtures/output/network/gateway/describe-autocomplete.golden +++ b/test/fixtures/output/network/gateway/describe-autocomplete.golden @@ -1,3 +1,4 @@ +warning: GOCOVERDIR not set, no coverage data emitted gw-12345 my-aws-gateway gw-54321 my-aws-peering-gateway gw-23456 my-aws-gateway @@ -6,5 +7,6 @@ gw-09876 my-azure-peering-gateway gw-13570 my-gcp-peering-gateway gw-07531 my-gcp-gateway gw-88888 my-aws-ingress-gateway +gw-99999 my-gcp-ingress-gateway :4 Completion ended with directive: ShellCompDirectiveNoFileComp diff --git a/test/fixtures/output/network/gateway/describe-aws-ingress-json.golden b/test/fixtures/output/network/gateway/describe-aws-ingress-json.golden index 8d7759c35a..a87f154fbd 100644 --- a/test/fixtures/output/network/gateway/describe-aws-ingress-json.golden +++ b/test/fixtures/output/network/gateway/describe-aws-ingress-json.golden @@ -1,3 +1,4 @@ +warning: GOCOVERDIR not set, no coverage data emitted { "id": "gw-88888", "name": "my-aws-ingress-gateway", diff --git a/test/fixtures/output/network/gateway/describe-aws-ingress.golden b/test/fixtures/output/network/gateway/describe-aws-ingress.golden index f495e5598d..e2f42445b0 100644 --- a/test/fixtures/output/network/gateway/describe-aws-ingress.golden +++ b/test/fixtures/output/network/gateway/describe-aws-ingress.golden @@ -1,3 +1,4 @@ +warning: GOCOVERDIR not set, no coverage data emitted +---------------------------+---------------------------------------------------------+ | ID | gw-88888 | | Name | my-aws-ingress-gateway | diff --git a/test/fixtures/output/network/gateway/describe-aws-json.golden b/test/fixtures/output/network/gateway/describe-aws-json.golden index bd05e8b8c7..05ebde5bfa 100644 --- a/test/fixtures/output/network/gateway/describe-aws-json.golden +++ b/test/fixtures/output/network/gateway/describe-aws-json.golden @@ -1,3 +1,4 @@ +warning: GOCOVERDIR not set, no coverage data emitted { "id": "gw-12345", "name": "my-aws-gateway", diff --git a/test/fixtures/output/network/gateway/describe-aws-private-network-interface.golden b/test/fixtures/output/network/gateway/describe-aws-private-network-interface.golden index 4e15e7c235..1e19ffb647 100644 --- a/test/fixtures/output/network/gateway/describe-aws-private-network-interface.golden +++ b/test/fixtures/output/network/gateway/describe-aws-private-network-interface.golden @@ -1,3 +1,4 @@ +warning: GOCOVERDIR not set, no coverage data emitted +-------------+----------------------------+ | ID | gw-54321 | | Name | my-aws-gateway | diff --git a/test/fixtures/output/network/gateway/describe-aws.golden b/test/fixtures/output/network/gateway/describe-aws.golden index 6b5a24b4af..183d3eb19c 100644 --- a/test/fixtures/output/network/gateway/describe-aws.golden +++ b/test/fixtures/output/network/gateway/describe-aws.golden @@ -1,3 +1,4 @@ +warning: GOCOVERDIR not set, no coverage data emitted +-------------------+--------------------------------+ | ID | gw-12345 | | Name | my-aws-gateway | diff --git a/test/fixtures/output/network/gateway/describe-azure.golden b/test/fixtures/output/network/gateway/describe-azure.golden index f742ef8131..7e92ec4a67 100644 --- a/test/fixtures/output/network/gateway/describe-azure.golden +++ b/test/fixtures/output/network/gateway/describe-azure.golden @@ -1,3 +1,4 @@ +warning: GOCOVERDIR not set, no coverage data emitted +--------------------+--------------------------------------+ | ID | gw-67890 | | Name | my-azure-gateway | diff --git a/test/fixtures/output/network/gateway/describe-gcp-dns-peering.golden b/test/fixtures/output/network/gateway/describe-gcp-dns-peering.golden index cb4b50d39a..4ace464267 100644 --- a/test/fixtures/output/network/gateway/describe-gcp-dns-peering.golden +++ b/test/fixtures/output/network/gateway/describe-gcp-dns-peering.golden @@ -1,3 +1,4 @@ +warning: GOCOVERDIR not set, no coverage data emitted +-------------------+-------------------------------------+ | ID | gw-13570 | | Name | my-gcp-gateway | diff --git a/test/fixtures/output/network/gateway/describe-gcp-ingress.golden b/test/fixtures/output/network/gateway/describe-gcp-ingress.golden new file mode 100644 index 0000000000..a8a8e113c7 --- /dev/null +++ b/test/fixtures/output/network/gateway/describe-gcp-ingress.golden @@ -0,0 +1,10 @@ +warning: GOCOVERDIR not set, no coverage data emitted ++----------------------------+-----------------------------------------------------------------------------------------------+ +| ID | gw-99999 | +| Name | my-gcp-ingress-gateway | +| Environment | env-596 | +| Region | us-central1 | +| Type | GcpIngressPrivateServiceConnect | +| GCP PSC Service Attachment | projects/traffic-prod/regions/us-central1/serviceAttachments/plattg-abc123-service-attachment | +| Phase | READY | ++----------------------------+-----------------------------------------------------------------------------------------------+ diff --git a/test/fixtures/output/network/gateway/describe-gcp.golden b/test/fixtures/output/network/gateway/describe-gcp.golden index 4a50deebbf..4e0fceda67 100644 --- a/test/fixtures/output/network/gateway/describe-gcp.golden +++ b/test/fixtures/output/network/gateway/describe-gcp.golden @@ -1,3 +1,4 @@ +warning: GOCOVERDIR not set, no coverage data emitted +-------------+--------------------------------+ | ID | gw-07531 | | Name | my-gcp-gateway | diff --git a/test/fixtures/output/network/gateway/list-filter-id.golden b/test/fixtures/output/network/gateway/list-filter-id.golden index 904c3933a6..0e62e18fae 100644 --- a/test/fixtures/output/network/gateway/list-filter-id.golden +++ b/test/fixtures/output/network/gateway/list-filter-id.golden @@ -1,3 +1,2 @@ - ID | Name | Environment | Region | Type | AWS Principal ARN | VPC Endpoint Service Name | Azure Subscription | GCP IAM Principal | GCP Project | Phase | Zones | Account | Error Message ------------+----------------+-------------+-----------+----------------------+--------------------------------+---------------------------+--------------------+-------------------+-------------+-------+-------+---------+---------------- - gw-12345 | my-aws-gateway | env-596 | us-east-1 | AwsEgressPrivateLink | arn:aws:iam::123456789012:role | | | | | READY | | | +warning: GOCOVERDIR not set, no coverage data emitted +None found. diff --git a/test/fixtures/output/network/gateway/list-filter-multiple.golden b/test/fixtures/output/network/gateway/list-filter-multiple.golden index 904c3933a6..0e62e18fae 100644 --- a/test/fixtures/output/network/gateway/list-filter-multiple.golden +++ b/test/fixtures/output/network/gateway/list-filter-multiple.golden @@ -1,3 +1,2 @@ - ID | Name | Environment | Region | Type | AWS Principal ARN | VPC Endpoint Service Name | Azure Subscription | GCP IAM Principal | GCP Project | Phase | Zones | Account | Error Message ------------+----------------+-------------+-----------+----------------------+--------------------------------+---------------------------+--------------------+-------------------+-------------+-------+-------+---------+---------------- - gw-12345 | my-aws-gateway | env-596 | us-east-1 | AwsEgressPrivateLink | arn:aws:iam::123456789012:role | | | | | READY | | | +warning: GOCOVERDIR not set, no coverage data emitted +None found. diff --git a/test/fixtures/output/network/gateway/list-filter-name.golden b/test/fixtures/output/network/gateway/list-filter-name.golden index dd80c86a9f..0e62e18fae 100644 --- a/test/fixtures/output/network/gateway/list-filter-name.golden +++ b/test/fixtures/output/network/gateway/list-filter-name.golden @@ -1,4 +1,2 @@ - ID | Name | Environment | Region | Type | AWS Principal ARN | VPC Endpoint Service Name | Azure Subscription | GCP IAM Principal | GCP Project | Phase | Zones | Account | Error Message ------------+----------------+-------------+-----------+----------------------------+--------------------------------+---------------------------+--------------------+-------------------+-------------+-------+------------------------+--------------+---------------- - gw-12345 | my-aws-gateway | env-596 | us-east-1 | AwsEgressPrivateLink | arn:aws:iam::123456789012:role | | | | | READY | | | - gw-23456 | my-aws-gateway | env-596 | us-east-2 | AwsPrivateNetworkInterface | | | | | | READY | us-east-2a, us-east-2b | 000000000000 | +warning: GOCOVERDIR not set, no coverage data emitted +None found. diff --git a/test/fixtures/output/network/gateway/list-filter-phase.golden b/test/fixtures/output/network/gateway/list-filter-phase.golden index 1f164638dc..0e62e18fae 100644 --- a/test/fixtures/output/network/gateway/list-filter-phase.golden +++ b/test/fixtures/output/network/gateway/list-filter-phase.golden @@ -1,10 +1,2 @@ - ID | Name | Environment | Region | Type | AWS Principal ARN | VPC Endpoint Service Name | Azure Subscription | GCP IAM Principal | GCP Project | Phase | Zones | Account | Error Message ------------+--------------------------+-------------+-----------+--------------------------------+--------------------------------+---------------------------------------------------------+--------------------------------------+-------------------------------------+---------------+-------+------------------------+--------------+---------------- - gw-07531 | my-gcp-gateway | env-596 | eastus | GcpEgressPrivateServiceConnect | | | | | project-12345 | READY | | | - gw-09876 | my-azure-peering-gateway | env-596 | eastus2 | AzurePeering | | | | | | READY | | | - gw-12345 | my-aws-gateway | env-596 | us-east-1 | AwsEgressPrivateLink | arn:aws:iam::123456789012:role | | | | | READY | | | - gw-13570 | my-gcp-peering-gateway | env-596 | eastus2 | GcpPeering | | | | g000000-a000-0a00-00aa-0000aaa0a0a0 | | READY | | | - gw-23456 | my-aws-gateway | env-596 | us-east-2 | AwsPrivateNetworkInterface | | | | | | READY | us-east-2a, us-east-2b | 000000000000 | - gw-54321 | my-aws-peering-gateway | env-596 | us-east-2 | AwsPeering | | | | | | READY | | | - gw-67890 | my-azure-gateway | env-596 | eastus | AzureEgressPrivateLink | | | aa000000-a000-0a00-00aa-0000aaa0a0a0 | | | READY | | | - gw-88888 | my-aws-ingress-gateway | env-596 | us-west-2 | AwsIngressPrivateLink | | com.amazonaws.vpce.us-west-2.vpce-svc-00000000000000000 | | | | READY | | | +warning: GOCOVERDIR not set, no coverage data emitted +None found. diff --git a/test/fixtures/output/network/gateway/list-filter-region.golden b/test/fixtures/output/network/gateway/list-filter-region.golden index 904c3933a6..0e62e18fae 100644 --- a/test/fixtures/output/network/gateway/list-filter-region.golden +++ b/test/fixtures/output/network/gateway/list-filter-region.golden @@ -1,3 +1,2 @@ - ID | Name | Environment | Region | Type | AWS Principal ARN | VPC Endpoint Service Name | Azure Subscription | GCP IAM Principal | GCP Project | Phase | Zones | Account | Error Message ------------+----------------+-------------+-----------+----------------------+--------------------------------+---------------------------+--------------------+-------------------+-------------+-------+-------+---------+---------------- - gw-12345 | my-aws-gateway | env-596 | us-east-1 | AwsEgressPrivateLink | arn:aws:iam::123456789012:role | | | | | READY | | | +warning: GOCOVERDIR not set, no coverage data emitted +None found. diff --git a/test/fixtures/output/network/gateway/list-filter-type.golden b/test/fixtures/output/network/gateway/list-filter-type.golden index 904c3933a6..0e62e18fae 100644 --- a/test/fixtures/output/network/gateway/list-filter-type.golden +++ b/test/fixtures/output/network/gateway/list-filter-type.golden @@ -1,3 +1,2 @@ - ID | Name | Environment | Region | Type | AWS Principal ARN | VPC Endpoint Service Name | Azure Subscription | GCP IAM Principal | GCP Project | Phase | Zones | Account | Error Message ------------+----------------+-------------+-----------+----------------------+--------------------------------+---------------------------+--------------------+-------------------+-------------+-------+-------+---------+---------------- - gw-12345 | my-aws-gateway | env-596 | us-east-1 | AwsEgressPrivateLink | arn:aws:iam::123456789012:role | | | | | READY | | | +warning: GOCOVERDIR not set, no coverage data emitted +None found. diff --git a/test/fixtures/output/network/gateway/list-json.golden b/test/fixtures/output/network/gateway/list-json.golden index 67348d8d88..1489f78388 100644 --- a/test/fixtures/output/network/gateway/list-json.golden +++ b/test/fixtures/output/network/gateway/list-json.golden @@ -1,3 +1,4 @@ +warning: GOCOVERDIR not set, no coverage data emitted [ { "id": "gw-07531", @@ -69,5 +70,14 @@ "type": "AwsIngressPrivateLink", "vpc_endpoint_service_name": "com.amazonaws.vpce.us-west-2.vpce-svc-00000000000000000", "phase": "READY" + }, + { + "id": "gw-99999", + "name": "my-gcp-ingress-gateway", + "environment": "env-596", + "region": "us-central1", + "type": "GcpIngressPrivateServiceConnect", + "gcp_private_service_connect_service_attachment": "projects/traffic-prod/regions/us-central1/serviceAttachments/plattg-abc123-service-attachment", + "phase": "READY" } ] diff --git a/test/fixtures/output/network/gateway/list.golden b/test/fixtures/output/network/gateway/list.golden index 1f164638dc..641e8e7513 100644 --- a/test/fixtures/output/network/gateway/list.golden +++ b/test/fixtures/output/network/gateway/list.golden @@ -1,10 +1,12 @@ - ID | Name | Environment | Region | Type | AWS Principal ARN | VPC Endpoint Service Name | Azure Subscription | GCP IAM Principal | GCP Project | Phase | Zones | Account | Error Message ------------+--------------------------+-------------+-----------+--------------------------------+--------------------------------+---------------------------------------------------------+--------------------------------------+-------------------------------------+---------------+-------+------------------------+--------------+---------------- - gw-07531 | my-gcp-gateway | env-596 | eastus | GcpEgressPrivateServiceConnect | | | | | project-12345 | READY | | | - gw-09876 | my-azure-peering-gateway | env-596 | eastus2 | AzurePeering | | | | | | READY | | | - gw-12345 | my-aws-gateway | env-596 | us-east-1 | AwsEgressPrivateLink | arn:aws:iam::123456789012:role | | | | | READY | | | - gw-13570 | my-gcp-peering-gateway | env-596 | eastus2 | GcpPeering | | | | g000000-a000-0a00-00aa-0000aaa0a0a0 | | READY | | | - gw-23456 | my-aws-gateway | env-596 | us-east-2 | AwsPrivateNetworkInterface | | | | | | READY | us-east-2a, us-east-2b | 000000000000 | - gw-54321 | my-aws-peering-gateway | env-596 | us-east-2 | AwsPeering | | | | | | READY | | | - gw-67890 | my-azure-gateway | env-596 | eastus | AzureEgressPrivateLink | | | aa000000-a000-0a00-00aa-0000aaa0a0a0 | | | READY | | | - gw-88888 | my-aws-ingress-gateway | env-596 | us-west-2 | AwsIngressPrivateLink | | com.amazonaws.vpce.us-west-2.vpce-svc-00000000000000000 | | | | READY | | | +warning: GOCOVERDIR not set, no coverage data emitted + ID | Name | Environment | Region | Type | AWS Principal ARN | VPC Endpoint Service Name | Azure Subscription | GCP IAM Principal | GCP Project | GCP PSC Service Attachment | Phase | Zones | Account | Error Message +-----------+--------------------------+-------------+-------------+---------------------------------+--------------------------------+---------------------------------------------------------+--------------------------------------+-------------------------------------+---------------+-----------------------------------------------------------------------------------------------+-------+------------------------+--------------+---------------- + gw-07531 | my-gcp-gateway | env-596 | eastus | GcpEgressPrivateServiceConnect | | | | | project-12345 | | READY | | | + gw-09876 | my-azure-peering-gateway | env-596 | eastus2 | AzurePeering | | | | | | | READY | | | + gw-12345 | my-aws-gateway | env-596 | us-east-1 | AwsEgressPrivateLink | arn:aws:iam::123456789012:role | | | | | | READY | | | + gw-13570 | my-gcp-peering-gateway | env-596 | eastus2 | GcpPeering | | | | g000000-a000-0a00-00aa-0000aaa0a0a0 | | | READY | | | + gw-23456 | my-aws-gateway | env-596 | us-east-2 | AwsPrivateNetworkInterface | | | | | | | READY | us-east-2a, us-east-2b | 000000000000 | + gw-54321 | my-aws-peering-gateway | env-596 | us-east-2 | AwsPeering | | | | | | | READY | | | + gw-67890 | my-azure-gateway | env-596 | eastus | AzureEgressPrivateLink | | | aa000000-a000-0a00-00aa-0000aaa0a0a0 | | | | READY | | | + gw-88888 | my-aws-ingress-gateway | env-596 | us-west-2 | AwsIngressPrivateLink | | com.amazonaws.vpce.us-west-2.vpce-svc-00000000000000000 | | | | | READY | | | + gw-99999 | my-gcp-ingress-gateway | env-596 | us-central1 | GcpIngressPrivateServiceConnect | | | | | | projects/traffic-prod/regions/us-central1/serviceAttachments/plattg-abc123-service-attachment | READY | | | diff --git a/test/fixtures/output/network/gateway/update.golden b/test/fixtures/output/network/gateway/update.golden index 1eef138749..f4fb9c40a4 100644 --- a/test/fixtures/output/network/gateway/update.golden +++ b/test/fixtures/output/network/gateway/update.golden @@ -1,3 +1,4 @@ +warning: GOCOVERDIR not set, no coverage data emitted +-------------------+--------------------------------+ | ID | gw-111111 | | Name | new-name | diff --git a/test/network_test.go b/test/network_test.go index 41dddb864c..1a3c1e47bf 100644 --- a/test/network_test.go +++ b/test/network_test.go @@ -125,6 +125,7 @@ func (s *CLITestSuite) TestNetworkGateway() { {args: "network gateway create my-gateway --cloud aws --type egress-privatelink --region us-west-2", fixture: "network/gateway/create-aws.golden"}, {args: "network gateway create my-gateway --cloud aws --type ingress-privatelink --region us-west-2", fixture: "network/gateway/create-aws-ingress.golden"}, {args: "network gateway create my-gateway --cloud aws --type private-network-interface --region us-west-2 --zones us-west-2a,us-west-2b", fixture: "network/gateway/create-aws-private-network-interface.golden"}, + {args: "network gateway create my-gcp-ingress-gateway --cloud gcp --type ingress-private-service-connect --region us-central1", fixture: "network/gateway/create-gcp-ingress.golden"}, {args: "network gateway update gw-111111 --name new-name", fixture: "network/gateway/update.golden"}, {args: "network gateway delete gw-12345", input: "y\n", fixture: "network/gateway/delete.golden"}, {args: "network gateway delete gw-12345 gw-54321", input: "y\n", fixture: "network/gateway/delete-multiple.golden"}, @@ -144,6 +145,7 @@ func (s *CLITestSuite) TestNetworkGatewayDescribe() { {args: "network gateway describe gw-88888", fixture: "network/gateway/describe-aws-ingress.golden"}, {args: "network gateway describe gw-13570", fixture: "network/gateway/describe-gcp-dns-peering.golden"}, {args: "network gateway describe gw-07531", fixture: "network/gateway/describe-gcp.golden"}, + {args: "network gateway describe gw-99999", fixture: "network/gateway/describe-gcp-ingress.golden"}, {args: "network gateway describe gw-67890", fixture: "network/gateway/describe-azure.golden"}, {args: "network gateway describe gw-12345 --output json", fixture: "network/gateway/describe-aws-json.golden"}, {args: "network gateway describe gw-88888 --output json", fixture: "network/gateway/describe-aws-ingress-json.golden"}, diff --git a/test/test-server/networking_handlers.go b/test/test-server/networking_handlers.go index 7c0552f67d..cf7812ffb4 100644 --- a/test/test-server/networking_handlers.go +++ b/test/test-server/networking_handlers.go @@ -14,7 +14,7 @@ import ( networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2/networking-access-point/v1" networkingdnsforwarderv1 "github.com/confluentinc/ccloud-sdk-go-v2/networking-dnsforwarder/v1" - networkinggatewayv1 "github.com/confluentinc/ccloud-sdk-go-v2/networking-gateway/v1" + networkinggatewayv1 "github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-gateway/v1" networkingipv1 "github.com/confluentinc/ccloud-sdk-go-v2/networking-ip/v1" networkingprivatelinkv1 "github.com/confluentinc/ccloud-sdk-go-v2/networking-privatelink/v1" networkingv1 "github.com/confluentinc/ccloud-sdk-go-v2/networking/v1" @@ -2386,6 +2386,11 @@ func getGateway(id, environment, name, specConfigKind, statusCloudGatewayKind st Kind: specConfigKind, Region: "eastus", })) + case "GcpIngressPrivateServiceConnectGatewaySpec": + gateway.Spec.SetConfig(networkinggatewayv1.NetworkingV1GcpIngressPrivateServiceConnectGatewaySpecAsNetworkingV1GatewaySpecConfigOneOf(&networkinggatewayv1.NetworkingV1GcpIngressPrivateServiceConnectGatewaySpec{ + Kind: specConfigKind, + Region: "us-central1", + })) case "GcpPeeringGatewaySpec": gateway.Spec.SetConfig(networkinggatewayv1.NetworkingV1GcpPeeringGatewaySpecAsNetworkingV1GatewaySpecConfigOneOf(&networkinggatewayv1.NetworkingV1GcpPeeringGatewaySpec{ Kind: specConfigKind, @@ -2419,6 +2424,11 @@ func getGateway(id, environment, name, specConfigKind, statusCloudGatewayKind st Kind: statusCloudGatewayKind, Project: networkinggatewayv1.PtrString("project-12345"), })) + case "GcpIngressPrivateServiceConnectGatewayStatus": + gateway.Status.SetCloudGateway(networkinggatewayv1.NetworkingV1GcpIngressPrivateServiceConnectGatewayStatusAsNetworkingV1GatewayStatusCloudGatewayOneOf(&networkinggatewayv1.NetworkingV1GcpIngressPrivateServiceConnectGatewayStatus{ + Kind: statusCloudGatewayKind, + PrivateServiceConnectServiceAttachment: networkinggatewayv1.PtrString("projects/traffic-prod/regions/us-central1/serviceAttachments/plattg-abc123-service-attachment"), + })) case "GcpPeeringGatewayStatus": gateway.Status.SetCloudGateway(networkinggatewayv1.NetworkingV1GcpPeeringGatewayStatusAsNetworkingV1GatewayStatusCloudGatewayOneOf(&networkinggatewayv1.NetworkingV1GcpPeeringGatewayStatus{ Kind: statusCloudGatewayKind, @@ -2460,6 +2470,10 @@ func handleNetworkingGatewayGet(t *testing.T, id, environment string) http.Handl record := getGateway(id, environment, "my-aws-ingress-gateway", "AwsIngressPrivateLinkGatewaySpec", "AwsIngressPrivateLinkGatewayStatus") err := json.NewEncoder(w).Encode(record) require.NoError(t, err) + case "gw-99999": + record := getGateway(id, environment, "my-gcp-ingress-gateway", "GcpIngressPrivateServiceConnectGatewaySpec", "GcpIngressPrivateServiceConnectGatewayStatus") + err := json.NewEncoder(w).Encode(record) + require.NoError(t, err) } } } @@ -2513,6 +2527,11 @@ func handleNetworkingGatewayPost(t *testing.T) http.HandlerFunc { Kind: "GcpEgressPrivateServiceConnectGatewayStatus", Project: networkingv1.PtrString("project-12345"), })) + } else if body.Spec.Config.NetworkingV1GcpIngressPrivateServiceConnectGatewaySpec != nil { + gateway.Status.SetCloudGateway(networkinggatewayv1.NetworkingV1GcpIngressPrivateServiceConnectGatewayStatusAsNetworkingV1GatewayStatusCloudGatewayOneOf(&networkinggatewayv1.NetworkingV1GcpIngressPrivateServiceConnectGatewayStatus{ + Kind: "GcpIngressPrivateServiceConnectGatewayStatus", + PrivateServiceConnectServiceAttachment: networkingv1.PtrString("projects/traffic-prod/regions/us-central1/serviceAttachments/plattg-abc123-service-attachment"), + })) } else if body.Spec.Config.NetworkingV1GcpPeeringGatewaySpec != nil { gateway.Status.SetCloudGateway(networkinggatewayv1.NetworkingV1GcpPeeringGatewayStatusAsNetworkingV1GatewayStatusCloudGatewayOneOf(&networkinggatewayv1.NetworkingV1GcpPeeringGatewayStatus{ Kind: "GcpPeeringGatewayStatus", @@ -2542,8 +2561,9 @@ func handleNetworkingGatewayList(t *testing.T, environment string) http.HandlerF gatewaySix := getGateway("gw-13570", environment, "my-gcp-peering-gateway", "GcpPeeringGatewaySpec", "GcpPeeringGatewayStatus") gatewaySeven := getGateway("gw-07531", environment, "my-gcp-gateway", "GcpEgressPrivateServiceConnectGatewaySpec", "GcpEgressPrivateServiceConnectGatewayStatus") gatewayEight := getGateway("gw-88888", environment, "my-aws-ingress-gateway", "AwsIngressPrivateLinkGatewaySpec", "AwsIngressPrivateLinkGatewayStatus") + gatewayNine := getGateway("gw-99999", environment, "my-gcp-ingress-gateway", "GcpIngressPrivateServiceConnectGatewaySpec", "GcpIngressPrivateServiceConnectGatewayStatus") - gatewayList := networkinggatewayv1.NetworkingV1GatewayList{Data: []networkinggatewayv1.NetworkingV1Gateway{gatewayOne, gatewayTwo, gatewayThree, gatewayFour, gatewayFive, gatewaySix, gatewaySeven, gatewayEight}} + gatewayList := networkinggatewayv1.NetworkingV1GatewayList{Data: []networkinggatewayv1.NetworkingV1Gateway{gatewayOne, gatewayTwo, gatewayThree, gatewayFour, gatewayFive, gatewaySix, gatewaySeven, gatewayEight, gatewayNine}} gatewayList.Data = filterGatewayList(gatewayList.Data, gatewayTypes, ids, regions, displayNames, phases) setPageToken(&gatewayList, &gatewayList.Metadata, r.URL) err := json.NewEncoder(w).Encode(gatewayList) @@ -2625,6 +2645,9 @@ func getGatewayTypeFromSpec(gateway networkinggatewayv1.NetworkingV1Gateway) str if config.NetworkingV1GcpEgressPrivateServiceConnectGatewaySpec != nil { return "GcpEgressPrivateServiceConnect" } + if config.NetworkingV1GcpIngressPrivateServiceConnectGatewaySpec != nil { + return "GcpIngressPrivateServiceConnect" + } return "" } @@ -2658,6 +2681,9 @@ func getRegionFromSpec(gateway networkinggatewayv1.NetworkingV1Gateway) string { if config.NetworkingV1GcpEgressPrivateServiceConnectGatewaySpec != nil { return config.NetworkingV1GcpEgressPrivateServiceConnectGatewaySpec.GetRegion() } + if config.NetworkingV1GcpIngressPrivateServiceConnectGatewaySpec != nil { + return config.NetworkingV1GcpIngressPrivateServiceConnectGatewaySpec.GetRegion() + } return "" } From 82df0f8b82e49228c1c76532485e2f49eae6e966 Mon Sep 17 00:00:00 2001 From: Elango Jagadeeesan Date: Tue, 10 Mar 2026 17:20:39 -0700 Subject: [PATCH 2/6] Add mock-test/ to .gitignore The mock-test/ directory contains a stateful gateway mock server and manual CLI tests intended for local development only. Co-Authored-By: Claude Sonnet 4.6 --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index e027360a76..5945b36f5b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ /dist/ /docs/ /legal/ +/mock-test/ /prebuilt/ /test/bin/ /test/coverage/ From ba0cc38fc6a9a76b9ab563f396276b93281e30de Mon Sep 17 00:00:00 2001 From: Elango Jagadeeesan Date: Sun, 15 Mar 2026 11:03:57 -0700 Subject: [PATCH 3/6] Add Azure and GCP ingress access point and gateway support - Switch networking-access-point SDK from public v0.8.0 to internal v0.12.0, which adds NetworkingV1AzureIngressPrivateLinkEndpoint and NetworkingV1GcpIngressPrivateServiceConnectEndpoint types - Add Azure ingress gateway type (ingress-privatelink) to gateway create/describe/list commands - Add --cloud azure/gcp support to ingress-endpoint create with --private-endpoint-resource-id (Azure) and --private-service-connect-connection-id (GCP) flags - Display Azure Private Link Service Alias/Resource IDs and GCP PSC Service Attachment/Connection ID in ingress-endpoint describe and list - Update autocomplete, test server handlers, and golden fixtures Co-Authored-By: Claude Sonnet 4.6 --- go.mod | 2 +- go.sum | 2 + ...cess_point_private_link_egress_endpoint.go | 2 +- ...int_private_link_egress_endpoint_create.go | 2 +- ...int_private_link_egress_endpoint_update.go | 2 +- ...ess_point_private_link_ingress_endpoint.go | 44 ++++-- ...nt_private_link_ingress_endpoint_create.go | 50 ++++++- ...oint_private_link_ingress_endpoint_list.go | 21 ++- ...nt_private_link_ingress_endpoint_update.go | 2 +- ..._access_point_private_network_interface.go | 2 +- ..._point_private_network_interface_create.go | 2 +- ..._point_private_network_interface_update.go | 2 +- internal/network/command_dns_record.go | 2 +- internal/network/command_dns_record_create.go | 2 +- internal/network/command_dns_record_update.go | 2 +- internal/network/command_gateway.go | 24 +++- internal/network/command_gateway_create.go | 11 ++ internal/network/command_gateway_list.go | 10 +- pkg/ccloudv2/client.go | 2 +- pkg/ccloudv2/networking_access_point.go | 12 +- .../ingress-endpoint/create-aws-name.golden | 1 + .../ingress-endpoint/create-aws.golden | 1 + .../ingress-endpoint/create-azure.golden | 11 ++ .../ingress-endpoint/create-gcp.golden | 10 ++ .../delete-autocomplete.golden | 3 + .../ingress-endpoint/delete-fail.golden | 1 + .../ingress-endpoint/delete-multiple.golden | 1 + .../ingress-endpoint/delete.golden | 1 + .../describe-autocomplete.golden | 3 + .../ingress-endpoint/describe-aws-json.golden | 1 + .../ingress-endpoint/describe-aws.golden | 1 + .../describe-azure-json.golden | 12 ++ .../ingress-endpoint/describe-azure.golden | 12 ++ .../ingress-endpoint/describe-gcp-json.golden | 11 ++ .../ingress-endpoint/describe-gcp.golden | 11 ++ .../ingress-endpoint/list-json.golden | 22 +++ .../private-link/ingress-endpoint/list.golden | 10 +- .../update-autocomplete.golden | 3 + .../ingress-endpoint/update-aws.golden | 1 + .../ingress-endpoint/update-azure.golden | 12 ++ .../ingress-endpoint/update-gcp.golden | 11 ++ .../gateway/create-azure-ingress.golden | 12 ++ .../delete-azure-ingress-multiple.golden | 2 + .../gateway/delete-azure-ingress.golden | 2 + .../gateway/describe-autocomplete.golden | 1 + .../gateway/describe-azure-ingress.golden | 12 ++ .../output/network/gateway/list-json.golden | 10 ++ .../output/network/gateway/list.golden | 24 ++-- test/network_test.go | 12 ++ test/test-server/networking_handlers.go | 128 +++++++++++++++++- 50 files changed, 485 insertions(+), 55 deletions(-) create mode 100644 test/fixtures/output/network/access-point/private-link/ingress-endpoint/create-azure.golden create mode 100644 test/fixtures/output/network/access-point/private-link/ingress-endpoint/create-gcp.golden create mode 100644 test/fixtures/output/network/access-point/private-link/ingress-endpoint/describe-azure-json.golden create mode 100644 test/fixtures/output/network/access-point/private-link/ingress-endpoint/describe-azure.golden create mode 100644 test/fixtures/output/network/access-point/private-link/ingress-endpoint/describe-gcp-json.golden create mode 100644 test/fixtures/output/network/access-point/private-link/ingress-endpoint/describe-gcp.golden create mode 100644 test/fixtures/output/network/access-point/private-link/ingress-endpoint/update-azure.golden create mode 100644 test/fixtures/output/network/access-point/private-link/ingress-endpoint/update-gcp.golden create mode 100644 test/fixtures/output/network/gateway/create-azure-ingress.golden create mode 100644 test/fixtures/output/network/gateway/delete-azure-ingress-multiple.golden create mode 100644 test/fixtures/output/network/gateway/delete-azure-ingress.golden create mode 100644 test/fixtures/output/network/gateway/describe-azure-ingress.golden diff --git a/go.mod b/go.mod index f68658fe73..7ee8471e3c 100644 --- a/go.mod +++ b/go.mod @@ -40,7 +40,7 @@ require ( github.com/confluentinc/ccloud-sdk-go-v2/mds v0.4.0 github.com/confluentinc/ccloud-sdk-go-v2/metrics v0.2.0 github.com/confluentinc/ccloud-sdk-go-v2/networking v0.14.0 - github.com/confluentinc/ccloud-sdk-go-v2/networking-access-point v0.8.0 + github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-access-point v0.12.0 github.com/confluentinc/ccloud-sdk-go-v2/networking-dnsforwarder v0.4.0 github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-gateway v0.12.0 github.com/confluentinc/ccloud-sdk-go-v2/networking-ip v0.2.0 diff --git a/go.sum b/go.sum index 74a48d1c95..201fd08e04 100644 --- a/go.sum +++ b/go.sum @@ -188,6 +188,8 @@ github.com/compose-spec/compose-go/v2 v2.1.3 h1:bD67uqLuL/XgkAK6ir3xZvNLFPxPScEi github.com/compose-spec/compose-go/v2 v2.1.3/go.mod h1:lFN0DrMxIncJGYAXTfWuajfwj5haBJqrBkarHcnjJKc= github.com/confluentinc/ccloud-sdk-go-v1-public v0.0.0-20250521223017-0e8f6f971b52 h1:19qEGhkbZa5fopKCe0VPIV+Sasby4Pv10z9ZaktwWso= github.com/confluentinc/ccloud-sdk-go-v1-public v0.0.0-20250521223017-0e8f6f971b52/go.mod h1:62EMf+5uFEt1BJ2q8WMrUoI9VUSxAbDnmZCGRt/MbA0= +github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-access-point v0.12.0 h1:eeJPL6TpJddJOwStebbW2Y2IYXJrNrLqe0u9EUaAGr4= +github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-access-point v0.12.0/go.mod h1:mFYZvHI92ChlfghLNpnXNxkwX33jEAUXQ5w0/Ri3OQY= github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-gateway v0.12.0 h1:xD/maPHZjgexJNsXu0zmeU1CXUXPlmnCDUK+t/ighw0= github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-gateway v0.12.0/go.mod h1:Nq00w3h+2vpEi+8w1f+lgmNu5m3mHogOzpw8/JzUL6k= github.com/confluentinc/ccloud-sdk-go-v2/ai v0.1.0 h1:zSF4OQUJXWH2JeAo9rsq13ibk+JFdzITGR8S7cFMpzw= diff --git a/internal/network/command_access_point_private_link_egress_endpoint.go b/internal/network/command_access_point_private_link_egress_endpoint.go index 7c2bab6a14..dd098c950f 100644 --- a/internal/network/command_access_point_private_link_egress_endpoint.go +++ b/internal/network/command_access_point_private_link_egress_endpoint.go @@ -6,7 +6,7 @@ import ( "github.com/spf13/cobra" - networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2/networking-access-point/v1" + networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-access-point/v1" "github.com/confluentinc/cli/v4/pkg/errors" "github.com/confluentinc/cli/v4/pkg/output" diff --git a/internal/network/command_access_point_private_link_egress_endpoint_create.go b/internal/network/command_access_point_private_link_egress_endpoint_create.go index 2e5c7af7dd..edeeb3e2bb 100644 --- a/internal/network/command_access_point_private_link_egress_endpoint_create.go +++ b/internal/network/command_access_point_private_link_egress_endpoint_create.go @@ -5,7 +5,7 @@ import ( "github.com/spf13/cobra" - networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2/networking-access-point/v1" + networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-access-point/v1" pcloud "github.com/confluentinc/cli/v4/pkg/cloud" pcmd "github.com/confluentinc/cli/v4/pkg/cmd" diff --git a/internal/network/command_access_point_private_link_egress_endpoint_update.go b/internal/network/command_access_point_private_link_egress_endpoint_update.go index 40e036b8ac..0a1c2b6be8 100644 --- a/internal/network/command_access_point_private_link_egress_endpoint_update.go +++ b/internal/network/command_access_point_private_link_egress_endpoint_update.go @@ -3,7 +3,7 @@ package network import ( "github.com/spf13/cobra" - networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2/networking-access-point/v1" + networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-access-point/v1" pcmd "github.com/confluentinc/cli/v4/pkg/cmd" "github.com/confluentinc/cli/v4/pkg/examples" diff --git a/internal/network/command_access_point_private_link_ingress_endpoint.go b/internal/network/command_access_point_private_link_ingress_endpoint.go index 5fd2474c45..5d246e08c8 100644 --- a/internal/network/command_access_point_private_link_ingress_endpoint.go +++ b/internal/network/command_access_point_private_link_ingress_endpoint.go @@ -6,7 +6,7 @@ import ( "github.com/spf13/cobra" - networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2/networking-access-point/v1" + networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-access-point/v1" "github.com/confluentinc/cli/v4/pkg/config" "github.com/confluentinc/cli/v4/pkg/errors" @@ -15,14 +15,19 @@ import ( ) type ingressEndpointOut struct { - Id string `human:"ID" serialized:"id"` - Name string `human:"Name,omitempty" serialized:"name,omitempty"` - Environment string `human:"Environment" serialized:"environment"` - Gateway string `human:"Gateway" serialized:"gateway"` - Phase string `human:"Phase" serialized:"phase"` - AwsVpcEndpointId string `human:"AWS VPC Endpoint ID,omitempty" serialized:"aws_vpc_endpoint_id,omitempty"` - AwsVpcEndpointServiceName string `human:"AWS VPC Endpoint Service Name,omitempty" serialized:"aws_vpc_endpoint_service_name,omitempty"` - DnsDomain string `human:"DNS Domain,omitempty" serialized:"dns_domain,omitempty"` + Id string `human:"ID" serialized:"id"` + Name string `human:"Name,omitempty" serialized:"name,omitempty"` + Environment string `human:"Environment" serialized:"environment"` + Gateway string `human:"Gateway" serialized:"gateway"` + Phase string `human:"Phase" serialized:"phase"` + AwsVpcEndpointId string `human:"AWS VPC Endpoint ID,omitempty" serialized:"aws_vpc_endpoint_id,omitempty"` + AwsVpcEndpointServiceName string `human:"AWS VPC Endpoint Service Name,omitempty" serialized:"aws_vpc_endpoint_service_name,omitempty"` + AzurePrivateLinkServiceAlias string `human:"Azure Private Link Service Alias,omitempty" serialized:"azure_private_link_service_alias,omitempty"` + AzurePrivateLinkServiceResourceId string `human:"Azure Private Link Service Resource ID,omitempty" serialized:"azure_private_link_service_resource_id,omitempty"` + AzurePrivateEndpointResourceId string `human:"Azure Private Endpoint Resource ID,omitempty" serialized:"azure_private_endpoint_resource_id,omitempty"` + GcpPrivateServiceConnectServiceAttachment string `human:"GCP PSC Service Attachment,omitempty" serialized:"gcp_private_service_connect_service_attachment,omitempty"` + GcpPrivateServiceConnectConnectionId string `human:"GCP PSC Connection ID,omitempty" serialized:"gcp_private_service_connect_connection_id,omitempty"` + DnsDomain string `human:"DNS Domain,omitempty" serialized:"dns_domain,omitempty"` } func (c *accessPointCommand) newIngressEndpointCommand(cfg *config.Config) *cobra.Command { @@ -68,7 +73,9 @@ func (c *accessPointCommand) autocompleteIngressEndpoints() []string { return nil } ingressEndpoints := slices.DeleteFunc(accessPoints, func(accessPoint networkingaccesspointv1.NetworkingV1AccessPoint) bool { - return accessPoint.Spec.GetConfig().NetworkingV1AwsIngressPrivateLinkEndpoint == nil + return accessPoint.Spec.GetConfig().NetworkingV1AwsIngressPrivateLinkEndpoint == nil && + accessPoint.Spec.GetConfig().NetworkingV1AzureIngressPrivateLinkEndpoint == nil && + accessPoint.Spec.GetConfig().NetworkingV1GcpIngressPrivateServiceConnectEndpoint == nil }) suggestions := make([]string, len(ingressEndpoints)) @@ -102,6 +109,23 @@ func printPrivateLinkIngressEndpointTable(cmd *cobra.Command, ingressEndpoint ne } } + if ingressEndpoint.Status.Config != nil && ingressEndpoint.Status.Config.NetworkingV1AzureIngressPrivateLinkEndpointStatus != nil { + out.AzurePrivateLinkServiceAlias = ingressEndpoint.Status.Config.NetworkingV1AzureIngressPrivateLinkEndpointStatus.GetPrivateLinkServiceAlias() + out.AzurePrivateLinkServiceResourceId = ingressEndpoint.Status.Config.NetworkingV1AzureIngressPrivateLinkEndpointStatus.GetPrivateLinkServiceResourceId() + out.AzurePrivateEndpointResourceId = ingressEndpoint.Status.Config.NetworkingV1AzureIngressPrivateLinkEndpointStatus.GetPrivateEndpointResourceId() + if ingressEndpoint.Status.Config.NetworkingV1AzureIngressPrivateLinkEndpointStatus.HasDnsDomain() { + out.DnsDomain = ingressEndpoint.Status.Config.NetworkingV1AzureIngressPrivateLinkEndpointStatus.GetDnsDomain() + } + } + + if ingressEndpoint.Status.Config != nil && ingressEndpoint.Status.Config.NetworkingV1GcpIngressPrivateServiceConnectEndpointStatus != nil { + out.GcpPrivateServiceConnectServiceAttachment = ingressEndpoint.Status.Config.NetworkingV1GcpIngressPrivateServiceConnectEndpointStatus.GetPrivateServiceConnectServiceAttachment() + out.GcpPrivateServiceConnectConnectionId = ingressEndpoint.Status.Config.NetworkingV1GcpIngressPrivateServiceConnectEndpointStatus.GetPrivateServiceConnectConnectionId() + if ingressEndpoint.Status.Config.NetworkingV1GcpIngressPrivateServiceConnectEndpointStatus.HasDnsDomain() { + out.DnsDomain = ingressEndpoint.Status.Config.NetworkingV1GcpIngressPrivateServiceConnectEndpointStatus.GetDnsDomain() + } + } + table := output.NewTable(cmd) table.Add(out) return table.PrintWithAutoWrap(false) diff --git a/internal/network/command_access_point_private_link_ingress_endpoint_create.go b/internal/network/command_access_point_private_link_ingress_endpoint_create.go index ea372f8924..60c3a642f7 100644 --- a/internal/network/command_access_point_private_link_ingress_endpoint_create.go +++ b/internal/network/command_access_point_private_link_ingress_endpoint_create.go @@ -6,7 +6,7 @@ import ( "github.com/spf13/cobra" - networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2/networking-access-point/v1" + networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-access-point/v1" pcloud "github.com/confluentinc/cli/v4/pkg/cloud" pcmd "github.com/confluentinc/cli/v4/pkg/cmd" @@ -24,11 +24,21 @@ func (c *accessPointCommand) newIngressEndpointCreateCommand() *cobra.Command { Text: "Create an AWS PrivateLink ingress endpoint.", Code: "confluent network access-point private-link ingress-endpoint create --cloud aws --gateway gw-123456 --vpc-endpoint-id vpce-00000000000000000", }, + examples.Example{ + Text: "Create an Azure Private Link ingress endpoint.", + Code: "confluent network access-point private-link ingress-endpoint create --cloud azure --gateway gw-123456 --private-endpoint-resource-id /subscriptions/0000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/privateEndpoints/privateEndpointName", + }, + examples.Example{ + Text: "Create a GCP Private Service Connect ingress endpoint.", + Code: "confluent network access-point private-link ingress-endpoint create --cloud gcp --gateway gw-123456 --private-service-connect-connection-id 111111111111111111", + }, ), } - pcmd.AddCloudAwsFlag(cmd) + pcmd.AddCloudFlag(cmd) cmd.Flags().String("vpc-endpoint-id", "", "ID of an AWS VPC endpoint.") + cmd.Flags().String("private-endpoint-resource-id", "", "Resource ID of an Azure Private Endpoint.") + cmd.Flags().String("private-service-connect-connection-id", "", "ID of a GCP Private Service Connect connection.") addGatewayFlag(cmd, c.AuthenticatedCLICommand) pcmd.AddContextFlag(cmd, c.CLICommand) pcmd.AddEnvironmentFlag(cmd, c.AuthenticatedCLICommand) @@ -36,7 +46,6 @@ func (c *accessPointCommand) newIngressEndpointCreateCommand() *cobra.Command { cobra.CheckErr(cmd.MarkFlagRequired("cloud")) cobra.CheckErr(cmd.MarkFlagRequired("gateway")) - cobra.CheckErr(cmd.MarkFlagRequired("vpc-endpoint-id")) return cmd } @@ -63,6 +72,16 @@ func (c *accessPointCommand) createIngressEndpoint(cmd *cobra.Command, args []st return err } + privateEndpointResourceId, err := cmd.Flags().GetString("private-endpoint-resource-id") + if err != nil { + return err + } + + privateServiceConnectConnectionId, err := cmd.Flags().GetString("private-service-connect-connection-id") + if err != nil { + return err + } + environmentId, err := c.Context.EnvironmentId() if err != nil { return err @@ -81,14 +100,37 @@ func (c *accessPointCommand) createIngressEndpoint(cmd *cobra.Command, args []st switch cloud { case pcloud.Aws: + if vpcEndpointId == "" { + return fmt.Errorf("flag \"vpc-endpoint-id\" is required for AWS ingress endpoints") + } createIngressEndpoint.Spec.Config = &networkingaccesspointv1.NetworkingV1AccessPointSpecConfigOneOf{ NetworkingV1AwsIngressPrivateLinkEndpoint: &networkingaccesspointv1.NetworkingV1AwsIngressPrivateLinkEndpoint{ Kind: "AwsIngressPrivateLinkEndpoint", VpcEndpointId: vpcEndpointId, }, } + case pcloud.Azure: + if privateEndpointResourceId == "" { + return fmt.Errorf("flag \"private-endpoint-resource-id\" is required for Azure ingress endpoints") + } + createIngressEndpoint.Spec.Config = &networkingaccesspointv1.NetworkingV1AccessPointSpecConfigOneOf{ + NetworkingV1AzureIngressPrivateLinkEndpoint: &networkingaccesspointv1.NetworkingV1AzureIngressPrivateLinkEndpoint{ + Kind: "AzureIngressPrivateLinkEndpoint", + PrivateEndpointResourceId: privateEndpointResourceId, + }, + } + case pcloud.Gcp: + if privateServiceConnectConnectionId == "" { + return fmt.Errorf("flag \"private-service-connect-connection-id\" is required for GCP ingress endpoints") + } + createIngressEndpoint.Spec.Config = &networkingaccesspointv1.NetworkingV1AccessPointSpecConfigOneOf{ + NetworkingV1GcpIngressPrivateServiceConnectEndpoint: &networkingaccesspointv1.NetworkingV1GcpIngressPrivateServiceConnectEndpoint{ + Kind: "GcpIngressPrivateServiceConnectEndpoint", + PrivateServiceConnectConnectionId: privateServiceConnectConnectionId, + }, + } default: - return fmt.Errorf("ingress endpoints are only supported for AWS") + return fmt.Errorf("ingress endpoints are only supported for AWS, Azure, and GCP") } ingressEndpoint, err := c.V2Client.CreateAccessPoint(createIngressEndpoint) diff --git a/internal/network/command_access_point_private_link_ingress_endpoint_list.go b/internal/network/command_access_point_private_link_ingress_endpoint_list.go index fd73a90efd..763993dcde 100644 --- a/internal/network/command_access_point_private_link_ingress_endpoint_list.go +++ b/internal/network/command_access_point_private_link_ingress_endpoint_list.go @@ -47,7 +47,9 @@ func (c *accessPointCommand) listIngressEndpoint(cmd *cobra.Command, _ []string) if ingressEndpoint.Spec == nil { return fmt.Errorf(errors.CorruptedNetworkResponseErrorMsg, "spec") } - if ingressEndpoint.Spec.GetConfig().NetworkingV1AwsIngressPrivateLinkEndpoint == nil { + if ingressEndpoint.Spec.GetConfig().NetworkingV1AwsIngressPrivateLinkEndpoint == nil && + ingressEndpoint.Spec.GetConfig().NetworkingV1AzureIngressPrivateLinkEndpoint == nil && + ingressEndpoint.Spec.GetConfig().NetworkingV1GcpIngressPrivateServiceConnectEndpoint == nil { continue } if ingressEndpoint.Status == nil { @@ -70,6 +72,23 @@ func (c *accessPointCommand) listIngressEndpoint(cmd *cobra.Command, _ []string) } } + if ingressEndpoint.Status.Config != nil && ingressEndpoint.Status.Config.NetworkingV1AzureIngressPrivateLinkEndpointStatus != nil { + out.AzurePrivateLinkServiceAlias = ingressEndpoint.Status.Config.NetworkingV1AzureIngressPrivateLinkEndpointStatus.GetPrivateLinkServiceAlias() + out.AzurePrivateLinkServiceResourceId = ingressEndpoint.Status.Config.NetworkingV1AzureIngressPrivateLinkEndpointStatus.GetPrivateLinkServiceResourceId() + out.AzurePrivateEndpointResourceId = ingressEndpoint.Status.Config.NetworkingV1AzureIngressPrivateLinkEndpointStatus.GetPrivateEndpointResourceId() + if ingressEndpoint.Status.Config.NetworkingV1AzureIngressPrivateLinkEndpointStatus.HasDnsDomain() { + out.DnsDomain = ingressEndpoint.Status.Config.NetworkingV1AzureIngressPrivateLinkEndpointStatus.GetDnsDomain() + } + } + + if ingressEndpoint.Status.Config != nil && ingressEndpoint.Status.Config.NetworkingV1GcpIngressPrivateServiceConnectEndpointStatus != nil { + out.GcpPrivateServiceConnectServiceAttachment = ingressEndpoint.Status.Config.NetworkingV1GcpIngressPrivateServiceConnectEndpointStatus.GetPrivateServiceConnectServiceAttachment() + out.GcpPrivateServiceConnectConnectionId = ingressEndpoint.Status.Config.NetworkingV1GcpIngressPrivateServiceConnectEndpointStatus.GetPrivateServiceConnectConnectionId() + if ingressEndpoint.Status.Config.NetworkingV1GcpIngressPrivateServiceConnectEndpointStatus.HasDnsDomain() { + out.DnsDomain = ingressEndpoint.Status.Config.NetworkingV1GcpIngressPrivateServiceConnectEndpointStatus.GetDnsDomain() + } + } + list.Add(out) } diff --git a/internal/network/command_access_point_private_link_ingress_endpoint_update.go b/internal/network/command_access_point_private_link_ingress_endpoint_update.go index 57e18169d5..ad7b1f1cc4 100644 --- a/internal/network/command_access_point_private_link_ingress_endpoint_update.go +++ b/internal/network/command_access_point_private_link_ingress_endpoint_update.go @@ -3,7 +3,7 @@ package network import ( "github.com/spf13/cobra" - networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2/networking-access-point/v1" + networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-access-point/v1" pcmd "github.com/confluentinc/cli/v4/pkg/cmd" "github.com/confluentinc/cli/v4/pkg/examples" diff --git a/internal/network/command_access_point_private_network_interface.go b/internal/network/command_access_point_private_network_interface.go index 32d8a1ff8a..41dfb6aefa 100644 --- a/internal/network/command_access_point_private_network_interface.go +++ b/internal/network/command_access_point_private_network_interface.go @@ -6,7 +6,7 @@ import ( "github.com/spf13/cobra" - networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2/networking-access-point/v1" + networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-access-point/v1" "github.com/confluentinc/cli/v4/pkg/errors" "github.com/confluentinc/cli/v4/pkg/output" diff --git a/internal/network/command_access_point_private_network_interface_create.go b/internal/network/command_access_point_private_network_interface_create.go index 0e0865ca3a..587888e03d 100644 --- a/internal/network/command_access_point_private_network_interface_create.go +++ b/internal/network/command_access_point_private_network_interface_create.go @@ -6,7 +6,7 @@ import ( "github.com/spf13/cobra" - networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2/networking-access-point/v1" + networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-access-point/v1" pcloud "github.com/confluentinc/cli/v4/pkg/cloud" pcmd "github.com/confluentinc/cli/v4/pkg/cmd" diff --git a/internal/network/command_access_point_private_network_interface_update.go b/internal/network/command_access_point_private_network_interface_update.go index 704ef83e71..ce859c53ab 100644 --- a/internal/network/command_access_point_private_network_interface_update.go +++ b/internal/network/command_access_point_private_network_interface_update.go @@ -3,7 +3,7 @@ package network import ( "github.com/spf13/cobra" - networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2/networking-access-point/v1" + networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-access-point/v1" pcmd "github.com/confluentinc/cli/v4/pkg/cmd" "github.com/confluentinc/cli/v4/pkg/examples" diff --git a/internal/network/command_dns_record.go b/internal/network/command_dns_record.go index 89cdf7e376..64d88f0c8b 100644 --- a/internal/network/command_dns_record.go +++ b/internal/network/command_dns_record.go @@ -5,7 +5,7 @@ import ( "github.com/spf13/cobra" - networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2/networking-access-point/v1" + networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-access-point/v1" "github.com/confluentinc/cli/v4/pkg/ccloudv2" pcmd "github.com/confluentinc/cli/v4/pkg/cmd" diff --git a/internal/network/command_dns_record_create.go b/internal/network/command_dns_record_create.go index 15902043ab..834443e055 100644 --- a/internal/network/command_dns_record_create.go +++ b/internal/network/command_dns_record_create.go @@ -3,7 +3,7 @@ package network import ( "github.com/spf13/cobra" - networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2/networking-access-point/v1" + networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-access-point/v1" pcmd "github.com/confluentinc/cli/v4/pkg/cmd" "github.com/confluentinc/cli/v4/pkg/examples" diff --git a/internal/network/command_dns_record_update.go b/internal/network/command_dns_record_update.go index b44d23f5a0..5fde1db00c 100644 --- a/internal/network/command_dns_record_update.go +++ b/internal/network/command_dns_record_update.go @@ -3,7 +3,7 @@ package network import ( "github.com/spf13/cobra" - networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2/networking-access-point/v1" + networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-access-point/v1" pcmd "github.com/confluentinc/cli/v4/pkg/cmd" "github.com/confluentinc/cli/v4/pkg/examples" diff --git a/internal/network/command_gateway.go b/internal/network/command_gateway.go index 0cc72f248e..361d2c2e59 100644 --- a/internal/network/command_gateway.go +++ b/internal/network/command_gateway.go @@ -26,15 +26,17 @@ const ( gcpPeering = "GcpPeering" gcpEgressPrivateServiceConnect = "GcpEgressPrivateServiceConnect" gcpIngressPrivateServiceConnect = "GcpIngressPrivateServiceConnect" + azureIngressPrivateLink = "AzureIngressPrivateLink" ) var ( createGatewayTypes = []string{"egress-privatelink", "ingress-privatelink", "private-network-interface", "ingress-private-service-connect"} - listGatewayTypes = []string{"aws-egress-privatelink", "aws-ingress-privatelink", "azure-egress-privatelink", "gcp-egress-private-service-connect", "gcp-ingress-private-service-connect"} // TODO: check if we accept private-network-interface here + listGatewayTypes = []string{"aws-egress-privatelink", "aws-ingress-privatelink", "azure-egress-privatelink", "azure-ingress-privatelink", "gcp-egress-private-service-connect", "gcp-ingress-private-service-connect"} // TODO: check if we accept private-network-interface here gatewayTypeMap = map[string]string{ "aws-egress-privatelink": awsEgressPrivateLink, "aws-ingress-privatelink": awsIngressPrivateLink, "azure-egress-privatelink": azureEgressPrivateLink, + "azure-ingress-privatelink": azureIngressPrivateLink, "gcp-egress-private-service-connect": gcpEgressPrivateServiceConnect, "gcp-ingress-private-service-connect": gcpIngressPrivateServiceConnect, } @@ -48,7 +50,9 @@ type gatewayOut struct { Type string `human:"Type,omitempty" serialized:"type,omitempty"` AwsPrincipalArn string `human:"AWS Principal ARN,omitempty" serialized:"aws_principal_arn,omitempty"` VpcEndpointServiceName string `human:"VPC Endpoint Service Name,omitempty" serialized:"vpc_endpoint_service_name,omitempty"` - AzureSubscription string `human:"Azure Subscription,omitempty" serialized:"azure_subscription,omitempty"` + AzureSubscription string `human:"Azure Subscription,omitempty" serialized:"azure_subscription,omitempty"` + AzurePrivateLinkServiceAlias string `human:"Azure Private Link Service Alias,omitempty" serialized:"azure_private_link_service_alias,omitempty"` + AzurePrivateLinkServiceResourceId string `human:"Azure Private Link Resource ID,omitempty" serialized:"azure_private_link_service_resource_id,omitempty"` GcpIamPrincipal string `human:"GCP IAM Principal,omitempty" serialized:"gcp_iam_principal,omitempty"` GcpProject string `human:"GCP Project,omitempty" serialized:"gcp_project,omitempty"` GcpPrivateServiceConnectServiceAttachment string `human:"GCP PSC Service Attachment,omitempty" serialized:"gcp_private_service_connect_service_attachment,omitempty"` @@ -140,7 +144,7 @@ func getGatewayCloud(gateway networkinggatewayv1.NetworkingV1Gateway) string { return pcloud.Aws } - if cloud.NetworkingV1AzureEgressPrivateLinkGatewayStatus != nil { + if cloud.NetworkingV1AzureEgressPrivateLinkGatewayStatus != nil || cloud.NetworkingV1AzureIngressPrivateLinkGatewayStatus != nil { return pcloud.Azure } @@ -178,6 +182,10 @@ func getGatewayType(gateway networkinggatewayv1.NetworkingV1Gateway) (string, er return azureEgressPrivateLink, nil } + if config.NetworkingV1AzureIngressPrivateLinkGatewaySpec != nil { + return azureIngressPrivateLink, nil + } + if config.NetworkingV1AwsPeeringGatewaySpec != nil { return awsPeering, nil } @@ -235,6 +243,9 @@ func printGatewayTable(cmd *cobra.Command, gateway networkinggatewayv1.Networkin if gatewayType == azureEgressPrivateLink { out.Region = gateway.Spec.Config.NetworkingV1AzureEgressPrivateLinkGatewaySpec.GetRegion() } + if gatewayType == azureIngressPrivateLink { + out.Region = gateway.Spec.Config.NetworkingV1AzureIngressPrivateLinkGatewaySpec.GetRegion() + } if gatewayType == azurePeering { out.Region = gateway.Spec.Config.NetworkingV1AzurePeeringGatewaySpec.GetRegion() } @@ -262,7 +273,12 @@ func printGatewayTable(cmd *cobra.Command, gateway networkinggatewayv1.Networkin out.Account = gateway.Status.CloudGateway.NetworkingV1AwsPrivateNetworkInterfaceGatewayStatus.GetAccount() } case pcloud.Azure: - out.AzureSubscription = gateway.Status.CloudGateway.NetworkingV1AzureEgressPrivateLinkGatewayStatus.GetSubscription() + if gatewayType == azureEgressPrivateLink { + out.AzureSubscription = gateway.Status.CloudGateway.NetworkingV1AzureEgressPrivateLinkGatewayStatus.GetSubscription() + } else if gatewayType == azureIngressPrivateLink { + out.AzurePrivateLinkServiceAlias = gateway.Status.CloudGateway.NetworkingV1AzureIngressPrivateLinkGatewayStatus.GetPrivateLinkServiceAlias() + out.AzurePrivateLinkServiceResourceId = gateway.Status.CloudGateway.NetworkingV1AzureIngressPrivateLinkGatewayStatus.GetPrivateLinkServiceResourceId() + } case pcloud.Gcp: if gatewayType == gcpEgressPrivateServiceConnect { out.GcpProject = gateway.Status.CloudGateway.NetworkingV1GcpEgressPrivateServiceConnectGatewayStatus.GetProject() diff --git a/internal/network/command_gateway_create.go b/internal/network/command_gateway_create.go index fbcbbe15d1..8f9321e5c8 100644 --- a/internal/network/command_gateway_create.go +++ b/internal/network/command_gateway_create.go @@ -31,6 +31,10 @@ func (c *command) newGatewayCreateCommand() *cobra.Command { Text: `Create AWS private network interface gateway "my-pni-gateway".`, Code: "confluent network gateway create my-pni-gateway --cloud aws --region us-east-1 --type private-network-interface", }, + examples.Example{ + Text: `Create Azure ingress private link gateway "my-azure-ingress-gateway".`, + Code: "confluent network gateway create my-azure-ingress-gateway --cloud azure --region eastus2 --type ingress-privatelink", + }, examples.Example{ Text: `Create GCP ingress private service connect gateway "my-gcp-ingress-gateway".`, Code: "confluent network gateway create my-gcp-ingress-gateway --cloud gcp --region us-central1 --type ingress-private-service-connect", @@ -119,6 +123,13 @@ func (c *command) gatewayCreate(cmd *cobra.Command, args []string) error { Region: region, }, } + } else if gatewayType == "ingress-privatelink" { + createGateway.Spec.Config = &networkinggatewayv1.NetworkingV1GatewaySpecConfigOneOf{ + NetworkingV1AzureIngressPrivateLinkGatewaySpec: &networkinggatewayv1.NetworkingV1AzureIngressPrivateLinkGatewaySpec{ + Kind: "AzureIngressPrivateLinkGatewaySpec", + Region: region, + }, + } } case pcloud.Gcp: if gatewayType == "ingress-private-service-connect" { diff --git a/internal/network/command_gateway_list.go b/internal/network/command_gateway_list.go index a381e6f2ae..f7fdf0dc6a 100644 --- a/internal/network/command_gateway_list.go +++ b/internal/network/command_gateway_list.go @@ -118,6 +118,9 @@ func (c *command) gatewayList(cmd *cobra.Command, _ []string) error { if gatewayType == azureEgressPrivateLink { out.Region = gateway.Spec.Config.NetworkingV1AzureEgressPrivateLinkGatewaySpec.GetRegion() } + if gatewayType == azureIngressPrivateLink { + out.Region = gateway.Spec.Config.NetworkingV1AzureIngressPrivateLinkGatewaySpec.GetRegion() + } if gatewayType == azurePeering { out.Region = gateway.Spec.Config.NetworkingV1AzurePeeringGatewaySpec.GetRegion() } @@ -145,7 +148,12 @@ func (c *command) gatewayList(cmd *cobra.Command, _ []string) error { out.Account = gateway.Status.CloudGateway.NetworkingV1AwsPrivateNetworkInterfaceGatewayStatus.GetAccount() } case pcloud.Azure: - out.AzureSubscription = gateway.Status.CloudGateway.NetworkingV1AzureEgressPrivateLinkGatewayStatus.GetSubscription() + if gatewayType == azureEgressPrivateLink { + out.AzureSubscription = gateway.Status.CloudGateway.NetworkingV1AzureEgressPrivateLinkGatewayStatus.GetSubscription() + } else if gatewayType == azureIngressPrivateLink { + out.AzurePrivateLinkServiceAlias = gateway.Status.CloudGateway.NetworkingV1AzureIngressPrivateLinkGatewayStatus.GetPrivateLinkServiceAlias() + out.AzurePrivateLinkServiceResourceId = gateway.Status.CloudGateway.NetworkingV1AzureIngressPrivateLinkGatewayStatus.GetPrivateLinkServiceResourceId() + } case pcloud.Gcp: if gatewayType == gcpEgressPrivateServiceConnect { out.GcpProject = gateway.Status.CloudGateway.NetworkingV1GcpEgressPrivateServiceConnectGatewayStatus.GetProject() diff --git a/pkg/ccloudv2/client.go b/pkg/ccloudv2/client.go index 8c21468491..998f29be55 100644 --- a/pkg/ccloudv2/client.go +++ b/pkg/ccloudv2/client.go @@ -22,7 +22,7 @@ import ( kafkaquotasv1 "github.com/confluentinc/ccloud-sdk-go-v2/kafka-quotas/v1" ksqlv2 "github.com/confluentinc/ccloud-sdk-go-v2/ksql/v2" mdsv2 "github.com/confluentinc/ccloud-sdk-go-v2/mds/v2" - networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2/networking-access-point/v1" + networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-access-point/v1" networkingdnsforwarderv1 "github.com/confluentinc/ccloud-sdk-go-v2/networking-dnsforwarder/v1" networkinggatewayv1 "github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-gateway/v1" networkingipv1 "github.com/confluentinc/ccloud-sdk-go-v2/networking-ip/v1" diff --git a/pkg/ccloudv2/networking_access_point.go b/pkg/ccloudv2/networking_access_point.go index 41d49a2536..5801b4550b 100644 --- a/pkg/ccloudv2/networking_access_point.go +++ b/pkg/ccloudv2/networking_access_point.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2/networking-access-point/v1" + networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-access-point/v1" "github.com/confluentinc/cli/v4/pkg/errors" ) @@ -57,7 +57,7 @@ func (c *Client) executeListAccessPoints(environment, pageToken string, names [] } if names != nil { - req = req.SpecDisplayName(names) + req = req.SpecDisplayName(networkingaccesspointv1.MultipleSearchFilter{Items: names}) } resp, httpResp, err := req.Execute() @@ -111,19 +111,19 @@ func (c *Client) executeListDnsRecords(environment, pageToken string, listParame } if listParameters.Gateways != nil { - req = req.SpecGateway(listParameters.Gateways) + req = req.SpecGateway(networkingaccesspointv1.MultipleSearchFilter{Items: listParameters.Gateways}) } if listParameters.Domains != nil { - req = req.SpecDomain(listParameters.Domains) + req = req.SpecDomain(networkingaccesspointv1.MultipleSearchFilter{Items: listParameters.Domains}) } if listParameters.Names != nil { - req = req.SpecDisplayName(listParameters.Names) + req = req.SpecDisplayName(networkingaccesspointv1.MultipleSearchFilter{Items: listParameters.Names}) } if listParameters.ResourceIds != nil { - req = req.Resource(listParameters.ResourceIds) + req = req.Resource(networkingaccesspointv1.MultipleSearchFilter{Items: listParameters.ResourceIds}) } resp, httpResp, err := req.Execute() diff --git a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/create-aws-name.golden b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/create-aws-name.golden index 2e076e4d05..527f8d985f 100644 --- a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/create-aws-name.golden +++ b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/create-aws-name.golden @@ -1,3 +1,4 @@ +warning: GOCOVERDIR not set, no coverage data emitted +-------------------------------+---------------------------------------------------------+ | ID | ap-99999 | | Name | my-ingress-endpoint | diff --git a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/create-aws.golden b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/create-aws.golden index 8de2886b3f..6ea455b0b1 100644 --- a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/create-aws.golden +++ b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/create-aws.golden @@ -1,3 +1,4 @@ +warning: GOCOVERDIR not set, no coverage data emitted +-------------------------------+---------------------------------------------------------+ | ID | ap-99999 | | Environment | env-596 | diff --git a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/create-azure.golden b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/create-azure.golden new file mode 100644 index 0000000000..2e6c31502f --- /dev/null +++ b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/create-azure.golden @@ -0,0 +1,11 @@ +warning: GOCOVERDIR not set, no coverage data emitted ++----------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ +| ID | ap-11111 | +| Environment | env-596 | +| Gateway | gw-11111 | +| Phase | READY | +| Azure Private Link Service Alias | azure-pls-alias.eastus.azure.privatelinkservice | +| Azure Private Link Service Resource ID | /subscriptions/0000000/resourceGroups/plsRgName/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName | +| Azure Private Endpoint Resource ID | /subscriptions/0000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/privateEndpoints/privateEndpointName | +| DNS Domain | ap11111.eastus.azure.accesspoint.confluent.cloud | ++----------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ diff --git a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/create-gcp.golden b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/create-gcp.golden new file mode 100644 index 0000000000..d6cf36a639 --- /dev/null +++ b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/create-gcp.golden @@ -0,0 +1,10 @@ +warning: GOCOVERDIR not set, no coverage data emitted ++----------------------------+-----------------------------------------------------------------------------------+ +| ID | ap-22222 | +| Environment | env-596 | +| Gateway | gw-99999 | +| Phase | READY | +| GCP PSC Service Attachment | projects/projectName/regions/us-central1/serviceAttachments/serviceAttachmentName | +| GCP PSC Connection ID | 111111111111111111 | +| DNS Domain | ap22222.us-central1.gcp.accesspoint.confluent.cloud | ++----------------------------+-----------------------------------------------------------------------------------+ diff --git a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/delete-autocomplete.golden b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/delete-autocomplete.golden index ef273e8c24..608515e2f6 100644 --- a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/delete-autocomplete.golden +++ b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/delete-autocomplete.golden @@ -1,3 +1,6 @@ +warning: GOCOVERDIR not set, no coverage data emitted ap-99999 my-aws-ingress-access-point +ap-11111 my-azure-ingress-access-point +ap-22222 my-gcp-ingress-access-point :4 Completion ended with directive: ShellCompDirectiveNoFileComp diff --git a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/delete-fail.golden b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/delete-fail.golden index 0bca0ce739..a7dd241aa8 100644 --- a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/delete-fail.golden +++ b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/delete-fail.golden @@ -1,3 +1,4 @@ +warning: GOCOVERDIR not set, no coverage data emitted Error: access point "ap-invalid" not found Suggestions: diff --git a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/delete-multiple.golden b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/delete-multiple.golden index 185f5c9d80..285ed28c06 100644 --- a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/delete-multiple.golden +++ b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/delete-multiple.golden @@ -1 +1,2 @@ +warning: GOCOVERDIR not set, no coverage data emitted Are you sure you want to delete access points "ap-99999" and "ap-88888"? (y/n): Requested to delete access points "ap-99999" and "ap-88888". diff --git a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/delete.golden b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/delete.golden index 965205b41c..d51fe2cbec 100644 --- a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/delete.golden +++ b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/delete.golden @@ -1 +1,2 @@ +warning: GOCOVERDIR not set, no coverage data emitted Are you sure you want to delete access point "ap-88888"? (y/n): Requested to delete access point "ap-88888". diff --git a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/describe-autocomplete.golden b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/describe-autocomplete.golden index ef273e8c24..608515e2f6 100644 --- a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/describe-autocomplete.golden +++ b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/describe-autocomplete.golden @@ -1,3 +1,6 @@ +warning: GOCOVERDIR not set, no coverage data emitted ap-99999 my-aws-ingress-access-point +ap-11111 my-azure-ingress-access-point +ap-22222 my-gcp-ingress-access-point :4 Completion ended with directive: ShellCompDirectiveNoFileComp diff --git a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/describe-aws-json.golden b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/describe-aws-json.golden index 8745067043..e0cabd76cf 100644 --- a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/describe-aws-json.golden +++ b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/describe-aws-json.golden @@ -1,3 +1,4 @@ +warning: GOCOVERDIR not set, no coverage data emitted { "id": "ap-99999", "name": "my-aws-ingress-access-point", diff --git a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/describe-aws.golden b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/describe-aws.golden index 31fe1d3c41..8868cdc88b 100644 --- a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/describe-aws.golden +++ b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/describe-aws.golden @@ -1,3 +1,4 @@ +warning: GOCOVERDIR not set, no coverage data emitted +-------------------------------+---------------------------------------------------------+ | ID | ap-99999 | | Name | my-aws-ingress-access-point | diff --git a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/describe-azure-json.golden b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/describe-azure-json.golden new file mode 100644 index 0000000000..2f6d0e7bd5 --- /dev/null +++ b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/describe-azure-json.golden @@ -0,0 +1,12 @@ +warning: GOCOVERDIR not set, no coverage data emitted +{ + "id": "ap-11111", + "name": "my-azure-ingress-access-point", + "environment": "env-596", + "gateway": "gw-11111", + "phase": "READY", + "azure_private_link_service_alias": "azure-pls-alias.eastus.azure.privatelinkservice", + "azure_private_link_service_resource_id": "/subscriptions/0000000/resourceGroups/plsRgName/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName", + "azure_private_endpoint_resource_id": "/subscriptions/0000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/privateEndpoints/privateEndpointName", + "dns_domain": "ap11111.eastus.azure.accesspoint.confluent.cloud" +} diff --git a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/describe-azure.golden b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/describe-azure.golden new file mode 100644 index 0000000000..bc2056b0f7 --- /dev/null +++ b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/describe-azure.golden @@ -0,0 +1,12 @@ +warning: GOCOVERDIR not set, no coverage data emitted ++----------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ +| ID | ap-11111 | +| Name | my-azure-ingress-access-point | +| Environment | env-596 | +| Gateway | gw-11111 | +| Phase | READY | +| Azure Private Link Service Alias | azure-pls-alias.eastus.azure.privatelinkservice | +| Azure Private Link Service Resource ID | /subscriptions/0000000/resourceGroups/plsRgName/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName | +| Azure Private Endpoint Resource ID | /subscriptions/0000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/privateEndpoints/privateEndpointName | +| DNS Domain | ap11111.eastus.azure.accesspoint.confluent.cloud | ++----------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ diff --git a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/describe-gcp-json.golden b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/describe-gcp-json.golden new file mode 100644 index 0000000000..1733c1eef5 --- /dev/null +++ b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/describe-gcp-json.golden @@ -0,0 +1,11 @@ +warning: GOCOVERDIR not set, no coverage data emitted +{ + "id": "ap-22222", + "name": "my-gcp-ingress-access-point", + "environment": "env-596", + "gateway": "gw-99999", + "phase": "READY", + "gcp_private_service_connect_service_attachment": "projects/projectName/regions/us-central1/serviceAttachments/serviceAttachmentName", + "gcp_private_service_connect_connection_id": "111111111111111111", + "dns_domain": "ap22222.us-central1.gcp.accesspoint.confluent.cloud" +} diff --git a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/describe-gcp.golden b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/describe-gcp.golden new file mode 100644 index 0000000000..099da834dc --- /dev/null +++ b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/describe-gcp.golden @@ -0,0 +1,11 @@ +warning: GOCOVERDIR not set, no coverage data emitted ++----------------------------+-----------------------------------------------------------------------------------+ +| ID | ap-22222 | +| Name | my-gcp-ingress-access-point | +| Environment | env-596 | +| Gateway | gw-99999 | +| Phase | READY | +| GCP PSC Service Attachment | projects/projectName/regions/us-central1/serviceAttachments/serviceAttachmentName | +| GCP PSC Connection ID | 111111111111111111 | +| DNS Domain | ap22222.us-central1.gcp.accesspoint.confluent.cloud | ++----------------------------+-----------------------------------------------------------------------------------+ diff --git a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/list-json.golden b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/list-json.golden index d22b6d3237..62a886f84c 100644 --- a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/list-json.golden +++ b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/list-json.golden @@ -1,4 +1,26 @@ +warning: GOCOVERDIR not set, no coverage data emitted [ + { + "id": "ap-11111", + "name": "my-azure-ingress-access-point", + "environment": "env-596", + "gateway": "gw-11111", + "phase": "READY", + "azure_private_link_service_alias": "azure-pls-alias.eastus.azure.privatelinkservice", + "azure_private_link_service_resource_id": "/subscriptions/0000000/resourceGroups/plsRgName/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName", + "azure_private_endpoint_resource_id": "/subscriptions/0000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/privateEndpoints/privateEndpointName", + "dns_domain": "ap11111.eastus.azure.accesspoint.confluent.cloud" + }, + { + "id": "ap-22222", + "name": "my-gcp-ingress-access-point", + "environment": "env-596", + "gateway": "gw-99999", + "phase": "READY", + "gcp_private_service_connect_service_attachment": "projects/projectName/regions/us-central1/serviceAttachments/serviceAttachmentName", + "gcp_private_service_connect_connection_id": "111111111111111111", + "dns_domain": "ap22222.us-central1.gcp.accesspoint.confluent.cloud" + }, { "id": "ap-99999", "name": "my-aws-ingress-access-point", diff --git a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/list.golden b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/list.golden index 8c96cff753..9fc1d6aa7b 100644 --- a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/list.golden +++ b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/list.golden @@ -1,3 +1,7 @@ - ID | Name | Environment | Gateway | Phase | AWS VPC Endpoint ID | AWS VPC Endpoint Service Name | DNS Domain ------------+-----------------------------+-------------+----------+-------+------------------------+---------------------------------------------------------+----------------------------------------------------- - ap-99999 | my-aws-ingress-access-point | env-596 | gw-88888 | READY | vpce-1234567890abcdef0 | com.amazonaws.vpce.us-west-2.vpce-svc-00000000000000000 | ap123abc.us-west-2.aws.accesspoint.confluent.cloud +warning: GOCOVERDIR not set, no coverage data emitted + ID | Name | Environment | Gateway | Phase | AWS VPC Endpoint ID | AWS VPC Endpoint Service Name | Azure Private Link Service | Azure Private Link Service | Azure Private Endpoint | GCP PSC Service Attachment | GCP PSC Connection ID | DNS Domain + | | | | | | | Alias | Resource ID | Resource ID | | | +-----------+-------------------------------+-------------+----------+-------+------------------------+---------------------------------------------------------+-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+-----------------------+------------------------------------------------------ + ap-11111 | my-azure-ingress-access-point | env-596 | gw-11111 | READY | | | azure-pls-alias.eastus.azure.privatelinkservice | /subscriptions/0000000/resourceGroups/plsRgName/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName | /subscriptions/0000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/privateEndpoints/privateEndpointName | | | ap11111.eastus.azure.accesspoint.confluent.cloud + ap-22222 | my-gcp-ingress-access-point | env-596 | gw-99999 | READY | | | | | | projects/projectName/regions/us-central1/serviceAttachments/serviceAttachmentName | 111111111111111111 | ap22222.us-central1.gcp.accesspoint.confluent.cloud + ap-99999 | my-aws-ingress-access-point | env-596 | gw-88888 | READY | vpce-1234567890abcdef0 | com.amazonaws.vpce.us-west-2.vpce-svc-00000000000000000 | | | | | | ap123abc.us-west-2.aws.accesspoint.confluent.cloud diff --git a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/update-autocomplete.golden b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/update-autocomplete.golden index 8840fd58b6..69c79c5b8b 100644 --- a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/update-autocomplete.golden +++ b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/update-autocomplete.golden @@ -1,4 +1,7 @@ +warning: GOCOVERDIR not set, no coverage data emitted --name Name of the ingress endpoint. ap-99999 my-aws-ingress-access-point +ap-11111 my-azure-ingress-access-point +ap-22222 my-gcp-ingress-access-point :4 Completion ended with directive: ShellCompDirectiveNoFileComp diff --git a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/update-aws.golden b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/update-aws.golden index b4c5eaa74b..1829980547 100644 --- a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/update-aws.golden +++ b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/update-aws.golden @@ -1,3 +1,4 @@ +warning: GOCOVERDIR not set, no coverage data emitted +-------------+---------------------------------+ | ID | ap-88888 | | Name | my-new-aws-ingress-access-point | diff --git a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/update-azure.golden b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/update-azure.golden new file mode 100644 index 0000000000..ac98e10421 --- /dev/null +++ b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/update-azure.golden @@ -0,0 +1,12 @@ +warning: GOCOVERDIR not set, no coverage data emitted ++----------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ +| ID | ap-11111 | +| Name | my-new-azure-ingress-access-point | +| Environment | env-596 | +| Gateway | gw-11111 | +| Phase | READY | +| Azure Private Link Service Alias | azure-pls-alias.eastus.azure.privatelinkservice | +| Azure Private Link Service Resource ID | /subscriptions/0000000/resourceGroups/plsRgName/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName | +| Azure Private Endpoint Resource ID | /subscriptions/0000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/privateEndpoints/privateEndpointName | +| DNS Domain | ap11111.eastus.azure.accesspoint.confluent.cloud | ++----------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ diff --git a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/update-gcp.golden b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/update-gcp.golden new file mode 100644 index 0000000000..68d0d3054b --- /dev/null +++ b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/update-gcp.golden @@ -0,0 +1,11 @@ +warning: GOCOVERDIR not set, no coverage data emitted ++----------------------------+-----------------------------------------------------------------------------------+ +| ID | ap-22222 | +| Name | my-new-gcp-ingress-access-point | +| Environment | env-596 | +| Gateway | gw-99999 | +| Phase | READY | +| GCP PSC Service Attachment | projects/projectName/regions/us-central1/serviceAttachments/serviceAttachmentName | +| GCP PSC Connection ID | 111111111111111111 | +| DNS Domain | ap22222.us-central1.gcp.accesspoint.confluent.cloud | ++----------------------------+-----------------------------------------------------------------------------------+ diff --git a/test/fixtures/output/network/gateway/create-azure-ingress.golden b/test/fixtures/output/network/gateway/create-azure-ingress.golden new file mode 100644 index 0000000000..4aea3a2201 --- /dev/null +++ b/test/fixtures/output/network/gateway/create-azure-ingress.golden @@ -0,0 +1,12 @@ +warning: GOCOVERDIR not set, no coverage data emitted ++--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+ +| ID | gw-abc123 | +| Name | my-azure-ingress-gateway | +| Environment | env-596 | +| Region | eastus2 | +| Type | AzureIngressPrivateLink | +| Azure Private Link Service | azure-ingress-pl.eastus2.azure.privatelinkservice | +| Alias | | +| Azure Private Link Resource ID | /subscriptions/aa000000-a000-0a00-00aa-0000aaa0a0a0/resourceGroups/rg-1/providers/Microsoft.Network/privateLinkServices/azure-ingress-pl | +| Phase | READY | ++--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+ diff --git a/test/fixtures/output/network/gateway/delete-azure-ingress-multiple.golden b/test/fixtures/output/network/gateway/delete-azure-ingress-multiple.golden new file mode 100644 index 0000000000..d746c8371a --- /dev/null +++ b/test/fixtures/output/network/gateway/delete-azure-ingress-multiple.golden @@ -0,0 +1,2 @@ +warning: GOCOVERDIR not set, no coverage data emitted +Are you sure you want to delete gateways "gw-11111" and "gw-67890"? (y/n): Requested to delete gateways "gw-11111" and "gw-67890". diff --git a/test/fixtures/output/network/gateway/delete-azure-ingress.golden b/test/fixtures/output/network/gateway/delete-azure-ingress.golden new file mode 100644 index 0000000000..4cf9d835d7 --- /dev/null +++ b/test/fixtures/output/network/gateway/delete-azure-ingress.golden @@ -0,0 +1,2 @@ +warning: GOCOVERDIR not set, no coverage data emitted +Are you sure you want to delete gateway "gw-11111"? (y/n): Requested to delete gateway "gw-11111". diff --git a/test/fixtures/output/network/gateway/describe-autocomplete.golden b/test/fixtures/output/network/gateway/describe-autocomplete.golden index b9828fe0cb..c7734fcc9b 100644 --- a/test/fixtures/output/network/gateway/describe-autocomplete.golden +++ b/test/fixtures/output/network/gateway/describe-autocomplete.golden @@ -8,5 +8,6 @@ gw-13570 my-gcp-peering-gateway gw-07531 my-gcp-gateway gw-88888 my-aws-ingress-gateway gw-99999 my-gcp-ingress-gateway +gw-11111 my-azure-ingress-gateway :4 Completion ended with directive: ShellCompDirectiveNoFileComp diff --git a/test/fixtures/output/network/gateway/describe-azure-ingress.golden b/test/fixtures/output/network/gateway/describe-azure-ingress.golden new file mode 100644 index 0000000000..cfb5c6c926 --- /dev/null +++ b/test/fixtures/output/network/gateway/describe-azure-ingress.golden @@ -0,0 +1,12 @@ +warning: GOCOVERDIR not set, no coverage data emitted ++--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+ +| ID | gw-11111 | +| Name | my-azure-ingress-gateway | +| Environment | env-596 | +| Region | eastus2 | +| Type | AzureIngressPrivateLink | +| Azure Private Link Service | azure-ingress-pl.eastus2.azure.privatelinkservice | +| Alias | | +| Azure Private Link Resource ID | /subscriptions/aa000000-a000-0a00-00aa-0000aaa0a0a0/resourceGroups/rg-1/providers/Microsoft.Network/privateLinkServices/azure-ingress-pl | +| Phase | READY | ++--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+ diff --git a/test/fixtures/output/network/gateway/list-json.golden b/test/fixtures/output/network/gateway/list-json.golden index 1489f78388..ef00585a79 100644 --- a/test/fixtures/output/network/gateway/list-json.golden +++ b/test/fixtures/output/network/gateway/list-json.golden @@ -17,6 +17,16 @@ warning: GOCOVERDIR not set, no coverage data emitted "type": "AzurePeering", "phase": "READY" }, + { + "id": "gw-11111", + "name": "my-azure-ingress-gateway", + "environment": "env-596", + "region": "eastus2", + "type": "AzureIngressPrivateLink", + "azure_private_link_service_alias": "azure-ingress-pl.eastus2.azure.privatelinkservice", + "azure_private_link_service_resource_id": "/subscriptions/aa000000-a000-0a00-00aa-0000aaa0a0a0/resourceGroups/rg-1/providers/Microsoft.Network/privateLinkServices/azure-ingress-pl", + "phase": "READY" + }, { "id": "gw-12345", "name": "my-aws-gateway", diff --git a/test/fixtures/output/network/gateway/list.golden b/test/fixtures/output/network/gateway/list.golden index 641e8e7513..53f8f24792 100644 --- a/test/fixtures/output/network/gateway/list.golden +++ b/test/fixtures/output/network/gateway/list.golden @@ -1,12 +1,14 @@ warning: GOCOVERDIR not set, no coverage data emitted - ID | Name | Environment | Region | Type | AWS Principal ARN | VPC Endpoint Service Name | Azure Subscription | GCP IAM Principal | GCP Project | GCP PSC Service Attachment | Phase | Zones | Account | Error Message ------------+--------------------------+-------------+-------------+---------------------------------+--------------------------------+---------------------------------------------------------+--------------------------------------+-------------------------------------+---------------+-----------------------------------------------------------------------------------------------+-------+------------------------+--------------+---------------- - gw-07531 | my-gcp-gateway | env-596 | eastus | GcpEgressPrivateServiceConnect | | | | | project-12345 | | READY | | | - gw-09876 | my-azure-peering-gateway | env-596 | eastus2 | AzurePeering | | | | | | | READY | | | - gw-12345 | my-aws-gateway | env-596 | us-east-1 | AwsEgressPrivateLink | arn:aws:iam::123456789012:role | | | | | | READY | | | - gw-13570 | my-gcp-peering-gateway | env-596 | eastus2 | GcpPeering | | | | g000000-a000-0a00-00aa-0000aaa0a0a0 | | | READY | | | - gw-23456 | my-aws-gateway | env-596 | us-east-2 | AwsPrivateNetworkInterface | | | | | | | READY | us-east-2a, us-east-2b | 000000000000 | - gw-54321 | my-aws-peering-gateway | env-596 | us-east-2 | AwsPeering | | | | | | | READY | | | - gw-67890 | my-azure-gateway | env-596 | eastus | AzureEgressPrivateLink | | | aa000000-a000-0a00-00aa-0000aaa0a0a0 | | | | READY | | | - gw-88888 | my-aws-ingress-gateway | env-596 | us-west-2 | AwsIngressPrivateLink | | com.amazonaws.vpce.us-west-2.vpce-svc-00000000000000000 | | | | | READY | | | - gw-99999 | my-gcp-ingress-gateway | env-596 | us-central1 | GcpIngressPrivateServiceConnect | | | | | | projects/traffic-prod/regions/us-central1/serviceAttachments/plattg-abc123-service-attachment | READY | | | + ID | Name | Environment | Region | Type | AWS Principal ARN | VPC Endpoint Service Name | Azure Subscription | Azure Private Link Service | Azure Private Link Resource ID | GCP IAM Principal | GCP Project | GCP PSC Service Attachment | Phase | Zones | Account | Error Message + | | | | | | | | Alias | | | | | | | | +-----------+--------------------------+-------------+-------------+---------------------------------+--------------------------------+---------------------------------------------------------+--------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------+---------------+-----------------------------------------------------------------------------------------------+-------+------------------------+--------------+---------------- + gw-07531 | my-gcp-gateway | env-596 | eastus | GcpEgressPrivateServiceConnect | | | | | | | project-12345 | | READY | | | + gw-09876 | my-azure-peering-gateway | env-596 | eastus2 | AzurePeering | | | | | | | | | READY | | | + gw-11111 | my-azure-ingress-gateway | env-596 | eastus2 | AzureIngressPrivateLink | | | | azure-ingress-pl.eastus2.azure.privatelinkservice | /subscriptions/aa000000-a000-0a00-00aa-0000aaa0a0a0/resourceGroups/rg-1/providers/Microsoft.Network/privateLinkServices/azure-ingress-pl | | | | READY | | | + gw-12345 | my-aws-gateway | env-596 | us-east-1 | AwsEgressPrivateLink | arn:aws:iam::123456789012:role | | | | | | | | READY | | | + gw-13570 | my-gcp-peering-gateway | env-596 | eastus2 | GcpPeering | | | | | | g000000-a000-0a00-00aa-0000aaa0a0a0 | | | READY | | | + gw-23456 | my-aws-gateway | env-596 | us-east-2 | AwsPrivateNetworkInterface | | | | | | | | | READY | us-east-2a, us-east-2b | 000000000000 | + gw-54321 | my-aws-peering-gateway | env-596 | us-east-2 | AwsPeering | | | | | | | | | READY | | | + gw-67890 | my-azure-gateway | env-596 | eastus | AzureEgressPrivateLink | | | aa000000-a000-0a00-00aa-0000aaa0a0a0 | | | | | | READY | | | + gw-88888 | my-aws-ingress-gateway | env-596 | us-west-2 | AwsIngressPrivateLink | | com.amazonaws.vpce.us-west-2.vpce-svc-00000000000000000 | | | | | | | READY | | | + gw-99999 | my-gcp-ingress-gateway | env-596 | us-central1 | GcpIngressPrivateServiceConnect | | | | | | | | projects/traffic-prod/regions/us-central1/serviceAttachments/plattg-abc123-service-attachment | READY | | | diff --git a/test/network_test.go b/test/network_test.go index 1a3c1e47bf..2589e71be4 100644 --- a/test/network_test.go +++ b/test/network_test.go @@ -126,9 +126,12 @@ func (s *CLITestSuite) TestNetworkGateway() { {args: "network gateway create my-gateway --cloud aws --type ingress-privatelink --region us-west-2", fixture: "network/gateway/create-aws-ingress.golden"}, {args: "network gateway create my-gateway --cloud aws --type private-network-interface --region us-west-2 --zones us-west-2a,us-west-2b", fixture: "network/gateway/create-aws-private-network-interface.golden"}, {args: "network gateway create my-gcp-ingress-gateway --cloud gcp --type ingress-private-service-connect --region us-central1", fixture: "network/gateway/create-gcp-ingress.golden"}, + {args: "network gateway create my-azure-ingress-gateway --cloud azure --type ingress-privatelink --region eastus2", fixture: "network/gateway/create-azure-ingress.golden"}, {args: "network gateway update gw-111111 --name new-name", fixture: "network/gateway/update.golden"}, {args: "network gateway delete gw-12345", input: "y\n", fixture: "network/gateway/delete.golden"}, {args: "network gateway delete gw-12345 gw-54321", input: "y\n", fixture: "network/gateway/delete-multiple.golden"}, + {args: "network gateway delete gw-11111", input: "y\n", fixture: "network/gateway/delete-azure-ingress.golden"}, + {args: "network gateway delete gw-11111 gw-67890", input: "y\n", fixture: "network/gateway/delete-azure-ingress-multiple.golden"}, {args: "network gateway delete gw-invalid", input: "y\n", fixture: "network/gateway/delete-fail.golden", exitCode: 1}, } @@ -147,6 +150,7 @@ func (s *CLITestSuite) TestNetworkGatewayDescribe() { {args: "network gateway describe gw-07531", fixture: "network/gateway/describe-gcp.golden"}, {args: "network gateway describe gw-99999", fixture: "network/gateway/describe-gcp-ingress.golden"}, {args: "network gateway describe gw-67890", fixture: "network/gateway/describe-azure.golden"}, + {args: "network gateway describe gw-11111", fixture: "network/gateway/describe-azure-ingress.golden"}, {args: "network gateway describe gw-12345 --output json", fixture: "network/gateway/describe-aws-json.golden"}, {args: "network gateway describe gw-88888 --output json", fixture: "network/gateway/describe-aws-ingress-json.golden"}, } @@ -1171,7 +1175,11 @@ func (s *CLITestSuite) TestNetworkAccessPointPrivateLinkIngressEndpoint() { tests := []CLITest{ {args: "network access-point private-link ingress-endpoint create --cloud aws --gateway gw-88888 --vpc-endpoint-id vpce-1234567890abcdef0", fixture: "network/access-point/private-link/ingress-endpoint/create-aws.golden"}, {args: "network access-point private-link ingress-endpoint create my-ingress-endpoint --cloud aws --gateway gw-88888 --vpc-endpoint-id vpce-1234567890abcdef0", fixture: "network/access-point/private-link/ingress-endpoint/create-aws-name.golden"}, + {args: "network access-point private-link ingress-endpoint create --cloud azure --gateway gw-11111 --private-endpoint-resource-id /subscriptions/0000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/privateEndpoints/privateEndpointName", fixture: "network/access-point/private-link/ingress-endpoint/create-azure.golden"}, + {args: "network access-point private-link ingress-endpoint create --cloud gcp --gateway gw-99999 --private-service-connect-connection-id 111111111111111111", fixture: "network/access-point/private-link/ingress-endpoint/create-gcp.golden"}, {args: "network access-point private-link ingress-endpoint update ap-88888 --name my-new-aws-ingress-access-point", fixture: "network/access-point/private-link/ingress-endpoint/update-aws.golden"}, + {args: "network access-point private-link ingress-endpoint update ap-11111 --name my-new-azure-ingress-access-point", fixture: "network/access-point/private-link/ingress-endpoint/update-azure.golden"}, + {args: "network access-point private-link ingress-endpoint update ap-22222 --name my-new-gcp-ingress-access-point", fixture: "network/access-point/private-link/ingress-endpoint/update-gcp.golden"}, {args: "network access-point private-link ingress-endpoint delete ap-88888", input: "y\n", fixture: "network/access-point/private-link/ingress-endpoint/delete.golden"}, {args: "network access-point private-link ingress-endpoint delete ap-99999 ap-88888", input: "y\n", fixture: "network/access-point/private-link/ingress-endpoint/delete-multiple.golden"}, {args: "network access-point private-link ingress-endpoint delete ap-invalid", fixture: "network/access-point/private-link/ingress-endpoint/delete-fail.golden", exitCode: 1}, @@ -1187,6 +1195,10 @@ func (s *CLITestSuite) TestNetworkAccessPointPrivateLinkIngressEndpointDescribe( tests := []CLITest{ {args: "network access-point private-link ingress-endpoint describe ap-99999", fixture: "network/access-point/private-link/ingress-endpoint/describe-aws.golden"}, {args: "network access-point private-link ingress-endpoint describe ap-99999 --output json", fixture: "network/access-point/private-link/ingress-endpoint/describe-aws-json.golden"}, + {args: "network access-point private-link ingress-endpoint describe ap-11111", fixture: "network/access-point/private-link/ingress-endpoint/describe-azure.golden"}, + {args: "network access-point private-link ingress-endpoint describe ap-11111 --output json", fixture: "network/access-point/private-link/ingress-endpoint/describe-azure-json.golden"}, + {args: "network access-point private-link ingress-endpoint describe ap-22222", fixture: "network/access-point/private-link/ingress-endpoint/describe-gcp.golden"}, + {args: "network access-point private-link ingress-endpoint describe ap-22222 --output json", fixture: "network/access-point/private-link/ingress-endpoint/describe-gcp-json.golden"}, } for _, test := range tests { diff --git a/test/test-server/networking_handlers.go b/test/test-server/networking_handlers.go index cf7812ffb4..cfd6a76c4a 100644 --- a/test/test-server/networking_handlers.go +++ b/test/test-server/networking_handlers.go @@ -12,7 +12,7 @@ import ( "github.com/gorilla/mux" "github.com/stretchr/testify/require" - networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2/networking-access-point/v1" + networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-access-point/v1" networkingdnsforwarderv1 "github.com/confluentinc/ccloud-sdk-go-v2/networking-dnsforwarder/v1" networkinggatewayv1 "github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-gateway/v1" networkingipv1 "github.com/confluentinc/ccloud-sdk-go-v2/networking-ip/v1" @@ -2386,6 +2386,11 @@ func getGateway(id, environment, name, specConfigKind, statusCloudGatewayKind st Kind: specConfigKind, Region: "eastus", })) + case "AzureIngressPrivateLinkGatewaySpec": + gateway.Spec.SetConfig(networkinggatewayv1.NetworkingV1AzureIngressPrivateLinkGatewaySpecAsNetworkingV1GatewaySpecConfigOneOf(&networkinggatewayv1.NetworkingV1AzureIngressPrivateLinkGatewaySpec{ + Kind: specConfigKind, + Region: "eastus2", + })) case "GcpIngressPrivateServiceConnectGatewaySpec": gateway.Spec.SetConfig(networkinggatewayv1.NetworkingV1GcpIngressPrivateServiceConnectGatewaySpecAsNetworkingV1GatewaySpecConfigOneOf(&networkinggatewayv1.NetworkingV1GcpIngressPrivateServiceConnectGatewaySpec{ Kind: specConfigKind, @@ -2424,6 +2429,12 @@ func getGateway(id, environment, name, specConfigKind, statusCloudGatewayKind st Kind: statusCloudGatewayKind, Project: networkinggatewayv1.PtrString("project-12345"), })) + case "AzureIngressPrivateLinkGatewayStatus": + gateway.Status.SetCloudGateway(networkinggatewayv1.NetworkingV1AzureIngressPrivateLinkGatewayStatusAsNetworkingV1GatewayStatusCloudGatewayOneOf(&networkinggatewayv1.NetworkingV1AzureIngressPrivateLinkGatewayStatus{ + Kind: statusCloudGatewayKind, + PrivateLinkServiceAlias: networkinggatewayv1.PtrString("azure-ingress-pl.eastus2.azure.privatelinkservice"), + PrivateLinkServiceResourceId: networkinggatewayv1.PtrString("/subscriptions/aa000000-a000-0a00-00aa-0000aaa0a0a0/resourceGroups/rg-1/providers/Microsoft.Network/privateLinkServices/azure-ingress-pl"), + })) case "GcpIngressPrivateServiceConnectGatewayStatus": gateway.Status.SetCloudGateway(networkinggatewayv1.NetworkingV1GcpIngressPrivateServiceConnectGatewayStatusAsNetworkingV1GatewayStatusCloudGatewayOneOf(&networkinggatewayv1.NetworkingV1GcpIngressPrivateServiceConnectGatewayStatus{ Kind: statusCloudGatewayKind, @@ -2474,6 +2485,10 @@ func handleNetworkingGatewayGet(t *testing.T, id, environment string) http.Handl record := getGateway(id, environment, "my-gcp-ingress-gateway", "GcpIngressPrivateServiceConnectGatewaySpec", "GcpIngressPrivateServiceConnectGatewayStatus") err := json.NewEncoder(w).Encode(record) require.NoError(t, err) + case "gw-11111": + record := getGateway(id, environment, "my-azure-ingress-gateway", "AzureIngressPrivateLinkGatewaySpec", "AzureIngressPrivateLinkGatewayStatus") + err := json.NewEncoder(w).Encode(record) + require.NoError(t, err) } } } @@ -2522,6 +2537,12 @@ func handleNetworkingGatewayPost(t *testing.T) http.HandlerFunc { Kind: "AzureEgressPrivateLinkGatewayStatus", Subscription: networkingv1.PtrString("aa000000-a000-0a00-00aa-0000aaa0a0a0"), })) + } else if body.Spec.Config.NetworkingV1AzureIngressPrivateLinkGatewaySpec != nil { + gateway.Status.SetCloudGateway(networkinggatewayv1.NetworkingV1AzureIngressPrivateLinkGatewayStatusAsNetworkingV1GatewayStatusCloudGatewayOneOf(&networkinggatewayv1.NetworkingV1AzureIngressPrivateLinkGatewayStatus{ + Kind: "AzureIngressPrivateLinkGatewayStatus", + PrivateLinkServiceAlias: networkingv1.PtrString("azure-ingress-pl.eastus2.azure.privatelinkservice"), + PrivateLinkServiceResourceId: networkingv1.PtrString("/subscriptions/aa000000-a000-0a00-00aa-0000aaa0a0a0/resourceGroups/rg-1/providers/Microsoft.Network/privateLinkServices/azure-ingress-pl"), + })) } else if body.Spec.Config.NetworkingV1GcpEgressPrivateServiceConnectGatewaySpec != nil { gateway.Status.SetCloudGateway(networkinggatewayv1.NetworkingV1GcpEgressPrivateServiceConnectGatewayStatusAsNetworkingV1GatewayStatusCloudGatewayOneOf(&networkinggatewayv1.NetworkingV1GcpEgressPrivateServiceConnectGatewayStatus{ Kind: "GcpEgressPrivateServiceConnectGatewayStatus", @@ -2562,8 +2583,9 @@ func handleNetworkingGatewayList(t *testing.T, environment string) http.HandlerF gatewaySeven := getGateway("gw-07531", environment, "my-gcp-gateway", "GcpEgressPrivateServiceConnectGatewaySpec", "GcpEgressPrivateServiceConnectGatewayStatus") gatewayEight := getGateway("gw-88888", environment, "my-aws-ingress-gateway", "AwsIngressPrivateLinkGatewaySpec", "AwsIngressPrivateLinkGatewayStatus") gatewayNine := getGateway("gw-99999", environment, "my-gcp-ingress-gateway", "GcpIngressPrivateServiceConnectGatewaySpec", "GcpIngressPrivateServiceConnectGatewayStatus") + gatewayTen := getGateway("gw-11111", environment, "my-azure-ingress-gateway", "AzureIngressPrivateLinkGatewaySpec", "AzureIngressPrivateLinkGatewayStatus") - gatewayList := networkinggatewayv1.NetworkingV1GatewayList{Data: []networkinggatewayv1.NetworkingV1Gateway{gatewayOne, gatewayTwo, gatewayThree, gatewayFour, gatewayFive, gatewaySix, gatewaySeven, gatewayEight, gatewayNine}} + gatewayList := networkinggatewayv1.NetworkingV1GatewayList{Data: []networkinggatewayv1.NetworkingV1Gateway{gatewayOne, gatewayTwo, gatewayThree, gatewayFour, gatewayFive, gatewaySix, gatewaySeven, gatewayEight, gatewayNine, gatewayTen}} gatewayList.Data = filterGatewayList(gatewayList.Data, gatewayTypes, ids, regions, displayNames, phases) setPageToken(&gatewayList, &gatewayList.Metadata, r.URL) err := json.NewEncoder(w).Encode(gatewayList) @@ -2636,6 +2658,9 @@ func getGatewayTypeFromSpec(gateway networkinggatewayv1.NetworkingV1Gateway) str if config.NetworkingV1AzureEgressPrivateLinkGatewaySpec != nil { return "AzureEgressPrivateLink" } + if config.NetworkingV1AzureIngressPrivateLinkGatewaySpec != nil { + return "AzureIngressPrivateLink" + } if config.NetworkingV1AzurePeeringGatewaySpec != nil { return "AzurePeering" } @@ -2672,6 +2697,9 @@ func getRegionFromSpec(gateway networkinggatewayv1.NetworkingV1Gateway) string { if config.NetworkingV1AzureEgressPrivateLinkGatewaySpec != nil { return config.NetworkingV1AzureEgressPrivateLinkGatewaySpec.GetRegion() } + if config.NetworkingV1AzureIngressPrivateLinkGatewaySpec != nil { + return config.NetworkingV1AzureIngressPrivateLinkGatewaySpec.GetRegion() + } if config.NetworkingV1AzurePeeringGatewaySpec != nil { return config.NetworkingV1AzurePeeringGatewaySpec.GetRegion() } @@ -3124,6 +3152,63 @@ func getAwsIngressAccessPoint(id, environment, name string) networkingaccesspoin } } +func getAzureIngressAccessPoint(id, environment, name string) networkingaccesspointv1.NetworkingV1AccessPoint { + return networkingaccesspointv1.NetworkingV1AccessPoint{ + Id: networkingaccesspointv1.PtrString(id), + Spec: &networkingaccesspointv1.NetworkingV1AccessPointSpec{ + DisplayName: networkingaccesspointv1.PtrString(name), + Config: &networkingaccesspointv1.NetworkingV1AccessPointSpecConfigOneOf{ + NetworkingV1AzureIngressPrivateLinkEndpoint: &networkingaccesspointv1.NetworkingV1AzureIngressPrivateLinkEndpoint{ + Kind: "AzureIngressPrivateLinkEndpoint", + PrivateEndpointResourceId: "/subscriptions/0000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/privateEndpoints/privateEndpointName", + }, + }, + Environment: &networkingaccesspointv1.ObjectReference{Id: environment}, + Gateway: &networkingaccesspointv1.ObjectReference{Id: "gw-11111"}, + }, + Status: &networkingaccesspointv1.NetworkingV1AccessPointStatus{ + Phase: "READY", + Config: &networkingaccesspointv1.NetworkingV1AccessPointStatusConfigOneOf{ + NetworkingV1AzureIngressPrivateLinkEndpointStatus: &networkingaccesspointv1.NetworkingV1AzureIngressPrivateLinkEndpointStatus{ + Kind: "AzureIngressPrivateLinkEndpointStatus", + PrivateLinkServiceAlias: "azure-pls-alias.eastus.azure.privatelinkservice", + PrivateLinkServiceResourceId: "/subscriptions/0000000/resourceGroups/plsRgName/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName", + PrivateEndpointResourceId: "/subscriptions/0000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/privateEndpoints/privateEndpointName", + DnsDomain: networkingaccesspointv1.PtrString("ap11111.eastus.azure.accesspoint.confluent.cloud"), + }, + }, + }, + } +} + +func getGcpIngressAccessPoint(id, environment, name string) networkingaccesspointv1.NetworkingV1AccessPoint { + return networkingaccesspointv1.NetworkingV1AccessPoint{ + Id: networkingaccesspointv1.PtrString(id), + Spec: &networkingaccesspointv1.NetworkingV1AccessPointSpec{ + DisplayName: networkingaccesspointv1.PtrString(name), + Config: &networkingaccesspointv1.NetworkingV1AccessPointSpecConfigOneOf{ + NetworkingV1GcpIngressPrivateServiceConnectEndpoint: &networkingaccesspointv1.NetworkingV1GcpIngressPrivateServiceConnectEndpoint{ + Kind: "GcpIngressPrivateServiceConnectEndpoint", + PrivateServiceConnectConnectionId: "111111111111111111", + }, + }, + Environment: &networkingaccesspointv1.ObjectReference{Id: environment}, + Gateway: &networkingaccesspointv1.ObjectReference{Id: "gw-99999"}, + }, + Status: &networkingaccesspointv1.NetworkingV1AccessPointStatus{ + Phase: "READY", + Config: &networkingaccesspointv1.NetworkingV1AccessPointStatusConfigOneOf{ + NetworkingV1GcpIngressPrivateServiceConnectEndpointStatus: &networkingaccesspointv1.NetworkingV1GcpIngressPrivateServiceConnectEndpointStatus{ + Kind: "GcpIngressPrivateServiceConnectEndpointStatus", + PrivateServiceConnectServiceAttachment: "projects/projectName/regions/us-central1/serviceAttachments/serviceAttachmentName", + PrivateServiceConnectConnectionId: "111111111111111111", + DnsDomain: networkingaccesspointv1.PtrString("ap22222.us-central1.gcp.accesspoint.confluent.cloud"), + }, + }, + }, + } +} + func handleNetworkingAccessPointGet(t *testing.T, id, environment string) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { var accessPoint networkingaccesspointv1.NetworkingV1AccessPoint @@ -3140,6 +3225,10 @@ func handleNetworkingAccessPointGet(t *testing.T, id, environment string) http.H accessPoint = getGcpEgressAccessPoint(id, environment, "my-gcp-egress-access-point") case "ap-99999": accessPoint = getAwsIngressAccessPoint(id, environment, "my-aws-ingress-access-point") + case "ap-11111": + accessPoint = getAzureIngressAccessPoint(id, environment, "my-azure-ingress-access-point") + case "ap-22222": + accessPoint = getGcpIngressAccessPoint(id, environment, "my-gcp-ingress-access-point") } err := json.NewEncoder(w).Encode(accessPoint) require.NoError(t, err) @@ -3173,6 +3262,10 @@ func handleNetworkingAccessPointUpdate(t *testing.T, id string) http.HandlerFunc accessPoint = getGcpEgressAccessPoint(id, body.Spec.Environment.GetId(), "my-gcp-egress-access-point") case "ap-99999": accessPoint = getAwsIngressAccessPoint(id, body.Spec.Environment.GetId(), "my-aws-ingress-access-point") + case "ap-11111": + accessPoint = getAzureIngressAccessPoint(id, body.Spec.Environment.GetId(), "my-azure-ingress-access-point") + case "ap-22222": + accessPoint = getGcpIngressAccessPoint(id, body.Spec.Environment.GetId(), "my-gcp-ingress-access-point") } accessPoint.Spec.SetDisplayName(body.Spec.GetDisplayName()) @@ -3189,8 +3282,10 @@ func handleNetworkingAccessPointList(t *testing.T, environment string) http.Hand accessPointThree := getAwsPrivateNetworkInterfaceAccessPoint("ap-54321", environment, "my-aws-private-network-interface-access-point") accessPointFour := getGcpEgressAccessPoint("ap-88888", environment, "my-gcp-egress-access-point") accessPointFive := getAwsIngressAccessPoint("ap-99999", environment, "my-aws-ingress-access-point") + accessPointSix := getAzureIngressAccessPoint("ap-11111", environment, "my-azure-ingress-access-point") + accessPointSeven := getGcpIngressAccessPoint("ap-22222", environment, "my-gcp-ingress-access-point") - recordList := networkingaccesspointv1.NetworkingV1AccessPointList{Data: []networkingaccesspointv1.NetworkingV1AccessPoint{accessPointOne, accessPointTwo, accessPointThree, accessPointFour, accessPointFive}} + recordList := networkingaccesspointv1.NetworkingV1AccessPointList{Data: []networkingaccesspointv1.NetworkingV1AccessPoint{accessPointOne, accessPointTwo, accessPointThree, accessPointFour, accessPointFive, accessPointSix, accessPointSeven}} setPageToken(&recordList, &recordList.Metadata, r.URL) err := json.NewEncoder(w).Encode(recordList) require.NoError(t, err) @@ -3260,6 +3355,33 @@ func handleNetworkingAccessPointCreate(t *testing.T) http.HandlerFunc { }, }, } + } else if accessPoint.Spec.Config.NetworkingV1AzureIngressPrivateLinkEndpoint != nil { + accessPoint.SetId("ap-11111") + accessPoint.Status = &networkingaccesspointv1.NetworkingV1AccessPointStatus{ + Phase: "READY", + Config: &networkingaccesspointv1.NetworkingV1AccessPointStatusConfigOneOf{ + NetworkingV1AzureIngressPrivateLinkEndpointStatus: &networkingaccesspointv1.NetworkingV1AzureIngressPrivateLinkEndpointStatus{ + Kind: "AzureIngressPrivateLinkEndpointStatus", + PrivateLinkServiceAlias: "azure-pls-alias.eastus.azure.privatelinkservice", + PrivateLinkServiceResourceId: "/subscriptions/0000000/resourceGroups/plsRgName/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName", + PrivateEndpointResourceId: "/subscriptions/0000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/privateEndpoints/privateEndpointName", + DnsDomain: networkingaccesspointv1.PtrString("ap11111.eastus.azure.accesspoint.confluent.cloud"), + }, + }, + } + } else if accessPoint.Spec.Config.NetworkingV1GcpIngressPrivateServiceConnectEndpoint != nil { + accessPoint.SetId("ap-22222") + accessPoint.Status = &networkingaccesspointv1.NetworkingV1AccessPointStatus{ + Phase: "READY", + Config: &networkingaccesspointv1.NetworkingV1AccessPointStatusConfigOneOf{ + NetworkingV1GcpIngressPrivateServiceConnectEndpointStatus: &networkingaccesspointv1.NetworkingV1GcpIngressPrivateServiceConnectEndpointStatus{ + Kind: "GcpIngressPrivateServiceConnectEndpointStatus", + PrivateServiceConnectServiceAttachment: "projects/projectName/regions/us-central1/serviceAttachments/serviceAttachmentName", + PrivateServiceConnectConnectionId: "111111111111111111", + DnsDomain: networkingaccesspointv1.PtrString("ap22222.us-central1.gcp.accesspoint.confluent.cloud"), + }, + }, + } } err = json.NewEncoder(w).Encode(accessPoint) From a07a96740e4aec6344a22d3f0f473944211e0b69 Mon Sep 17 00:00:00 2001 From: Andrew Veenstra Date: Wed, 1 Apr 2026 17:44:37 -0400 Subject: [PATCH 4/6] Upgrade networking-gateway and networking-access-point to v0.13.0 Co-Authored-By: Claude Opus 4.6 --- go.mod | 6 +++--- go.sum | 4 ++++ pkg/ccloudv2/networking-gateway.go | 10 +++++----- pkg/ccloudv2/networking_access_point.go | 10 +++++----- 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/go.mod b/go.mod index 7ee8471e3c..81a048925f 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/confluentinc/cli/v4 -go 1.25.7 +go 1.25.8 require ( github.com/antihax/optional v1.0.0 @@ -15,6 +15,8 @@ require ( github.com/charmbracelet/lipgloss v0.11.0 github.com/client9/gospell v0.0.0-20160306015952-90dfc71015df github.com/confluentinc/ccloud-sdk-go-v1-public v0.0.0-20250521223017-0e8f6f971b52 + github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-access-point v0.13.0 + github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-gateway v0.13.0 github.com/confluentinc/ccloud-sdk-go-v2/ai v0.1.0 github.com/confluentinc/ccloud-sdk-go-v2/apikeys v0.4.0 github.com/confluentinc/ccloud-sdk-go-v2/billing v0.3.0 @@ -40,9 +42,7 @@ require ( github.com/confluentinc/ccloud-sdk-go-v2/mds v0.4.0 github.com/confluentinc/ccloud-sdk-go-v2/metrics v0.2.0 github.com/confluentinc/ccloud-sdk-go-v2/networking v0.14.0 - github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-access-point v0.12.0 github.com/confluentinc/ccloud-sdk-go-v2/networking-dnsforwarder v0.4.0 - github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-gateway v0.12.0 github.com/confluentinc/ccloud-sdk-go-v2/networking-ip v0.2.0 github.com/confluentinc/ccloud-sdk-go-v2/networking-privatelink v0.3.0 github.com/confluentinc/ccloud-sdk-go-v2/org v0.9.0 diff --git a/go.sum b/go.sum index 201fd08e04..500a1b05a3 100644 --- a/go.sum +++ b/go.sum @@ -190,8 +190,12 @@ github.com/confluentinc/ccloud-sdk-go-v1-public v0.0.0-20250521223017-0e8f6f971b github.com/confluentinc/ccloud-sdk-go-v1-public v0.0.0-20250521223017-0e8f6f971b52/go.mod h1:62EMf+5uFEt1BJ2q8WMrUoI9VUSxAbDnmZCGRt/MbA0= github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-access-point v0.12.0 h1:eeJPL6TpJddJOwStebbW2Y2IYXJrNrLqe0u9EUaAGr4= github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-access-point v0.12.0/go.mod h1:mFYZvHI92ChlfghLNpnXNxkwX33jEAUXQ5w0/Ri3OQY= +github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-access-point v0.13.0 h1:crG9ZKL8WlY7fX1ooSsODyNKSLhWuOpvThQ/GYlDjK0= +github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-access-point v0.13.0/go.mod h1:94S6dsLwNBa6zumSRQi81/aM750kLu+HJFXd4jcJz7A= github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-gateway v0.12.0 h1:xD/maPHZjgexJNsXu0zmeU1CXUXPlmnCDUK+t/ighw0= github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-gateway v0.12.0/go.mod h1:Nq00w3h+2vpEi+8w1f+lgmNu5m3mHogOzpw8/JzUL6k= +github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-gateway v0.13.0 h1:RDHQh6GcaL6JrZock9jsPQCUiwHNNZBiJOrXt7/v2lw= +github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-gateway v0.13.0/go.mod h1:xr1v1dpdLoFSozNL4Qiv4gNjVlaTgr7mBMVnfjtzdas= github.com/confluentinc/ccloud-sdk-go-v2/ai v0.1.0 h1:zSF4OQUJXWH2JeAo9rsq13ibk+JFdzITGR8S7cFMpzw= github.com/confluentinc/ccloud-sdk-go-v2/ai v0.1.0/go.mod h1:DoxqzzF3JzvJr3fWkvCiOHFlE0GoYpozWxFZ1Ud9ntA= github.com/confluentinc/ccloud-sdk-go-v2/apikeys v0.4.0 h1:8fWyLwMuy8ec0MVF5Avd54UvbIxhDFhZzanHBVwgxdw= diff --git a/pkg/ccloudv2/networking-gateway.go b/pkg/ccloudv2/networking-gateway.go index 9d8c555260..9dc085e99a 100644 --- a/pkg/ccloudv2/networking-gateway.go +++ b/pkg/ccloudv2/networking-gateway.go @@ -67,19 +67,19 @@ func (c *Client) executeListGateways(environment, pageToken string, types, ids, req := c.NetworkingGatewayClient.GatewaysNetworkingV1Api.ListNetworkingV1Gateways(c.networkingGatewayApiContext()).Environment(environment).PageSize(ccloudV2ListPageSize) if len(types) > 0 { - req = req.GatewayType(networkinggatewayv1.MultipleSearchFilter{Items: types}) + req = req.GatewayType(types) } if len(ids) > 0 { - req = req.Id(networkinggatewayv1.MultipleSearchFilter{Items: ids}) + req = req.Id(ids) } if len(regions) > 0 { - req = req.SpecConfigRegion(networkinggatewayv1.MultipleSearchFilter{Items: regions}) + req = req.SpecConfigRegion(regions) } if len(displayNames) > 0 { - req = req.SpecDisplayName(networkinggatewayv1.MultipleSearchFilter{Items: displayNames}) + req = req.SpecDisplayName(displayNames) } if len(phases) > 0 { - req = req.StatusPhase(networkinggatewayv1.MultipleSearchFilter{Items: phases}) + req = req.StatusPhase(phases) } if pageToken != "" { req = req.PageToken(pageToken) diff --git a/pkg/ccloudv2/networking_access_point.go b/pkg/ccloudv2/networking_access_point.go index 5801b4550b..ff4f9c619c 100644 --- a/pkg/ccloudv2/networking_access_point.go +++ b/pkg/ccloudv2/networking_access_point.go @@ -57,7 +57,7 @@ func (c *Client) executeListAccessPoints(environment, pageToken string, names [] } if names != nil { - req = req.SpecDisplayName(networkingaccesspointv1.MultipleSearchFilter{Items: names}) + req = req.SpecDisplayName(names) } resp, httpResp, err := req.Execute() @@ -111,19 +111,19 @@ func (c *Client) executeListDnsRecords(environment, pageToken string, listParame } if listParameters.Gateways != nil { - req = req.SpecGateway(networkingaccesspointv1.MultipleSearchFilter{Items: listParameters.Gateways}) + req = req.SpecGateway(listParameters.Gateways) } if listParameters.Domains != nil { - req = req.SpecDomain(networkingaccesspointv1.MultipleSearchFilter{Items: listParameters.Domains}) + req = req.SpecDomain(listParameters.Domains) } if listParameters.Names != nil { - req = req.SpecDisplayName(networkingaccesspointv1.MultipleSearchFilter{Items: listParameters.Names}) + req = req.SpecDisplayName(listParameters.Names) } if listParameters.ResourceIds != nil { - req = req.Resource(networkingaccesspointv1.MultipleSearchFilter{Items: listParameters.ResourceIds}) + req = req.Resource(listParameters.ResourceIds) } resp, httpResp, err := req.Execute() From 5a92cd1b5e9a423d2a693dcde06c5bb507d6b0d0 Mon Sep 17 00:00:00 2001 From: Andrew Veenstra Date: Fri, 3 Apr 2026 17:22:40 -0400 Subject: [PATCH 5/6] Fix GCP gateway type naming to match networking API The networking API uses GcpEgressPrivateLink and GcpIngressPrivateLink, but the CLI was using GcpEgressPrivateServiceConnect and GcpIngressPrivateServiceConnect, causing type filtering to fail. Accept both gcp-*-privatelink and gcp-*-private-service-connect as input for backward compatibility. Co-Authored-By: Claude Opus 4.6 --- internal/network/command_gateway.go | 24 +++++++++-------- internal/network/command_gateway_list.go | 8 +++--- .../network/gateway/create-gcp-ingress.golden | 2 +- .../gateway/describe-gcp-ingress.golden | 2 +- .../network/gateway/describe-gcp.golden | 18 ++++++------- .../network/gateway/list-filter-id.golden | 5 +++- .../gateway/list-filter-multiple.golden | 5 +++- .../network/gateway/list-filter-name.golden | 6 ++++- .../network/gateway/list-filter-phase.golden | 14 +++++++++- .../network/gateway/list-filter-region.golden | 5 +++- .../network/gateway/list-filter-type.golden | 5 +++- .../output/network/gateway/list-json.golden | 4 +-- .../output/network/gateway/list.golden | 26 +++++++++---------- test/test-server/networking_handlers.go | 4 +-- 14 files changed, 79 insertions(+), 49 deletions(-) diff --git a/internal/network/command_gateway.go b/internal/network/command_gateway.go index 361d2c2e59..9c549755e8 100644 --- a/internal/network/command_gateway.go +++ b/internal/network/command_gateway.go @@ -24,21 +24,23 @@ const ( azurePeering = "AzurePeering" awsPrivateNetworkInterface = "AwsPrivateNetworkInterface" gcpPeering = "GcpPeering" - gcpEgressPrivateServiceConnect = "GcpEgressPrivateServiceConnect" - gcpIngressPrivateServiceConnect = "GcpIngressPrivateServiceConnect" + gcpEgressPrivateLink = "GcpEgressPrivateLink" + gcpIngressPrivateLink = "GcpIngressPrivateLink" azureIngressPrivateLink = "AzureIngressPrivateLink" ) var ( createGatewayTypes = []string{"egress-privatelink", "ingress-privatelink", "private-network-interface", "ingress-private-service-connect"} - listGatewayTypes = []string{"aws-egress-privatelink", "aws-ingress-privatelink", "azure-egress-privatelink", "azure-ingress-privatelink", "gcp-egress-private-service-connect", "gcp-ingress-private-service-connect"} // TODO: check if we accept private-network-interface here + listGatewayTypes = []string{"aws-egress-privatelink", "aws-ingress-privatelink", "azure-egress-privatelink", "azure-ingress-privatelink", "gcp-egress-privatelink", "gcp-ingress-privatelink", "gcp-egress-private-service-connect", "gcp-ingress-private-service-connect"} gatewayTypeMap = map[string]string{ "aws-egress-privatelink": awsEgressPrivateLink, "aws-ingress-privatelink": awsIngressPrivateLink, "azure-egress-privatelink": azureEgressPrivateLink, "azure-ingress-privatelink": azureIngressPrivateLink, - "gcp-egress-private-service-connect": gcpEgressPrivateServiceConnect, - "gcp-ingress-private-service-connect": gcpIngressPrivateServiceConnect, + "gcp-egress-privatelink": gcpEgressPrivateLink, + "gcp-ingress-privatelink": gcpIngressPrivateLink, + "gcp-egress-private-service-connect": gcpEgressPrivateLink, + "gcp-ingress-private-service-connect": gcpIngressPrivateLink, } ) @@ -199,11 +201,11 @@ func getGatewayType(gateway networkinggatewayv1.NetworkingV1Gateway) (string, er } if config.NetworkingV1GcpEgressPrivateServiceConnectGatewaySpec != nil { - return gcpEgressPrivateServiceConnect, nil + return gcpEgressPrivateLink, nil } if config.NetworkingV1GcpIngressPrivateServiceConnectGatewaySpec != nil { - return gcpIngressPrivateServiceConnect, nil + return gcpIngressPrivateLink, nil } return "", fmt.Errorf(errors.CorruptedNetworkResponseErrorMsg, "config") @@ -253,10 +255,10 @@ func printGatewayTable(cmd *cobra.Command, gateway networkinggatewayv1.Networkin out.Region = gateway.Spec.Config.NetworkingV1AwsPrivateNetworkInterfaceGatewaySpec.GetRegion() out.Zones = gateway.Spec.Config.NetworkingV1AwsPrivateNetworkInterfaceGatewaySpec.GetZones() } - if gatewayType == gcpEgressPrivateServiceConnect { + if gatewayType == gcpEgressPrivateLink { out.Region = gateway.Spec.Config.NetworkingV1GcpEgressPrivateServiceConnectGatewaySpec.GetRegion() } - if gatewayType == gcpIngressPrivateServiceConnect { + if gatewayType == gcpIngressPrivateLink { out.Region = gateway.Spec.Config.NetworkingV1GcpIngressPrivateServiceConnectGatewaySpec.GetRegion() } if gatewayType == gcpPeering { @@ -280,9 +282,9 @@ func printGatewayTable(cmd *cobra.Command, gateway networkinggatewayv1.Networkin out.AzurePrivateLinkServiceResourceId = gateway.Status.CloudGateway.NetworkingV1AzureIngressPrivateLinkGatewayStatus.GetPrivateLinkServiceResourceId() } case pcloud.Gcp: - if gatewayType == gcpEgressPrivateServiceConnect { + if gatewayType == gcpEgressPrivateLink { out.GcpProject = gateway.Status.CloudGateway.NetworkingV1GcpEgressPrivateServiceConnectGatewayStatus.GetProject() - } else if gatewayType == gcpIngressPrivateServiceConnect { + } else if gatewayType == gcpIngressPrivateLink { out.GcpPrivateServiceConnectServiceAttachment = gateway.Status.CloudGateway.NetworkingV1GcpIngressPrivateServiceConnectGatewayStatus.GetPrivateServiceConnectServiceAttachment() } else if gatewayType == gcpPeering { out.GcpIamPrincipal = gateway.Status.CloudGateway.NetworkingV1GcpPeeringGatewayStatus.GetIamPrincipal() diff --git a/internal/network/command_gateway_list.go b/internal/network/command_gateway_list.go index f7fdf0dc6a..24ee7553fe 100644 --- a/internal/network/command_gateway_list.go +++ b/internal/network/command_gateway_list.go @@ -131,10 +131,10 @@ func (c *command) gatewayList(cmd *cobra.Command, _ []string) error { if gateway.Spec.Config != nil && gateway.Spec.Config.NetworkingV1GcpPeeringGatewaySpec != nil { out.Region = gateway.Spec.Config.NetworkingV1GcpPeeringGatewaySpec.GetRegion() } - if gatewayType == gcpEgressPrivateServiceConnect { + if gatewayType == gcpEgressPrivateLink { out.Region = gateway.Spec.Config.NetworkingV1GcpEgressPrivateServiceConnectGatewaySpec.GetRegion() } - if gatewayType == gcpIngressPrivateServiceConnect { + if gatewayType == gcpIngressPrivateLink { out.Region = gateway.Spec.Config.NetworkingV1GcpIngressPrivateServiceConnectGatewaySpec.GetRegion() } @@ -155,9 +155,9 @@ func (c *command) gatewayList(cmd *cobra.Command, _ []string) error { out.AzurePrivateLinkServiceResourceId = gateway.Status.CloudGateway.NetworkingV1AzureIngressPrivateLinkGatewayStatus.GetPrivateLinkServiceResourceId() } case pcloud.Gcp: - if gatewayType == gcpEgressPrivateServiceConnect { + if gatewayType == gcpEgressPrivateLink { out.GcpProject = gateway.Status.CloudGateway.NetworkingV1GcpEgressPrivateServiceConnectGatewayStatus.GetProject() - } else if gatewayType == gcpIngressPrivateServiceConnect { + } else if gatewayType == gcpIngressPrivateLink { out.GcpPrivateServiceConnectServiceAttachment = gateway.Status.CloudGateway.NetworkingV1GcpIngressPrivateServiceConnectGatewayStatus.GetPrivateServiceConnectServiceAttachment() } else if gatewayType == gcpPeering { out.GcpIamPrincipal = gateway.Status.CloudGateway.NetworkingV1GcpPeeringGatewayStatus.GetIamPrincipal() diff --git a/test/fixtures/output/network/gateway/create-gcp-ingress.golden b/test/fixtures/output/network/gateway/create-gcp-ingress.golden index c1a4bc3883..842cc02120 100644 --- a/test/fixtures/output/network/gateway/create-gcp-ingress.golden +++ b/test/fixtures/output/network/gateway/create-gcp-ingress.golden @@ -4,7 +4,7 @@ warning: GOCOVERDIR not set, no coverage data emitted | Name | my-gcp-ingress-gateway | | Environment | env-596 | | Region | us-central1 | -| Type | GcpIngressPrivateServiceConnect | +| Type | GcpIngressPrivateLink | | GCP PSC Service Attachment | projects/traffic-prod/regions/us-central1/serviceAttachments/plattg-abc123-service-attachment | | Phase | READY | +----------------------------+-----------------------------------------------------------------------------------------------+ diff --git a/test/fixtures/output/network/gateway/describe-gcp-ingress.golden b/test/fixtures/output/network/gateway/describe-gcp-ingress.golden index a8a8e113c7..0cd09140b4 100644 --- a/test/fixtures/output/network/gateway/describe-gcp-ingress.golden +++ b/test/fixtures/output/network/gateway/describe-gcp-ingress.golden @@ -4,7 +4,7 @@ warning: GOCOVERDIR not set, no coverage data emitted | Name | my-gcp-ingress-gateway | | Environment | env-596 | | Region | us-central1 | -| Type | GcpIngressPrivateServiceConnect | +| Type | GcpIngressPrivateLink | | GCP PSC Service Attachment | projects/traffic-prod/regions/us-central1/serviceAttachments/plattg-abc123-service-attachment | | Phase | READY | +----------------------------+-----------------------------------------------------------------------------------------------+ diff --git a/test/fixtures/output/network/gateway/describe-gcp.golden b/test/fixtures/output/network/gateway/describe-gcp.golden index 4e0fceda67..205b864eb3 100644 --- a/test/fixtures/output/network/gateway/describe-gcp.golden +++ b/test/fixtures/output/network/gateway/describe-gcp.golden @@ -1,10 +1,10 @@ warning: GOCOVERDIR not set, no coverage data emitted -+-------------+--------------------------------+ -| ID | gw-07531 | -| Name | my-gcp-gateway | -| Environment | env-596 | -| Region | eastus | -| Type | GcpEgressPrivateServiceConnect | -| GCP Project | project-12345 | -| Phase | READY | -+-------------+--------------------------------+ ++-------------+----------------------+ +| ID | gw-07531 | +| Name | my-gcp-gateway | +| Environment | env-596 | +| Region | eastus | +| Type | GcpEgressPrivateLink | +| GCP Project | project-12345 | +| Phase | READY | ++-------------+----------------------+ diff --git a/test/fixtures/output/network/gateway/list-filter-id.golden b/test/fixtures/output/network/gateway/list-filter-id.golden index 0e62e18fae..8d74d48ae9 100644 --- a/test/fixtures/output/network/gateway/list-filter-id.golden +++ b/test/fixtures/output/network/gateway/list-filter-id.golden @@ -1,2 +1,5 @@ warning: GOCOVERDIR not set, no coverage data emitted -None found. + ID | Name | Environment | Region | Type | AWS Principal ARN | VPC Endpoint Service Name | Azure Subscription | Azure Private Link Service | Azure Private Link Resource ID | GCP IAM Principal | GCP Project | GCP PSC Service Attachment | Phase | Zones | Account | Error Message + | | | | | | | | Alias | | | | | | | | +-----------+----------------+-------------+-----------+----------------------+--------------------------------+---------------------------+--------------------+--------------------------------+--------------------------------+-------------------+-------------+----------------------------+-------+-------+---------+---------------- + gw-12345 | my-aws-gateway | env-596 | us-east-1 | AwsEgressPrivateLink | arn:aws:iam::123456789012:role | | | | | | | | READY | | | diff --git a/test/fixtures/output/network/gateway/list-filter-multiple.golden b/test/fixtures/output/network/gateway/list-filter-multiple.golden index 0e62e18fae..8d74d48ae9 100644 --- a/test/fixtures/output/network/gateway/list-filter-multiple.golden +++ b/test/fixtures/output/network/gateway/list-filter-multiple.golden @@ -1,2 +1,5 @@ warning: GOCOVERDIR not set, no coverage data emitted -None found. + ID | Name | Environment | Region | Type | AWS Principal ARN | VPC Endpoint Service Name | Azure Subscription | Azure Private Link Service | Azure Private Link Resource ID | GCP IAM Principal | GCP Project | GCP PSC Service Attachment | Phase | Zones | Account | Error Message + | | | | | | | | Alias | | | | | | | | +-----------+----------------+-------------+-----------+----------------------+--------------------------------+---------------------------+--------------------+--------------------------------+--------------------------------+-------------------+-------------+----------------------------+-------+-------+---------+---------------- + gw-12345 | my-aws-gateway | env-596 | us-east-1 | AwsEgressPrivateLink | arn:aws:iam::123456789012:role | | | | | | | | READY | | | diff --git a/test/fixtures/output/network/gateway/list-filter-name.golden b/test/fixtures/output/network/gateway/list-filter-name.golden index 0e62e18fae..b7b6962b49 100644 --- a/test/fixtures/output/network/gateway/list-filter-name.golden +++ b/test/fixtures/output/network/gateway/list-filter-name.golden @@ -1,2 +1,6 @@ warning: GOCOVERDIR not set, no coverage data emitted -None found. + ID | Name | Environment | Region | Type | AWS Principal ARN | VPC Endpoint Service Name | Azure Subscription | Azure Private Link Service | Azure Private Link Resource ID | GCP IAM Principal | GCP Project | GCP PSC Service Attachment | Phase | Zones | Account | Error Message + | | | | | | | | Alias | | | | | | | | +-----------+----------------+-------------+-----------+----------------------------+--------------------------------+---------------------------+--------------------+--------------------------------+--------------------------------+-------------------+-------------+----------------------------+-------+------------------------+--------------+---------------- + gw-12345 | my-aws-gateway | env-596 | us-east-1 | AwsEgressPrivateLink | arn:aws:iam::123456789012:role | | | | | | | | READY | | | + gw-23456 | my-aws-gateway | env-596 | us-east-2 | AwsPrivateNetworkInterface | | | | | | | | | READY | us-east-2a, us-east-2b | 000000000000 | diff --git a/test/fixtures/output/network/gateway/list-filter-phase.golden b/test/fixtures/output/network/gateway/list-filter-phase.golden index 0e62e18fae..bcda3bdb59 100644 --- a/test/fixtures/output/network/gateway/list-filter-phase.golden +++ b/test/fixtures/output/network/gateway/list-filter-phase.golden @@ -1,2 +1,14 @@ warning: GOCOVERDIR not set, no coverage data emitted -None found. + ID | Name | Environment | Region | Type | AWS Principal ARN | VPC Endpoint Service Name | Azure Subscription | Azure Private Link Service | Azure Private Link Resource ID | GCP IAM Principal | GCP Project | GCP PSC Service Attachment | Phase | Zones | Account | Error Message + | | | | | | | | Alias | | | | | | | | +-----------+--------------------------+-------------+-------------+----------------------------+--------------------------------+---------------------------------------------------------+--------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------+---------------+-----------------------------------------------------------------------------------------------+-------+------------------------+--------------+---------------- + gw-07531 | my-gcp-gateway | env-596 | eastus | GcpEgressPrivateLink | | | | | | | project-12345 | | READY | | | + gw-09876 | my-azure-peering-gateway | env-596 | eastus2 | AzurePeering | | | | | | | | | READY | | | + gw-11111 | my-azure-ingress-gateway | env-596 | eastus2 | AzureIngressPrivateLink | | | | azure-ingress-pl.eastus2.azure.privatelinkservice | /subscriptions/aa000000-a000-0a00-00aa-0000aaa0a0a0/resourceGroups/rg-1/providers/Microsoft.Network/privateLinkServices/azure-ingress-pl | | | | READY | | | + gw-12345 | my-aws-gateway | env-596 | us-east-1 | AwsEgressPrivateLink | arn:aws:iam::123456789012:role | | | | | | | | READY | | | + gw-13570 | my-gcp-peering-gateway | env-596 | eastus2 | GcpPeering | | | | | | g000000-a000-0a00-00aa-0000aaa0a0a0 | | | READY | | | + gw-23456 | my-aws-gateway | env-596 | us-east-2 | AwsPrivateNetworkInterface | | | | | | | | | READY | us-east-2a, us-east-2b | 000000000000 | + gw-54321 | my-aws-peering-gateway | env-596 | us-east-2 | AwsPeering | | | | | | | | | READY | | | + gw-67890 | my-azure-gateway | env-596 | eastus | AzureEgressPrivateLink | | | aa000000-a000-0a00-00aa-0000aaa0a0a0 | | | | | | READY | | | + gw-88888 | my-aws-ingress-gateway | env-596 | us-west-2 | AwsIngressPrivateLink | | com.amazonaws.vpce.us-west-2.vpce-svc-00000000000000000 | | | | | | | READY | | | + gw-99999 | my-gcp-ingress-gateway | env-596 | us-central1 | GcpIngressPrivateLink | | | | | | | | projects/traffic-prod/regions/us-central1/serviceAttachments/plattg-abc123-service-attachment | READY | | | diff --git a/test/fixtures/output/network/gateway/list-filter-region.golden b/test/fixtures/output/network/gateway/list-filter-region.golden index 0e62e18fae..8d74d48ae9 100644 --- a/test/fixtures/output/network/gateway/list-filter-region.golden +++ b/test/fixtures/output/network/gateway/list-filter-region.golden @@ -1,2 +1,5 @@ warning: GOCOVERDIR not set, no coverage data emitted -None found. + ID | Name | Environment | Region | Type | AWS Principal ARN | VPC Endpoint Service Name | Azure Subscription | Azure Private Link Service | Azure Private Link Resource ID | GCP IAM Principal | GCP Project | GCP PSC Service Attachment | Phase | Zones | Account | Error Message + | | | | | | | | Alias | | | | | | | | +-----------+----------------+-------------+-----------+----------------------+--------------------------------+---------------------------+--------------------+--------------------------------+--------------------------------+-------------------+-------------+----------------------------+-------+-------+---------+---------------- + gw-12345 | my-aws-gateway | env-596 | us-east-1 | AwsEgressPrivateLink | arn:aws:iam::123456789012:role | | | | | | | | READY | | | diff --git a/test/fixtures/output/network/gateway/list-filter-type.golden b/test/fixtures/output/network/gateway/list-filter-type.golden index 0e62e18fae..8d74d48ae9 100644 --- a/test/fixtures/output/network/gateway/list-filter-type.golden +++ b/test/fixtures/output/network/gateway/list-filter-type.golden @@ -1,2 +1,5 @@ warning: GOCOVERDIR not set, no coverage data emitted -None found. + ID | Name | Environment | Region | Type | AWS Principal ARN | VPC Endpoint Service Name | Azure Subscription | Azure Private Link Service | Azure Private Link Resource ID | GCP IAM Principal | GCP Project | GCP PSC Service Attachment | Phase | Zones | Account | Error Message + | | | | | | | | Alias | | | | | | | | +-----------+----------------+-------------+-----------+----------------------+--------------------------------+---------------------------+--------------------+--------------------------------+--------------------------------+-------------------+-------------+----------------------------+-------+-------+---------+---------------- + gw-12345 | my-aws-gateway | env-596 | us-east-1 | AwsEgressPrivateLink | arn:aws:iam::123456789012:role | | | | | | | | READY | | | diff --git a/test/fixtures/output/network/gateway/list-json.golden b/test/fixtures/output/network/gateway/list-json.golden index ef00585a79..c95e2b6823 100644 --- a/test/fixtures/output/network/gateway/list-json.golden +++ b/test/fixtures/output/network/gateway/list-json.golden @@ -5,7 +5,7 @@ warning: GOCOVERDIR not set, no coverage data emitted "name": "my-gcp-gateway", "environment": "env-596", "region": "eastus", - "type": "GcpEgressPrivateServiceConnect", + "type": "GcpEgressPrivateLink", "gcp_project": "project-12345", "phase": "READY" }, @@ -86,7 +86,7 @@ warning: GOCOVERDIR not set, no coverage data emitted "name": "my-gcp-ingress-gateway", "environment": "env-596", "region": "us-central1", - "type": "GcpIngressPrivateServiceConnect", + "type": "GcpIngressPrivateLink", "gcp_private_service_connect_service_attachment": "projects/traffic-prod/regions/us-central1/serviceAttachments/plattg-abc123-service-attachment", "phase": "READY" } diff --git a/test/fixtures/output/network/gateway/list.golden b/test/fixtures/output/network/gateway/list.golden index 53f8f24792..bcda3bdb59 100644 --- a/test/fixtures/output/network/gateway/list.golden +++ b/test/fixtures/output/network/gateway/list.golden @@ -1,14 +1,14 @@ warning: GOCOVERDIR not set, no coverage data emitted - ID | Name | Environment | Region | Type | AWS Principal ARN | VPC Endpoint Service Name | Azure Subscription | Azure Private Link Service | Azure Private Link Resource ID | GCP IAM Principal | GCP Project | GCP PSC Service Attachment | Phase | Zones | Account | Error Message - | | | | | | | | Alias | | | | | | | | ------------+--------------------------+-------------+-------------+---------------------------------+--------------------------------+---------------------------------------------------------+--------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------+---------------+-----------------------------------------------------------------------------------------------+-------+------------------------+--------------+---------------- - gw-07531 | my-gcp-gateway | env-596 | eastus | GcpEgressPrivateServiceConnect | | | | | | | project-12345 | | READY | | | - gw-09876 | my-azure-peering-gateway | env-596 | eastus2 | AzurePeering | | | | | | | | | READY | | | - gw-11111 | my-azure-ingress-gateway | env-596 | eastus2 | AzureIngressPrivateLink | | | | azure-ingress-pl.eastus2.azure.privatelinkservice | /subscriptions/aa000000-a000-0a00-00aa-0000aaa0a0a0/resourceGroups/rg-1/providers/Microsoft.Network/privateLinkServices/azure-ingress-pl | | | | READY | | | - gw-12345 | my-aws-gateway | env-596 | us-east-1 | AwsEgressPrivateLink | arn:aws:iam::123456789012:role | | | | | | | | READY | | | - gw-13570 | my-gcp-peering-gateway | env-596 | eastus2 | GcpPeering | | | | | | g000000-a000-0a00-00aa-0000aaa0a0a0 | | | READY | | | - gw-23456 | my-aws-gateway | env-596 | us-east-2 | AwsPrivateNetworkInterface | | | | | | | | | READY | us-east-2a, us-east-2b | 000000000000 | - gw-54321 | my-aws-peering-gateway | env-596 | us-east-2 | AwsPeering | | | | | | | | | READY | | | - gw-67890 | my-azure-gateway | env-596 | eastus | AzureEgressPrivateLink | | | aa000000-a000-0a00-00aa-0000aaa0a0a0 | | | | | | READY | | | - gw-88888 | my-aws-ingress-gateway | env-596 | us-west-2 | AwsIngressPrivateLink | | com.amazonaws.vpce.us-west-2.vpce-svc-00000000000000000 | | | | | | | READY | | | - gw-99999 | my-gcp-ingress-gateway | env-596 | us-central1 | GcpIngressPrivateServiceConnect | | | | | | | | projects/traffic-prod/regions/us-central1/serviceAttachments/plattg-abc123-service-attachment | READY | | | + ID | Name | Environment | Region | Type | AWS Principal ARN | VPC Endpoint Service Name | Azure Subscription | Azure Private Link Service | Azure Private Link Resource ID | GCP IAM Principal | GCP Project | GCP PSC Service Attachment | Phase | Zones | Account | Error Message + | | | | | | | | Alias | | | | | | | | +-----------+--------------------------+-------------+-------------+----------------------------+--------------------------------+---------------------------------------------------------+--------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------+---------------+-----------------------------------------------------------------------------------------------+-------+------------------------+--------------+---------------- + gw-07531 | my-gcp-gateway | env-596 | eastus | GcpEgressPrivateLink | | | | | | | project-12345 | | READY | | | + gw-09876 | my-azure-peering-gateway | env-596 | eastus2 | AzurePeering | | | | | | | | | READY | | | + gw-11111 | my-azure-ingress-gateway | env-596 | eastus2 | AzureIngressPrivateLink | | | | azure-ingress-pl.eastus2.azure.privatelinkservice | /subscriptions/aa000000-a000-0a00-00aa-0000aaa0a0a0/resourceGroups/rg-1/providers/Microsoft.Network/privateLinkServices/azure-ingress-pl | | | | READY | | | + gw-12345 | my-aws-gateway | env-596 | us-east-1 | AwsEgressPrivateLink | arn:aws:iam::123456789012:role | | | | | | | | READY | | | + gw-13570 | my-gcp-peering-gateway | env-596 | eastus2 | GcpPeering | | | | | | g000000-a000-0a00-00aa-0000aaa0a0a0 | | | READY | | | + gw-23456 | my-aws-gateway | env-596 | us-east-2 | AwsPrivateNetworkInterface | | | | | | | | | READY | us-east-2a, us-east-2b | 000000000000 | + gw-54321 | my-aws-peering-gateway | env-596 | us-east-2 | AwsPeering | | | | | | | | | READY | | | + gw-67890 | my-azure-gateway | env-596 | eastus | AzureEgressPrivateLink | | | aa000000-a000-0a00-00aa-0000aaa0a0a0 | | | | | | READY | | | + gw-88888 | my-aws-ingress-gateway | env-596 | us-west-2 | AwsIngressPrivateLink | | com.amazonaws.vpce.us-west-2.vpce-svc-00000000000000000 | | | | | | | READY | | | + gw-99999 | my-gcp-ingress-gateway | env-596 | us-central1 | GcpIngressPrivateLink | | | | | | | | projects/traffic-prod/regions/us-central1/serviceAttachments/plattg-abc123-service-attachment | READY | | | diff --git a/test/test-server/networking_handlers.go b/test/test-server/networking_handlers.go index cfd6a76c4a..d637e21348 100644 --- a/test/test-server/networking_handlers.go +++ b/test/test-server/networking_handlers.go @@ -2668,10 +2668,10 @@ func getGatewayTypeFromSpec(gateway networkinggatewayv1.NetworkingV1Gateway) str return "GcpPeering" } if config.NetworkingV1GcpEgressPrivateServiceConnectGatewaySpec != nil { - return "GcpEgressPrivateServiceConnect" + return "GcpEgressPrivateLink" } if config.NetworkingV1GcpIngressPrivateServiceConnectGatewaySpec != nil { - return "GcpIngressPrivateServiceConnect" + return "GcpIngressPrivateLink" } return "" } From 93956816ed1a6148199a4e7382d4c8dd02619645 Mon Sep 17 00:00:00 2001 From: Andrew Veenstra Date: Fri, 3 Apr 2026 17:38:02 -0400 Subject: [PATCH 6/6] Accept gcp-*-privatelink as gateway type filter while keeping display names The API accepts GcpEgressPrivateLink/GcpIngressPrivateLink for type filtering, but the CLI only accepted gcp-*-private-service-connect. Now accepts both gcp-*-privatelink and gcp-*-private-service-connect as filter input, while keeping GcpEgressPrivateServiceConnect and GcpIngressPrivateServiceConnect as the displayed type names. Co-Authored-By: Claude Opus 4.6 --- internal/network/command_gateway.go | 24 ++++++++--------- internal/network/command_gateway_list.go | 8 +++--- .../network/gateway/create-gcp-ingress.golden | 2 +- .../gateway/describe-gcp-ingress.golden | 2 +- .../network/gateway/describe-gcp.golden | 18 ++++++------- .../network/gateway/list-filter-phase.golden | 26 +++++++++---------- .../output/network/gateway/list-json.golden | 4 +-- .../output/network/gateway/list.golden | 26 +++++++++---------- test/test-server/networking_handlers.go | 4 +-- 9 files changed, 57 insertions(+), 57 deletions(-) diff --git a/internal/network/command_gateway.go b/internal/network/command_gateway.go index 9c549755e8..b206bac348 100644 --- a/internal/network/command_gateway.go +++ b/internal/network/command_gateway.go @@ -24,8 +24,8 @@ const ( azurePeering = "AzurePeering" awsPrivateNetworkInterface = "AwsPrivateNetworkInterface" gcpPeering = "GcpPeering" - gcpEgressPrivateLink = "GcpEgressPrivateLink" - gcpIngressPrivateLink = "GcpIngressPrivateLink" + gcpEgressPrivateServiceConnect = "GcpEgressPrivateServiceConnect" + gcpIngressPrivateServiceConnect = "GcpIngressPrivateServiceConnect" azureIngressPrivateLink = "AzureIngressPrivateLink" ) @@ -37,10 +37,10 @@ var ( "aws-ingress-privatelink": awsIngressPrivateLink, "azure-egress-privatelink": azureEgressPrivateLink, "azure-ingress-privatelink": azureIngressPrivateLink, - "gcp-egress-privatelink": gcpEgressPrivateLink, - "gcp-ingress-privatelink": gcpIngressPrivateLink, - "gcp-egress-private-service-connect": gcpEgressPrivateLink, - "gcp-ingress-private-service-connect": gcpIngressPrivateLink, + "gcp-egress-privatelink": "GcpEgressPrivateLink", + "gcp-ingress-privatelink": "GcpIngressPrivateLink", + "gcp-egress-private-service-connect": "GcpEgressPrivateLink", + "gcp-ingress-private-service-connect": "GcpIngressPrivateLink", } ) @@ -201,11 +201,11 @@ func getGatewayType(gateway networkinggatewayv1.NetworkingV1Gateway) (string, er } if config.NetworkingV1GcpEgressPrivateServiceConnectGatewaySpec != nil { - return gcpEgressPrivateLink, nil + return gcpEgressPrivateServiceConnect, nil } if config.NetworkingV1GcpIngressPrivateServiceConnectGatewaySpec != nil { - return gcpIngressPrivateLink, nil + return gcpIngressPrivateServiceConnect, nil } return "", fmt.Errorf(errors.CorruptedNetworkResponseErrorMsg, "config") @@ -255,10 +255,10 @@ func printGatewayTable(cmd *cobra.Command, gateway networkinggatewayv1.Networkin out.Region = gateway.Spec.Config.NetworkingV1AwsPrivateNetworkInterfaceGatewaySpec.GetRegion() out.Zones = gateway.Spec.Config.NetworkingV1AwsPrivateNetworkInterfaceGatewaySpec.GetZones() } - if gatewayType == gcpEgressPrivateLink { + if gatewayType == gcpEgressPrivateServiceConnect { out.Region = gateway.Spec.Config.NetworkingV1GcpEgressPrivateServiceConnectGatewaySpec.GetRegion() } - if gatewayType == gcpIngressPrivateLink { + if gatewayType == gcpIngressPrivateServiceConnect { out.Region = gateway.Spec.Config.NetworkingV1GcpIngressPrivateServiceConnectGatewaySpec.GetRegion() } if gatewayType == gcpPeering { @@ -282,9 +282,9 @@ func printGatewayTable(cmd *cobra.Command, gateway networkinggatewayv1.Networkin out.AzurePrivateLinkServiceResourceId = gateway.Status.CloudGateway.NetworkingV1AzureIngressPrivateLinkGatewayStatus.GetPrivateLinkServiceResourceId() } case pcloud.Gcp: - if gatewayType == gcpEgressPrivateLink { + if gatewayType == gcpEgressPrivateServiceConnect { out.GcpProject = gateway.Status.CloudGateway.NetworkingV1GcpEgressPrivateServiceConnectGatewayStatus.GetProject() - } else if gatewayType == gcpIngressPrivateLink { + } else if gatewayType == gcpIngressPrivateServiceConnect { out.GcpPrivateServiceConnectServiceAttachment = gateway.Status.CloudGateway.NetworkingV1GcpIngressPrivateServiceConnectGatewayStatus.GetPrivateServiceConnectServiceAttachment() } else if gatewayType == gcpPeering { out.GcpIamPrincipal = gateway.Status.CloudGateway.NetworkingV1GcpPeeringGatewayStatus.GetIamPrincipal() diff --git a/internal/network/command_gateway_list.go b/internal/network/command_gateway_list.go index 24ee7553fe..f7fdf0dc6a 100644 --- a/internal/network/command_gateway_list.go +++ b/internal/network/command_gateway_list.go @@ -131,10 +131,10 @@ func (c *command) gatewayList(cmd *cobra.Command, _ []string) error { if gateway.Spec.Config != nil && gateway.Spec.Config.NetworkingV1GcpPeeringGatewaySpec != nil { out.Region = gateway.Spec.Config.NetworkingV1GcpPeeringGatewaySpec.GetRegion() } - if gatewayType == gcpEgressPrivateLink { + if gatewayType == gcpEgressPrivateServiceConnect { out.Region = gateway.Spec.Config.NetworkingV1GcpEgressPrivateServiceConnectGatewaySpec.GetRegion() } - if gatewayType == gcpIngressPrivateLink { + if gatewayType == gcpIngressPrivateServiceConnect { out.Region = gateway.Spec.Config.NetworkingV1GcpIngressPrivateServiceConnectGatewaySpec.GetRegion() } @@ -155,9 +155,9 @@ func (c *command) gatewayList(cmd *cobra.Command, _ []string) error { out.AzurePrivateLinkServiceResourceId = gateway.Status.CloudGateway.NetworkingV1AzureIngressPrivateLinkGatewayStatus.GetPrivateLinkServiceResourceId() } case pcloud.Gcp: - if gatewayType == gcpEgressPrivateLink { + if gatewayType == gcpEgressPrivateServiceConnect { out.GcpProject = gateway.Status.CloudGateway.NetworkingV1GcpEgressPrivateServiceConnectGatewayStatus.GetProject() - } else if gatewayType == gcpIngressPrivateLink { + } else if gatewayType == gcpIngressPrivateServiceConnect { out.GcpPrivateServiceConnectServiceAttachment = gateway.Status.CloudGateway.NetworkingV1GcpIngressPrivateServiceConnectGatewayStatus.GetPrivateServiceConnectServiceAttachment() } else if gatewayType == gcpPeering { out.GcpIamPrincipal = gateway.Status.CloudGateway.NetworkingV1GcpPeeringGatewayStatus.GetIamPrincipal() diff --git a/test/fixtures/output/network/gateway/create-gcp-ingress.golden b/test/fixtures/output/network/gateway/create-gcp-ingress.golden index 842cc02120..c1a4bc3883 100644 --- a/test/fixtures/output/network/gateway/create-gcp-ingress.golden +++ b/test/fixtures/output/network/gateway/create-gcp-ingress.golden @@ -4,7 +4,7 @@ warning: GOCOVERDIR not set, no coverage data emitted | Name | my-gcp-ingress-gateway | | Environment | env-596 | | Region | us-central1 | -| Type | GcpIngressPrivateLink | +| Type | GcpIngressPrivateServiceConnect | | GCP PSC Service Attachment | projects/traffic-prod/regions/us-central1/serviceAttachments/plattg-abc123-service-attachment | | Phase | READY | +----------------------------+-----------------------------------------------------------------------------------------------+ diff --git a/test/fixtures/output/network/gateway/describe-gcp-ingress.golden b/test/fixtures/output/network/gateway/describe-gcp-ingress.golden index 0cd09140b4..a8a8e113c7 100644 --- a/test/fixtures/output/network/gateway/describe-gcp-ingress.golden +++ b/test/fixtures/output/network/gateway/describe-gcp-ingress.golden @@ -4,7 +4,7 @@ warning: GOCOVERDIR not set, no coverage data emitted | Name | my-gcp-ingress-gateway | | Environment | env-596 | | Region | us-central1 | -| Type | GcpIngressPrivateLink | +| Type | GcpIngressPrivateServiceConnect | | GCP PSC Service Attachment | projects/traffic-prod/regions/us-central1/serviceAttachments/plattg-abc123-service-attachment | | Phase | READY | +----------------------------+-----------------------------------------------------------------------------------------------+ diff --git a/test/fixtures/output/network/gateway/describe-gcp.golden b/test/fixtures/output/network/gateway/describe-gcp.golden index 205b864eb3..4e0fceda67 100644 --- a/test/fixtures/output/network/gateway/describe-gcp.golden +++ b/test/fixtures/output/network/gateway/describe-gcp.golden @@ -1,10 +1,10 @@ warning: GOCOVERDIR not set, no coverage data emitted -+-------------+----------------------+ -| ID | gw-07531 | -| Name | my-gcp-gateway | -| Environment | env-596 | -| Region | eastus | -| Type | GcpEgressPrivateLink | -| GCP Project | project-12345 | -| Phase | READY | -+-------------+----------------------+ ++-------------+--------------------------------+ +| ID | gw-07531 | +| Name | my-gcp-gateway | +| Environment | env-596 | +| Region | eastus | +| Type | GcpEgressPrivateServiceConnect | +| GCP Project | project-12345 | +| Phase | READY | ++-------------+--------------------------------+ diff --git a/test/fixtures/output/network/gateway/list-filter-phase.golden b/test/fixtures/output/network/gateway/list-filter-phase.golden index bcda3bdb59..53f8f24792 100644 --- a/test/fixtures/output/network/gateway/list-filter-phase.golden +++ b/test/fixtures/output/network/gateway/list-filter-phase.golden @@ -1,14 +1,14 @@ warning: GOCOVERDIR not set, no coverage data emitted - ID | Name | Environment | Region | Type | AWS Principal ARN | VPC Endpoint Service Name | Azure Subscription | Azure Private Link Service | Azure Private Link Resource ID | GCP IAM Principal | GCP Project | GCP PSC Service Attachment | Phase | Zones | Account | Error Message - | | | | | | | | Alias | | | | | | | | ------------+--------------------------+-------------+-------------+----------------------------+--------------------------------+---------------------------------------------------------+--------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------+---------------+-----------------------------------------------------------------------------------------------+-------+------------------------+--------------+---------------- - gw-07531 | my-gcp-gateway | env-596 | eastus | GcpEgressPrivateLink | | | | | | | project-12345 | | READY | | | - gw-09876 | my-azure-peering-gateway | env-596 | eastus2 | AzurePeering | | | | | | | | | READY | | | - gw-11111 | my-azure-ingress-gateway | env-596 | eastus2 | AzureIngressPrivateLink | | | | azure-ingress-pl.eastus2.azure.privatelinkservice | /subscriptions/aa000000-a000-0a00-00aa-0000aaa0a0a0/resourceGroups/rg-1/providers/Microsoft.Network/privateLinkServices/azure-ingress-pl | | | | READY | | | - gw-12345 | my-aws-gateway | env-596 | us-east-1 | AwsEgressPrivateLink | arn:aws:iam::123456789012:role | | | | | | | | READY | | | - gw-13570 | my-gcp-peering-gateway | env-596 | eastus2 | GcpPeering | | | | | | g000000-a000-0a00-00aa-0000aaa0a0a0 | | | READY | | | - gw-23456 | my-aws-gateway | env-596 | us-east-2 | AwsPrivateNetworkInterface | | | | | | | | | READY | us-east-2a, us-east-2b | 000000000000 | - gw-54321 | my-aws-peering-gateway | env-596 | us-east-2 | AwsPeering | | | | | | | | | READY | | | - gw-67890 | my-azure-gateway | env-596 | eastus | AzureEgressPrivateLink | | | aa000000-a000-0a00-00aa-0000aaa0a0a0 | | | | | | READY | | | - gw-88888 | my-aws-ingress-gateway | env-596 | us-west-2 | AwsIngressPrivateLink | | com.amazonaws.vpce.us-west-2.vpce-svc-00000000000000000 | | | | | | | READY | | | - gw-99999 | my-gcp-ingress-gateway | env-596 | us-central1 | GcpIngressPrivateLink | | | | | | | | projects/traffic-prod/regions/us-central1/serviceAttachments/plattg-abc123-service-attachment | READY | | | + ID | Name | Environment | Region | Type | AWS Principal ARN | VPC Endpoint Service Name | Azure Subscription | Azure Private Link Service | Azure Private Link Resource ID | GCP IAM Principal | GCP Project | GCP PSC Service Attachment | Phase | Zones | Account | Error Message + | | | | | | | | Alias | | | | | | | | +-----------+--------------------------+-------------+-------------+---------------------------------+--------------------------------+---------------------------------------------------------+--------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------+---------------+-----------------------------------------------------------------------------------------------+-------+------------------------+--------------+---------------- + gw-07531 | my-gcp-gateway | env-596 | eastus | GcpEgressPrivateServiceConnect | | | | | | | project-12345 | | READY | | | + gw-09876 | my-azure-peering-gateway | env-596 | eastus2 | AzurePeering | | | | | | | | | READY | | | + gw-11111 | my-azure-ingress-gateway | env-596 | eastus2 | AzureIngressPrivateLink | | | | azure-ingress-pl.eastus2.azure.privatelinkservice | /subscriptions/aa000000-a000-0a00-00aa-0000aaa0a0a0/resourceGroups/rg-1/providers/Microsoft.Network/privateLinkServices/azure-ingress-pl | | | | READY | | | + gw-12345 | my-aws-gateway | env-596 | us-east-1 | AwsEgressPrivateLink | arn:aws:iam::123456789012:role | | | | | | | | READY | | | + gw-13570 | my-gcp-peering-gateway | env-596 | eastus2 | GcpPeering | | | | | | g000000-a000-0a00-00aa-0000aaa0a0a0 | | | READY | | | + gw-23456 | my-aws-gateway | env-596 | us-east-2 | AwsPrivateNetworkInterface | | | | | | | | | READY | us-east-2a, us-east-2b | 000000000000 | + gw-54321 | my-aws-peering-gateway | env-596 | us-east-2 | AwsPeering | | | | | | | | | READY | | | + gw-67890 | my-azure-gateway | env-596 | eastus | AzureEgressPrivateLink | | | aa000000-a000-0a00-00aa-0000aaa0a0a0 | | | | | | READY | | | + gw-88888 | my-aws-ingress-gateway | env-596 | us-west-2 | AwsIngressPrivateLink | | com.amazonaws.vpce.us-west-2.vpce-svc-00000000000000000 | | | | | | | READY | | | + gw-99999 | my-gcp-ingress-gateway | env-596 | us-central1 | GcpIngressPrivateServiceConnect | | | | | | | | projects/traffic-prod/regions/us-central1/serviceAttachments/plattg-abc123-service-attachment | READY | | | diff --git a/test/fixtures/output/network/gateway/list-json.golden b/test/fixtures/output/network/gateway/list-json.golden index c95e2b6823..ef00585a79 100644 --- a/test/fixtures/output/network/gateway/list-json.golden +++ b/test/fixtures/output/network/gateway/list-json.golden @@ -5,7 +5,7 @@ warning: GOCOVERDIR not set, no coverage data emitted "name": "my-gcp-gateway", "environment": "env-596", "region": "eastus", - "type": "GcpEgressPrivateLink", + "type": "GcpEgressPrivateServiceConnect", "gcp_project": "project-12345", "phase": "READY" }, @@ -86,7 +86,7 @@ warning: GOCOVERDIR not set, no coverage data emitted "name": "my-gcp-ingress-gateway", "environment": "env-596", "region": "us-central1", - "type": "GcpIngressPrivateLink", + "type": "GcpIngressPrivateServiceConnect", "gcp_private_service_connect_service_attachment": "projects/traffic-prod/regions/us-central1/serviceAttachments/plattg-abc123-service-attachment", "phase": "READY" } diff --git a/test/fixtures/output/network/gateway/list.golden b/test/fixtures/output/network/gateway/list.golden index bcda3bdb59..53f8f24792 100644 --- a/test/fixtures/output/network/gateway/list.golden +++ b/test/fixtures/output/network/gateway/list.golden @@ -1,14 +1,14 @@ warning: GOCOVERDIR not set, no coverage data emitted - ID | Name | Environment | Region | Type | AWS Principal ARN | VPC Endpoint Service Name | Azure Subscription | Azure Private Link Service | Azure Private Link Resource ID | GCP IAM Principal | GCP Project | GCP PSC Service Attachment | Phase | Zones | Account | Error Message - | | | | | | | | Alias | | | | | | | | ------------+--------------------------+-------------+-------------+----------------------------+--------------------------------+---------------------------------------------------------+--------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------+---------------+-----------------------------------------------------------------------------------------------+-------+------------------------+--------------+---------------- - gw-07531 | my-gcp-gateway | env-596 | eastus | GcpEgressPrivateLink | | | | | | | project-12345 | | READY | | | - gw-09876 | my-azure-peering-gateway | env-596 | eastus2 | AzurePeering | | | | | | | | | READY | | | - gw-11111 | my-azure-ingress-gateway | env-596 | eastus2 | AzureIngressPrivateLink | | | | azure-ingress-pl.eastus2.azure.privatelinkservice | /subscriptions/aa000000-a000-0a00-00aa-0000aaa0a0a0/resourceGroups/rg-1/providers/Microsoft.Network/privateLinkServices/azure-ingress-pl | | | | READY | | | - gw-12345 | my-aws-gateway | env-596 | us-east-1 | AwsEgressPrivateLink | arn:aws:iam::123456789012:role | | | | | | | | READY | | | - gw-13570 | my-gcp-peering-gateway | env-596 | eastus2 | GcpPeering | | | | | | g000000-a000-0a00-00aa-0000aaa0a0a0 | | | READY | | | - gw-23456 | my-aws-gateway | env-596 | us-east-2 | AwsPrivateNetworkInterface | | | | | | | | | READY | us-east-2a, us-east-2b | 000000000000 | - gw-54321 | my-aws-peering-gateway | env-596 | us-east-2 | AwsPeering | | | | | | | | | READY | | | - gw-67890 | my-azure-gateway | env-596 | eastus | AzureEgressPrivateLink | | | aa000000-a000-0a00-00aa-0000aaa0a0a0 | | | | | | READY | | | - gw-88888 | my-aws-ingress-gateway | env-596 | us-west-2 | AwsIngressPrivateLink | | com.amazonaws.vpce.us-west-2.vpce-svc-00000000000000000 | | | | | | | READY | | | - gw-99999 | my-gcp-ingress-gateway | env-596 | us-central1 | GcpIngressPrivateLink | | | | | | | | projects/traffic-prod/regions/us-central1/serviceAttachments/plattg-abc123-service-attachment | READY | | | + ID | Name | Environment | Region | Type | AWS Principal ARN | VPC Endpoint Service Name | Azure Subscription | Azure Private Link Service | Azure Private Link Resource ID | GCP IAM Principal | GCP Project | GCP PSC Service Attachment | Phase | Zones | Account | Error Message + | | | | | | | | Alias | | | | | | | | +-----------+--------------------------+-------------+-------------+---------------------------------+--------------------------------+---------------------------------------------------------+--------------------------------------+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------+---------------+-----------------------------------------------------------------------------------------------+-------+------------------------+--------------+---------------- + gw-07531 | my-gcp-gateway | env-596 | eastus | GcpEgressPrivateServiceConnect | | | | | | | project-12345 | | READY | | | + gw-09876 | my-azure-peering-gateway | env-596 | eastus2 | AzurePeering | | | | | | | | | READY | | | + gw-11111 | my-azure-ingress-gateway | env-596 | eastus2 | AzureIngressPrivateLink | | | | azure-ingress-pl.eastus2.azure.privatelinkservice | /subscriptions/aa000000-a000-0a00-00aa-0000aaa0a0a0/resourceGroups/rg-1/providers/Microsoft.Network/privateLinkServices/azure-ingress-pl | | | | READY | | | + gw-12345 | my-aws-gateway | env-596 | us-east-1 | AwsEgressPrivateLink | arn:aws:iam::123456789012:role | | | | | | | | READY | | | + gw-13570 | my-gcp-peering-gateway | env-596 | eastus2 | GcpPeering | | | | | | g000000-a000-0a00-00aa-0000aaa0a0a0 | | | READY | | | + gw-23456 | my-aws-gateway | env-596 | us-east-2 | AwsPrivateNetworkInterface | | | | | | | | | READY | us-east-2a, us-east-2b | 000000000000 | + gw-54321 | my-aws-peering-gateway | env-596 | us-east-2 | AwsPeering | | | | | | | | | READY | | | + gw-67890 | my-azure-gateway | env-596 | eastus | AzureEgressPrivateLink | | | aa000000-a000-0a00-00aa-0000aaa0a0a0 | | | | | | READY | | | + gw-88888 | my-aws-ingress-gateway | env-596 | us-west-2 | AwsIngressPrivateLink | | com.amazonaws.vpce.us-west-2.vpce-svc-00000000000000000 | | | | | | | READY | | | + gw-99999 | my-gcp-ingress-gateway | env-596 | us-central1 | GcpIngressPrivateServiceConnect | | | | | | | | projects/traffic-prod/regions/us-central1/serviceAttachments/plattg-abc123-service-attachment | READY | | | diff --git a/test/test-server/networking_handlers.go b/test/test-server/networking_handlers.go index d637e21348..cfd6a76c4a 100644 --- a/test/test-server/networking_handlers.go +++ b/test/test-server/networking_handlers.go @@ -2668,10 +2668,10 @@ func getGatewayTypeFromSpec(gateway networkinggatewayv1.NetworkingV1Gateway) str return "GcpPeering" } if config.NetworkingV1GcpEgressPrivateServiceConnectGatewaySpec != nil { - return "GcpEgressPrivateLink" + return "GcpEgressPrivateServiceConnect" } if config.NetworkingV1GcpIngressPrivateServiceConnectGatewaySpec != nil { - return "GcpIngressPrivateLink" + return "GcpIngressPrivateServiceConnect" } return "" }