Skip to content

Commit

Permalink
Remove httpRoute type from Radius
Browse files Browse the repository at this point in the history
Fixes: radius-project#6099

This change removes the httpRoute type. We've already removed this from documentation and samples and so this is the final removal.

Feels good 👍
Signed-off-by: Ryan Nowak <nowakra@gmail.com>
  • Loading branch information
rynowak committed Apr 14, 2024
1 parent d4be47e commit 2a6c9e6
Show file tree
Hide file tree
Showing 102 changed files with 354 additions and 3,746 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Today, the [functional tests](https://github.com/radius-project/radius/tree/main
|environment|env|
|container|ctnr|
|gateway|gtwy|
|httpRoute|rte|
|generic|gnrc|
|servicebus|sb|
|secretstore|scs|
Expand All @@ -32,8 +31,8 @@ resource gateway 'Applications.Core/gateways@2023-10-01-preview' = {
...
}
resource frontendRoute 'Applications.Core/httpRoutes@2023-10-01-preview' = {
name: 'gtwy-front-rte'
resource frontend 'Applications.Core/containers@2023-10-01-preview' = {
name: 'gtwy-front-cntr'
...
}
```
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion hack/bicep-types-radius/generated/index.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"Resources":{"Applications.Core/applications@2023-10-01-preview":{"RelativePath":"applications/applications.core/2023-10-01-preview/types.json","Index":58},"Applications.Core/containers@2023-10-01-preview":{"RelativePath":"applications/applications.core/2023-10-01-preview/types.json","Index":123},"Applications.Core/environments@2023-10-01-preview":{"RelativePath":"applications/applications.core/2023-10-01-preview/types.json","Index":158},"Applications.Core/extenders@2023-10-01-preview":{"RelativePath":"applications/applications.core/2023-10-01-preview/types.json","Index":176},"Applications.Core/gateways@2023-10-01-preview":{"RelativePath":"applications/applications.core/2023-10-01-preview/types.json","Index":197},"Applications.Core/httpRoutes@2023-10-01-preview":{"RelativePath":"applications/applications.core/2023-10-01-preview/types.json","Index":211},"Applications.Core/secretStores@2023-10-01-preview":{"RelativePath":"applications/applications.core/2023-10-01-preview/types.json","Index":234},"Applications.Core/volumes@2023-10-01-preview":{"RelativePath":"applications/applications.core/2023-10-01-preview/types.json","Index":271},"Applications.Dapr/pubSubBrokers@2023-10-01-preview":{"RelativePath":"applications/applications.dapr/2023-10-01-preview/types.json","Index":49},"Applications.Dapr/secretStores@2023-10-01-preview":{"RelativePath":"applications/applications.dapr/2023-10-01-preview/types.json","Index":66},"Applications.Dapr/stateStores@2023-10-01-preview":{"RelativePath":"applications/applications.dapr/2023-10-01-preview/types.json","Index":84},"Applications.Datastores/mongoDatabases@2023-10-01-preview":{"RelativePath":"applications/applications.datastores/2023-10-01-preview/types.json","Index":50},"Applications.Datastores/redisCaches@2023-10-01-preview":{"RelativePath":"applications/applications.datastores/2023-10-01-preview/types.json","Index":69},"Applications.Datastores/sqlDatabases@2023-10-01-preview":{"RelativePath":"applications/applications.datastores/2023-10-01-preview/types.json","Index":88},"Applications.Messaging/rabbitMQQueues@2023-10-01-preview":{"RelativePath":"applications/applications.messaging/2023-10-01-preview/types.json","Index":50}},"Functions":{"applications.core/extenders":{"2023-10-01-preview":[{"RelativePath":"applications/applications.core/2023-10-01-preview/types.json","Index":272}]},"applications.core/secretstores":{"2023-10-01-preview":[{"RelativePath":"applications/applications.core/2023-10-01-preview/types.json","Index":278}]},"applications.datastores/mongodatabases":{"2023-10-01-preview":[{"RelativePath":"applications/applications.datastores/2023-10-01-preview/types.json","Index":90}]},"applications.datastores/rediscaches":{"2023-10-01-preview":[{"RelativePath":"applications/applications.datastores/2023-10-01-preview/types.json","Index":92}]},"applications.datastores/sqldatabases":{"2023-10-01-preview":[{"RelativePath":"applications/applications.datastores/2023-10-01-preview/types.json","Index":94}]},"applications.messaging/rabbitmqqueues":{"2023-10-01-preview":[{"RelativePath":"applications/applications.messaging/2023-10-01-preview/types.json","Index":52}]}}}
{"Resources":{"Applications.Core/applications@2023-10-01-preview":{"RelativePath":"applications/applications.core/2023-10-01-preview/types.json","Index":58},"Applications.Core/containers@2023-10-01-preview":{"RelativePath":"applications/applications.core/2023-10-01-preview/types.json","Index":123},"Applications.Core/environments@2023-10-01-preview":{"RelativePath":"applications/applications.core/2023-10-01-preview/types.json","Index":158},"Applications.Core/extenders@2023-10-01-preview":{"RelativePath":"applications/applications.core/2023-10-01-preview/types.json","Index":176},"Applications.Core/gateways@2023-10-01-preview":{"RelativePath":"applications/applications.core/2023-10-01-preview/types.json","Index":197},"Applications.Core/secretStores@2023-10-01-preview":{"RelativePath":"applications/applications.core/2023-10-01-preview/types.json","Index":220},"Applications.Core/volumes@2023-10-01-preview":{"RelativePath":"applications/applications.core/2023-10-01-preview/types.json","Index":257},"Applications.Dapr/pubSubBrokers@2023-10-01-preview":{"RelativePath":"applications/applications.dapr/2023-10-01-preview/types.json","Index":49},"Applications.Dapr/secretStores@2023-10-01-preview":{"RelativePath":"applications/applications.dapr/2023-10-01-preview/types.json","Index":66},"Applications.Dapr/stateStores@2023-10-01-preview":{"RelativePath":"applications/applications.dapr/2023-10-01-preview/types.json","Index":84},"Applications.Datastores/mongoDatabases@2023-10-01-preview":{"RelativePath":"applications/applications.datastores/2023-10-01-preview/types.json","Index":50},"Applications.Datastores/redisCaches@2023-10-01-preview":{"RelativePath":"applications/applications.datastores/2023-10-01-preview/types.json","Index":69},"Applications.Datastores/sqlDatabases@2023-10-01-preview":{"RelativePath":"applications/applications.datastores/2023-10-01-preview/types.json","Index":88},"Applications.Messaging/rabbitMQQueues@2023-10-01-preview":{"RelativePath":"applications/applications.messaging/2023-10-01-preview/types.json","Index":50}},"Functions":{"applications.core/extenders":{"2023-10-01-preview":[{"RelativePath":"applications/applications.core/2023-10-01-preview/types.json","Index":258}]},"applications.core/secretstores":{"2023-10-01-preview":[{"RelativePath":"applications/applications.core/2023-10-01-preview/types.json","Index":264}]},"applications.datastores/mongodatabases":{"2023-10-01-preview":[{"RelativePath":"applications/applications.datastores/2023-10-01-preview/types.json","Index":90}]},"applications.datastores/rediscaches":{"2023-10-01-preview":[{"RelativePath":"applications/applications.datastores/2023-10-01-preview/types.json","Index":92}]},"applications.datastores/sqldatabases":{"2023-10-01-preview":[{"RelativePath":"applications/applications.datastores/2023-10-01-preview/types.json","Index":94}]},"applications.messaging/rabbitmqqueues":{"2023-10-01-preview":[{"RelativePath":"applications/applications.messaging/2023-10-01-preview/types.json","Index":52}]}}}
2 changes: 0 additions & 2 deletions pkg/cli/clients/management.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import (
cntr_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/containers"
ext_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/extenders"
gtwy_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/gateways"
hrt_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/httproutes"
sstr_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/secretstores"
dapr_ctrl "github.com/radius-project/radius/pkg/daprrp/frontend/controller"
ds_ctrl "github.com/radius-project/radius/pkg/datastoresrp/frontend/controller"
Expand Down Expand Up @@ -60,7 +59,6 @@ var (
dapr_ctrl.DaprPubSubBrokersResourceType,
ext_ctrl.ResourceTypeName,
gtwy_ctrl.ResourceTypeName,
hrt_ctrl.ResourceTypeName,
cntr_ctrl.ResourceTypeName,
sstr_ctrl.ResourceTypeName,
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/clivalidation.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ func RequireResourceTypeAndName(args []string) (string, string, error) {
return resourceType, resourceName, nil
}

// example of resource Type: Applications.Core/httpRoutes, Applications.Datastores/redisCaches
// example of resource Type: Applications.Datastores/redisCaches
//

// RequireResourceType checks if the first argument provided is a valid resource type and returns it if it is. If the
Expand Down
28 changes: 14 additions & 14 deletions pkg/cli/cmd/app/graph/display_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ func Test_display(t *testing.T) {
})

t.Run("complex application", func(t *testing.T) {
sqlRteID := "/planes/radius/local/resourcegroups/default/providers/Applications.Core/httpRoutes/sql-rte"
sqlRteType := "Applications.Core/httpRoutes"
sqlRteName := "sql-rte"
backendID := "/planes/radius/local/resourcegroups/default/providers/Applications.Core/containers/backend"
backendType := "Applications.Core/containers"
backendName := "backend"

sqlAppCntrID := "/planes/radius/local/resourcegroups/default/providers/Applications.Core/containers/sql-app-ctnr"
sqlAppCntrName := "sql-app-ctnr"
Expand All @@ -62,15 +62,15 @@ func Test_display(t *testing.T) {

graph := []*corerpv20231001preview.ApplicationGraphResource{
{
ID: &sqlRteID,
Name: &sqlRteName,
Type: &sqlRteType,
ID: &backendID,
Name: &backendName,
Type: &backendType,
ProvisioningState: &provisioningStateSuccess,
OutputResources: []*corerpv20231001preview.ApplicationGraphOutputResource{},
Connections: []*corerpv20231001preview.ApplicationGraphConnection{
{
ID: &sqlCntrID,
Direction: &dirInbound,
ID: &sqlCntrID,
},
},
},
Expand All @@ -82,8 +82,8 @@ func Test_display(t *testing.T) {
OutputResources: []*corerpv20231001preview.ApplicationGraphOutputResource{},
Connections: []*corerpv20231001preview.ApplicationGraphConnection{
{
ID: &backendID,
Direction: &dirOutbound,
ID: &sqlRteID,
},
},
},
Expand Down Expand Up @@ -130,19 +130,19 @@ func Test_display(t *testing.T) {

expected := `Displaying application: test-app
Name: sql-app-ctnr (Applications.Core/containers)
Name: backend (Applications.Core/containers)
Connections:
sql-db (Applications.Datastores/sqlDatabases) -> sql-app-ctnr
sql-ctnr (Applications.Core/containers) -> backend
Resources: (none)
Name: sql-ctnr (Applications.Core/containers)
Name: sql-app-ctnr (Applications.Core/containers)
Connections:
sql-ctnr -> sql-rte (Applications.Core/httpRoutes)
sql-db (Applications.Datastores/sqlDatabases) -> sql-app-ctnr
Resources: (none)
Name: sql-rte (Applications.Core/httpRoutes)
Name: sql-ctnr (Applications.Core/containers)
Connections:
sql-ctnr (Applications.Core/containers) -> sql-rte
sql-ctnr -> backend (Applications.Core/containers)
Resources: (none)
Name: redis (Applications.Datastores/redis)
Expand Down
11 changes: 1 addition & 10 deletions pkg/cli/cmd/app/status/status_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,6 @@ func Test_Run(t *testing.T) {
Name: to.Ptr("test-container"),
ID: to.Ptr("/planes/radius/local/resourceGroups/test-group/providers/Applications.Core/containers/test-container"),
},
{
Name: to.Ptr("test-route"),
ID: to.Ptr("/planes/radius/local/resourceGroups/test-group/providers/Applications.Core/httpRoutes/test-route"),
},
{
Name: to.Ptr("test-gateway"),
ID: to.Ptr("/planes/radius/local/resourceGroups/test-group/providers/Applications.Core/gateways/test-gateway"),
Expand All @@ -137,11 +133,6 @@ func Test_Run(t *testing.T) {
Return(nil, nil).
Times(1)

diagnosticsClient.EXPECT().
GetPublicEndpoint(gomock.Any(), clients.EndpointOptions{ResourceID: mustParse(t, "/planes/radius/local/resourceGroups/test-group/providers/Applications.Core/httpRoutes/test-route")}).
Return(nil, nil).
Times(1)

diagnosticsClient.EXPECT().
GetPublicEndpoint(gomock.Any(), clients.EndpointOptions{ResourceID: mustParse(t, "/planes/radius/local/resourceGroups/test-group/providers/Applications.Core/gateways/test-gateway")}).
Return(to.Ptr("http://some-url.example.com"), nil).
Expand Down Expand Up @@ -172,7 +163,7 @@ func Test_Run(t *testing.T) {

applicationStatus := clients.ApplicationStatus{
Name: "test-app",
ResourceCount: 3,
ResourceCount: 2,
Gateways: []clients.GatewayStatus{
{
Name: "test-gateway",
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/cmd/resource/delete/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func NewCommand(factory framework.Factory) (*cobra.Command, framework.Runner) {
Short: "Delete a Radius resource",
Long: "Deletes a Radius resource with the given name",
Example: `
sample list of resourceType: containers, gateways, httpRoutes, daprPubSubBrokers, extenders, mongoDatabases, rabbitMQMessageQueues, redisCaches, sqlDatabases, daprStateStores, daprSecretStores
sample list of resourceType: containers, gateways, daprPubSubBrokers, extenders, mongoDatabases, rabbitMQMessageQueues, redisCaches, sqlDatabases, daprStateStores, daprSecretStores
# Delete a container named orders
rad resource delete containers orders`,
Expand Down
3 changes: 1 addition & 2 deletions pkg/cli/cmd/resource/list/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,12 @@ func NewCommand(factory framework.Factory) (*cobra.Command, framework.Runner) {
Short: "Lists resources",
Long: "List all resources of specified type",
Example: `
sample list of resourceType: containers, gateways, httpRoutes, pubSubBrokers, extenders, mongoDatabases, rabbitMQMessageQueues, redisCaches, sqlDatabases, stateStores, secretStores
sample list of resourceType: containers, gateways, pubSubBrokers, extenders, mongoDatabases, rabbitMQMessageQueues, redisCaches, sqlDatabases, stateStores, secretStores
# list all resources of a specified type in the default environment
rad resource list containers
rad resource list gateways
rad resource list httpRoutes
# list all resources of a specified type in an application
rad resource list containers --application icecream-store
Expand Down
3 changes: 1 addition & 2 deletions pkg/cli/cmd/resource/show/show.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,12 @@ func NewCommand(factory framework.Factory) (*cobra.Command, framework.Runner) {
Short: "Show Radius resource details",
Long: "Show details of the specified Radius resource",
Example: `
sample list of resourceType: containers, gateways, httpRoutes, daprPubSubBrokers, extenders, mongoDatabases, rabbitMQMessageQueues, redisCaches, sqlDatabases, daprStateStores, daprSecretStores
sample list of resourceType: containers, gateways, daprPubSubBrokers, extenders, mongoDatabases, rabbitMQMessageQueues, redisCaches, sqlDatabases, daprStateStores, daprSecretStores
# show details of a specified resource in the default environment
rad resource show containers orders
rad resource show gateways orders_gateways
rad resource show httpRoutes orders_routes
# show details of a specified resource in an application
rad resource show containers orders --application icecream-store
Expand Down
2 changes: 0 additions & 2 deletions pkg/corerp/api/v20231001preview/container_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ func (src *ContainerResource) ConvertTo() (v1.DataModelInterface, error) {
port := datamodel.ContainerPort{
ContainerPort: to.Int32(val.ContainerPort),
Protocol: toPortProtocolDataModel(val.Protocol),
Provides: to.String(val.Provides),
}

if val.Port != nil {
Expand Down Expand Up @@ -200,7 +199,6 @@ func (dst *ContainerResource) ConvertFrom(src v1.DataModelInterface) error {
ports[key] = &ContainerPortProperties{
ContainerPort: to.Ptr(val.ContainerPort),
Protocol: fromPortProtocolDataModel(val.Protocol),
Provides: to.Ptr(val.Provides),
}

if val.Port != 0 {
Expand Down
82 changes: 0 additions & 82 deletions pkg/corerp/api/v20231001preview/httproute_conversion.go

This file was deleted.

Loading

0 comments on commit 2a6c9e6

Please sign in to comment.