From c756ab238ecd670fc4eacbbe26f01e1fbe22ea26 Mon Sep 17 00:00:00 2001 From: Ryan Nowak Date: Mon, 15 Apr 2024 09:41:50 -0700 Subject: [PATCH] Remove httpRoute type from Radius (#7342) # Description This change removes the httpRoute type. We've already removed this from documentation and samples and so this is the final removal. Feels good :+1: ## Type of change - This pull request adds or changes features of Radius and has an approved issue (issue link required). Fixes: #6099 Signed-off-by: Ryan Nowak --- .../tests-naming-conventions.md | 5 +- .../2023-10-01-preview/types.json | 2 +- hack/bicep-types-radius/generated/index.json | 2 +- pkg/cli/clients/management.go | 2 - pkg/cli/clivalidation.go | 2 +- pkg/cli/cmd/app/graph/display_test.go | 28 +- pkg/cli/cmd/app/status/status_test.go | 11 +- pkg/cli/cmd/resource/delete/delete.go | 2 +- pkg/cli/cmd/resource/list/list.go | 3 +- pkg/cli/cmd/resource/show/show.go | 3 +- .../v20231001preview/container_conversion.go | 2 - .../v20231001preview/httproute_conversion.go | 82 ---- .../httproute_conversion_test.go | 95 ---- .../testdata/httprouteresource.json | 19 - .../testdata/httprouteresourcedatamodel.json | 30 -- .../api/v20231001preview/volume_conversion.go | 2 +- .../volume_conversion_test.go | 2 +- .../zz_generated_client_factory.go | 5 - .../zz_generated_httproutes_client.go | 347 -------------- .../v20231001preview/zz_generated_models.go | 92 +--- .../zz_generated_models_serde.go | 215 --------- .../v20231001preview/zz_generated_options.go | 29 -- .../zz_generated_response_types.go | 29 -- .../controller/createorupdateresource.go | 3 - .../controller/createorupdateresource_test.go | 49 -- .../backend/deployment/deploymentprocessor.go | 6 - .../deployment/deploymentprocessor_test.go | 197 +++----- .../testdata/containerresourcedatamodel.json | 3 +- .../containerresourcedatamodellowercase.json | 3 +- .../containerresourcedatamodeluppercase.json | 3 +- pkg/corerp/datamodel/container.go | 1 - .../converter/httproute_converter.go | 54 --- .../converter/httproute_converter_test.go | 99 ---- pkg/corerp/datamodel/httproute.go | 83 ---- .../controller/applications/graph_util.go | 28 +- .../applications/graph_util_test.go | 12 - .../testdata/graph-app-httproute-in.json | 55 --- .../testdata/graph-app-httproute-out.json | 48 -- .../testdata/graph-app-httproute2-in.json | 72 --- .../testdata/graph-app-httproute2-out.json | 41 -- .../frontend/controller/applications/types.go | 2 - .../httproute20231001preview_datamodel.json | 34 -- .../httproute20231001preview_input.json | 10 - .../httproute20231001preview_input_appid.json | 10 - .../httproute20231001preview_output.json | 30 -- .../frontend/controller/httproutes/types.go | 21 - .../secretstores/kubernetes_test.go | 4 +- pkg/corerp/model/application_model.go | 5 - pkg/corerp/renderers/container/render.go | 75 +-- pkg/corerp/renderers/container/render_test.go | 68 +-- pkg/corerp/renderers/gateway/render.go | 38 +- pkg/corerp/renderers/gateway/render_test.go | 287 +++++------- pkg/corerp/renderers/httproute/render.go | 120 ----- pkg/corerp/renderers/httproute/render_test.go | 305 ------------- pkg/corerp/renderers/httproute/types.go | 22 - pkg/corerp/setup/operations.go | 30 -- pkg/corerp/setup/setup.go | 18 - pkg/corerp/setup/setup_test.go | 25 - pkg/kubernetes/labels.go | 16 - pkg/kubernetes/object.go | 6 +- pkg/rp/v1/localids.go | 2 +- .../examples/Gateways_CreateOrUpdate.json | 4 +- .../examples/Gateways_Get.json | 2 +- .../examples/Gateways_List.json | 2 +- .../examples/Gateways_ListByScope.json | 4 +- .../examples/HttpRoutes_CreateOrUpdate.json | 28 -- .../examples/HttpRoutes_Delete.json | 14 - .../examples/HttpRoutes_Get.json | 22 - .../examples/HttpRoutes_List.json | 35 -- .../examples/HttpRoutes_ListByScope.json | 35 -- .../examples/HttpRoutes_Update.json | 28 -- .../examples/Operations_List.json | 30 -- .../examples/Volumes_CreateOrUpdate.json | 2 +- .../examples/Volumes_Update.json | 2 +- .../preview/2023-10-01-preview/openapi.json | 430 +----------------- .../noncloud/resources/application_test.go | 26 +- .../resources/simulated_environment_test.go | 10 - ...orerp-resources-application-graph-out.json | 171 ++++--- .../corerp-resources-application-graph.bicep | 10 +- .../corerp-resources-simulatedenv.bicep | 25 +- .../daprrp-resources-serviceinvocation.bicep | 2 +- .../{daprhttpinvoke.go => daprhttp.go} | 6 +- test/magpiego/server.go | 2 +- test/validation/shared.go | 1 - typespec/Applications.Core/containers.tsp | 3 - .../Gateways_CreateOrUpdate.json | 4 +- .../2023-10-01-preview/Gateways_Get.json | 2 +- .../2023-10-01-preview/Gateways_List.json | 2 +- .../Gateways_ListByScope.json | 4 +- .../2023-10-01-preview/Gateways_Update.json | 4 +- .../HttpRoutes_CreateOrUpdate.json | 28 -- .../2023-10-01-preview/HttpRoutes_Delete.json | 14 - .../2023-10-01-preview/HttpRoutes_Get.json | 22 - .../2023-10-01-preview/HttpRoutes_List.json | 35 -- .../HttpRoutes_ListByScope.json | 35 -- .../2023-10-01-preview/HttpRoutes_Update.json | 28 -- .../2023-10-01-preview/Operations_List.json | 30 -- .../Volumes_CreateOrUpdate.json | 2 +- .../2023-10-01-preview/Volumes_Update.json | 2 +- typespec/Applications.Core/gateways.tsp | 2 +- typespec/Applications.Core/httproutes.tsp | 97 ---- typespec/Applications.Core/main.tsp | 1 - 102 files changed, 354 insertions(+), 3746 deletions(-) delete mode 100644 pkg/corerp/api/v20231001preview/httproute_conversion.go delete mode 100644 pkg/corerp/api/v20231001preview/httproute_conversion_test.go delete mode 100644 pkg/corerp/api/v20231001preview/testdata/httprouteresource.json delete mode 100644 pkg/corerp/api/v20231001preview/testdata/httprouteresourcedatamodel.json delete mode 100644 pkg/corerp/api/v20231001preview/zz_generated_httproutes_client.go delete mode 100644 pkg/corerp/datamodel/converter/httproute_converter.go delete mode 100644 pkg/corerp/datamodel/converter/httproute_converter_test.go delete mode 100644 pkg/corerp/datamodel/httproute.go delete mode 100644 pkg/corerp/frontend/controller/applications/testdata/graph-app-httproute-in.json delete mode 100644 pkg/corerp/frontend/controller/applications/testdata/graph-app-httproute-out.json delete mode 100644 pkg/corerp/frontend/controller/applications/testdata/graph-app-httproute2-in.json delete mode 100644 pkg/corerp/frontend/controller/applications/testdata/graph-app-httproute2-out.json delete mode 100644 pkg/corerp/frontend/controller/httproutes/testdata/httproute20231001preview_datamodel.json delete mode 100644 pkg/corerp/frontend/controller/httproutes/testdata/httproute20231001preview_input.json delete mode 100644 pkg/corerp/frontend/controller/httproutes/testdata/httproute20231001preview_input_appid.json delete mode 100644 pkg/corerp/frontend/controller/httproutes/testdata/httproute20231001preview_output.json delete mode 100644 pkg/corerp/frontend/controller/httproutes/types.go delete mode 100644 pkg/corerp/renderers/httproute/render.go delete mode 100644 pkg/corerp/renderers/httproute/render_test.go delete mode 100644 pkg/corerp/renderers/httproute/types.go delete mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/HttpRoutes_CreateOrUpdate.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/HttpRoutes_Delete.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/HttpRoutes_Get.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/HttpRoutes_List.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/HttpRoutes_ListByScope.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/HttpRoutes_Update.json rename test/magpiego/bindings/{daprhttpinvoke.go => daprhttp.go} (83%) delete mode 100644 typespec/Applications.Core/examples/2023-10-01-preview/HttpRoutes_CreateOrUpdate.json delete mode 100644 typespec/Applications.Core/examples/2023-10-01-preview/HttpRoutes_Delete.json delete mode 100644 typespec/Applications.Core/examples/2023-10-01-preview/HttpRoutes_Get.json delete mode 100644 typespec/Applications.Core/examples/2023-10-01-preview/HttpRoutes_List.json delete mode 100644 typespec/Applications.Core/examples/2023-10-01-preview/HttpRoutes_ListByScope.json delete mode 100644 typespec/Applications.Core/examples/2023-10-01-preview/HttpRoutes_Update.json delete mode 100644 typespec/Applications.Core/httproutes.tsp diff --git a/docs/contributing/contributing-code/contributing-code-tests/tests-naming-conventions.md b/docs/contributing/contributing-code/contributing-code-tests/tests-naming-conventions.md index e3eeb76c6a..bc41214bc4 100644 --- a/docs/contributing/contributing-code/contributing-code-tests/tests-naming-conventions.md +++ b/docs/contributing/contributing-code/contributing-code-tests/tests-naming-conventions.md @@ -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| @@ -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' ... } ``` diff --git a/hack/bicep-types-radius/generated/applications/applications.core/2023-10-01-preview/types.json b/hack/bicep-types-radius/generated/applications/applications.core/2023-10-01-preview/types.json index 2d6b43b525..b18df4680b 100644 --- a/hack/bicep-types-radius/generated/applications/applications.core/2023-10-01-preview/types.json +++ b/hack/bicep-types-radius/generated/applications/applications.core/2023-10-01-preview/types.json @@ -1 +1 @@ -[{"1":{"Kind":1}},{"1":{"Kind":2}},{"1":{"Kind":3}},{"1":{"Kind":4}},{"1":{"Kind":5}},{"1":{"Kind":6}},{"1":{"Kind":7}},{"1":{"Kind":8}},{"6":{"Value":"Applications.Core/applications"}},{"6":{"Value":"2023-10-01-preview"}},{"2":{"Name":"Applications.Core/applications","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":8,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":9,"Flags":10,"Description":"The resource api version"},"properties":{"Type":11,"Flags":1,"Description":"Application properties"},"tags":{"Type":46,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":47,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"ApplicationProperties","Properties":{"provisioningState":{"Type":19,"Flags":2,"Description":"Provisioning state of the resource at the time the operation was called"},"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the application is linked to"},"extensions":{"Type":34,"Flags":0,"Description":"The application extension."},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[12,13,14,15,16,17,18]}},{"7":{"Name":"Extension","Discriminator":"kind","BaseProperties":{},"Elements":{"daprSidecar":21,"kubernetesMetadata":26,"kubernetesNamespace":30,"manualScaling":32}}},{"2":{"Name":"DaprSidecarExtension","Properties":{"appPort":{"Type":3,"Flags":0,"Description":"The Dapr appPort. Specifies the internal listening port for the application to handle requests from the Dapr sidecar."},"appId":{"Type":4,"Flags":1,"Description":"The Dapr appId. Specifies the identifier used by Dapr for service invocation."},"config":{"Type":4,"Flags":0,"Description":"Specifies the Dapr configuration to use for the resource."},"protocol":{"Type":24,"Flags":0,"Description":"The Dapr sidecar extension protocol"},"kind":{"Type":25,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"6":{"Value":"http"}},{"6":{"Value":"grpc"}},{"5":{"Elements":[22,23]}},{"6":{"Value":"daprSidecar"}},{"2":{"Name":"KubernetesMetadataExtension","Properties":{"annotations":{"Type":27,"Flags":0,"Description":"Annotations to be applied to the Kubernetes resources output by the resource"},"labels":{"Type":28,"Flags":0,"Description":"Labels to be applied to the Kubernetes resources output by the resource"},"kind":{"Type":29,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"2":{"Name":"KubernetesMetadataExtensionAnnotations","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"KubernetesMetadataExtensionLabels","Properties":{},"AdditionalProperties":4}},{"6":{"Value":"kubernetesMetadata"}},{"2":{"Name":"KubernetesNamespaceExtension","Properties":{"namespace":{"Type":4,"Flags":1,"Description":"The namespace of the application environment."},"kind":{"Type":31,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"6":{"Value":"kubernetesNamespace"}},{"2":{"Name":"ManualScalingExtension","Properties":{"replicas":{"Type":3,"Flags":1,"Description":"Replica count."},"kind":{"Type":33,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"6":{"Value":"manualScaling"}},{"3":{"ItemType":20}},{"2":{"Name":"ResourceStatus","Properties":{"compute":{"Type":36,"Flags":0,"Description":"Represents backing compute resource"},"recipe":{"Type":43,"Flags":2,"Description":"Recipe status at deployment time for a resource."},"outputResources":{"Type":45,"Flags":0,"Description":"Properties of an output resource"}}}},{"7":{"Name":"EnvironmentCompute","Discriminator":"kind","BaseProperties":{"resourceId":{"Type":4,"Flags":0,"Description":"The resource id of the compute resource for application environment."},"identity":{"Type":37,"Flags":0,"Description":"IdentitySettings is the external identity setting."}},"Elements":{"kubernetes":41}}},{"2":{"Name":"IdentitySettings","Properties":{"kind":{"Type":40,"Flags":1,"Description":"IdentitySettingKind is the kind of supported external identity setting"},"oidcIssuer":{"Type":4,"Flags":0,"Description":"The URI for your compute platform's OIDC issuer"},"resource":{"Type":4,"Flags":0,"Description":"The resource ID of the provisioned identity"}}}},{"6":{"Value":"undefined"}},{"6":{"Value":"azure.com.workload"}},{"5":{"Elements":[38,39]}},{"2":{"Name":"KubernetesCompute","Properties":{"namespace":{"Type":4,"Flags":1,"Description":"The namespace to use for the environment."},"kind":{"Type":42,"Flags":1,"Description":"Discriminator property for EnvironmentCompute."}}}},{"6":{"Value":"kubernetes"}},{"2":{"Name":"RecipeStatus","Properties":{"templateKind":{"Type":4,"Flags":1,"Description":"TemplateKind is the kind of the recipe template used by the portable resource upon deployment."},"templatePath":{"Type":4,"Flags":1,"Description":"TemplatePath is the path of the recipe consumed by the portable resource upon deployment."},"templateVersion":{"Type":4,"Flags":0,"Description":"TemplateVersion is the version number of the template."}}}},{"2":{"Name":"OutputResource","Properties":{"localId":{"Type":4,"Flags":0,"Description":"The logical identifier scoped to the owning Radius resource. This is only needed or used when a resource has a dependency relationship. LocalIDs do not have any particular format or meaning beyond being compared to determine dependency relationships."},"id":{"Type":4,"Flags":0,"Description":"The UCP resource ID of the underlying resource."},"radiusManaged":{"Type":2,"Flags":0,"Description":"Determines whether Radius manages the lifecycle of the underlying resource."}}}},{"3":{"ItemType":44}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"SystemData","Properties":{"createdBy":{"Type":4,"Flags":0,"Description":"The identity that created the resource."},"createdByType":{"Type":52,"Flags":0,"Description":"The type of identity that created the resource."},"createdAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource creation (UTC)."},"lastModifiedBy":{"Type":4,"Flags":0,"Description":"The identity that last modified the resource."},"lastModifiedByType":{"Type":57,"Flags":0,"Description":"The type of identity that created the resource."},"lastModifiedAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource last modification (UTC)"}}}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[48,49,50,51]}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[53,54,55,56]}},{"4":{"Name":"Applications.Core/applications@2023-10-01-preview","ScopeType":0,"Body":10}},{"6":{"Value":"Applications.Core/containers"}},{"6":{"Value":"2023-10-01-preview"}},{"2":{"Name":"Applications.Core/containers","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":59,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":60,"Flags":10,"Description":"The resource api version"},"properties":{"Type":62,"Flags":1,"Description":"Container properties"},"tags":{"Type":122,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":47,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"ContainerProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the application is linked to"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application"},"provisioningState":{"Type":70,"Flags":2,"Description":"Provisioning state of the resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"container":{"Type":71,"Flags":1,"Description":"Definition of a container"},"connections":{"Type":108,"Flags":0,"Description":"Specifies a connection to another resource."},"identity":{"Type":37,"Flags":0,"Description":"IdentitySettings is the external identity setting."},"extensions":{"Type":109,"Flags":0,"Description":"Extensions spec of the resource"},"resourceProvisioning":{"Type":112,"Flags":0,"Description":"Specifies how the underlying service/resource is provisioned and managed. Available values are 'internal', where Radius manages the lifecycle of the resource internally, and 'manual', where a user manages the resource."},"resources":{"Type":114,"Flags":0,"Description":"A collection of references to resources associated with the container"},"restartPolicy":{"Type":118,"Flags":0,"Description":"Restart policy for the container"},"runtimes":{"Type":119,"Flags":0,"Description":"The properties for runtime configuration"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[63,64,65,66,67,68,69]}},{"2":{"Name":"Container","Properties":{"image":{"Type":4,"Flags":1,"Description":"The registry and image to download and run in your container"},"imagePullPolicy":{"Type":75,"Flags":0,"Description":"The image pull policy for the container"},"env":{"Type":76,"Flags":0,"Description":"environment"},"ports":{"Type":81,"Flags":0,"Description":"container ports"},"readinessProbe":{"Type":82,"Flags":0,"Description":"Properties for readiness/liveness probe"},"livenessProbe":{"Type":82,"Flags":0,"Description":"Properties for readiness/liveness probe"},"volumes":{"Type":101,"Flags":0,"Description":"container volumes"},"command":{"Type":102,"Flags":0,"Description":"Entrypoint array. Overrides the container image's ENTRYPOINT"},"args":{"Type":103,"Flags":0,"Description":"Arguments to the entrypoint. Overrides the container image's CMD"},"workingDir":{"Type":4,"Flags":0,"Description":"Working directory for the container"}}}},{"6":{"Value":"Always"}},{"6":{"Value":"IfNotPresent"}},{"6":{"Value":"Never"}},{"5":{"Elements":[72,73,74]}},{"2":{"Name":"ContainerEnv","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"ContainerPortProperties","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"protocol":{"Type":80,"Flags":0,"Description":"The protocol in use by the port"},"provides":{"Type":4,"Flags":0,"Description":"Specifies a route provided by this port"},"scheme":{"Type":4,"Flags":0,"Description":"Specifies the URL scheme of the communication protocol. Consumers can use the scheme to construct a URL. The value defaults to 'http' or 'https' depending on the port value"},"port":{"Type":3,"Flags":0,"Description":"Specifies the port that will be exposed by this container. Must be set when value different from containerPort is desired"}}}},{"6":{"Value":"TCP"}},{"6":{"Value":"UDP"}},{"5":{"Elements":[78,79]}},{"2":{"Name":"ContainerPorts","Properties":{},"AdditionalProperties":77}},{"7":{"Name":"HealthProbeProperties","Discriminator":"kind","BaseProperties":{"initialDelaySeconds":{"Type":3,"Flags":0,"Description":"Initial delay in seconds before probing for readiness/liveness"},"failureThreshold":{"Type":3,"Flags":0,"Description":"Threshold number of times the probe fails after which a failure would be reported"},"periodSeconds":{"Type":3,"Flags":0,"Description":"Interval for the readiness/liveness probe in seconds"},"timeoutSeconds":{"Type":3,"Flags":0,"Description":"Number of seconds after which the readiness/liveness probe times out. Defaults to 5 seconds"}},"Elements":{"exec":83,"httpGet":85,"tcp":88}}},{"2":{"Name":"ExecHealthProbeProperties","Properties":{"command":{"Type":4,"Flags":1,"Description":"Command to execute to probe readiness/liveness"},"kind":{"Type":84,"Flags":1,"Description":"Discriminator property for HealthProbeProperties."}}}},{"6":{"Value":"exec"}},{"2":{"Name":"HttpGetHealthProbeProperties","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"path":{"Type":4,"Flags":1,"Description":"The route to make the HTTP request on"},"headers":{"Type":86,"Flags":0,"Description":"Custom HTTP headers to add to the get request"},"kind":{"Type":87,"Flags":1,"Description":"Discriminator property for HealthProbeProperties."}}}},{"2":{"Name":"HttpGetHealthProbePropertiesHeaders","Properties":{},"AdditionalProperties":4}},{"6":{"Value":"httpGet"}},{"2":{"Name":"TcpHealthProbeProperties","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"kind":{"Type":89,"Flags":1,"Description":"Discriminator property for HealthProbeProperties."}}}},{"6":{"Value":"tcp"}},{"7":{"Name":"Volume","Discriminator":"kind","BaseProperties":{"mountPath":{"Type":4,"Flags":0,"Description":"The path where the volume is mounted"}},"Elements":{"ephemeral":91,"persistent":96}}},{"2":{"Name":"EphemeralVolume","Properties":{"managedStore":{"Type":94,"Flags":1,"Description":"The managed store for the ephemeral volume"},"kind":{"Type":95,"Flags":1,"Description":"Discriminator property for Volume."}}}},{"6":{"Value":"memory"}},{"6":{"Value":"disk"}},{"5":{"Elements":[92,93]}},{"6":{"Value":"ephemeral"}},{"2":{"Name":"PersistentVolume","Properties":{"permission":{"Type":99,"Flags":0,"Description":"The persistent volume permission"},"source":{"Type":4,"Flags":1,"Description":"The source of the volume"},"kind":{"Type":100,"Flags":1,"Description":"Discriminator property for Volume."}}}},{"6":{"Value":"read"}},{"6":{"Value":"write"}},{"5":{"Elements":[97,98]}},{"6":{"Value":"persistent"}},{"2":{"Name":"ContainerVolumes","Properties":{},"AdditionalProperties":90}},{"3":{"ItemType":4}},{"3":{"ItemType":4}},{"2":{"Name":"ConnectionProperties","Properties":{"source":{"Type":4,"Flags":1,"Description":"The source of the connection"},"disableDefaultEnvVars":{"Type":2,"Flags":0,"Description":"default environment variable override"},"iam":{"Type":105,"Flags":0,"Description":"IAM properties"}}}},{"2":{"Name":"IamProperties","Properties":{"kind":{"Type":106,"Flags":1,"Description":"The kind of IAM provider to configure"},"roles":{"Type":107,"Flags":0,"Description":"RBAC permissions to be assigned on the source resource"}}}},{"6":{"Value":"azure"}},{"3":{"ItemType":4}},{"2":{"Name":"ContainerPropertiesConnections","Properties":{},"AdditionalProperties":104}},{"3":{"ItemType":20}},{"6":{"Value":"internal"}},{"6":{"Value":"manual"}},{"5":{"Elements":[110,111]}},{"2":{"Name":"ResourceReference","Properties":{"id":{"Type":4,"Flags":1,"Description":"Resource id of an existing resource"}}}},{"3":{"ItemType":113}},{"6":{"Value":"Always"}},{"6":{"Value":"OnFailure"}},{"6":{"Value":"Never"}},{"5":{"Elements":[115,116,117]}},{"2":{"Name":"RuntimesProperties","Properties":{"kubernetes":{"Type":120,"Flags":0,"Description":"The runtime configuration properties for Kubernetes"}}}},{"2":{"Name":"KubernetesRuntimeProperties","Properties":{"base":{"Type":4,"Flags":0,"Description":"The serialized YAML manifest which represents the base Kubernetes resources to deploy, such as Deployment, Service, ServiceAccount, Secrets, and ConfigMaps."},"pod":{"Type":121,"Flags":0,"Description":"A strategic merge patch that will be applied to the PodSpec object when this container is being deployed."}}}},{"2":{"Name":"KubernetesPodSpec","Properties":{},"AdditionalProperties":0}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/containers@2023-10-01-preview","ScopeType":0,"Body":61}},{"6":{"Value":"Applications.Core/environments"}},{"6":{"Value":"2023-10-01-preview"}},{"2":{"Name":"Applications.Core/environments","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":124,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":125,"Flags":10,"Description":"The resource api version"},"properties":{"Type":127,"Flags":1,"Description":"Environment properties"},"tags":{"Type":157,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":47,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"EnvironmentProperties","Properties":{"provisioningState":{"Type":135,"Flags":2,"Description":"Provisioning state of the resource at the time the operation was called"},"compute":{"Type":36,"Flags":1,"Description":"Represents backing compute resource"},"providers":{"Type":136,"Flags":0,"Description":"The Cloud providers configuration."},"simulated":{"Type":2,"Flags":0,"Description":"Simulated environment."},"recipes":{"Type":145,"Flags":0,"Description":"Specifies Recipes linked to the Environment."},"recipeConfig":{"Type":146,"Flags":0,"Description":"Configuration for Recipes. Defines how each type of Recipe should be configured and run."},"extensions":{"Type":156,"Flags":0,"Description":"The environment extension."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[128,129,130,131,132,133,134]}},{"2":{"Name":"Providers","Properties":{"azure":{"Type":137,"Flags":0,"Description":"The Azure cloud provider definition."},"aws":{"Type":138,"Flags":0,"Description":"The AWS cloud provider definition."}}}},{"2":{"Name":"ProvidersAzure","Properties":{"scope":{"Type":4,"Flags":1,"Description":"Target scope for Azure resources to be deployed into. For example: '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup'."}}}},{"2":{"Name":"ProvidersAws","Properties":{"scope":{"Type":4,"Flags":1,"Description":"Target scope for AWS resources to be deployed into. For example: '/planes/aws/aws/accounts/000000000000/regions/us-west-2'."}}}},{"7":{"Name":"RecipeProperties","Discriminator":"templateKind","BaseProperties":{"templatePath":{"Type":4,"Flags":1,"Description":"Path to the template provided by the recipe. Currently only link to Azure Container Registry is supported."},"parameters":{"Type":0,"Flags":0,"Description":"Any object"}},"Elements":{"bicep":140,"terraform":142}}},{"2":{"Name":"BicepRecipeProperties","Properties":{"plainHttp":{"Type":2,"Flags":0,"Description":"Connect to the Bicep registry using HTTP (not-HTTPS). This should be used when the registry is known not to support HTTPS, for example in a locally-hosted registry. Defaults to false (use HTTPS/TLS)."},"templateKind":{"Type":141,"Flags":1,"Description":"Discriminator property for RecipeProperties."}}}},{"6":{"Value":"bicep"}},{"2":{"Name":"TerraformRecipeProperties","Properties":{"templateVersion":{"Type":4,"Flags":0,"Description":"Version of the template to deploy. For Terraform recipes using a module registry this is required, but must be omitted for other module sources."},"templateKind":{"Type":143,"Flags":1,"Description":"Discriminator property for RecipeProperties."}}}},{"6":{"Value":"terraform"}},{"2":{"Name":"DictionaryOfRecipeProperties","Properties":{},"AdditionalProperties":139}},{"2":{"Name":"EnvironmentPropertiesRecipes","Properties":{},"AdditionalProperties":144}},{"2":{"Name":"RecipeConfigProperties","Properties":{"terraform":{"Type":147,"Flags":0,"Description":"Configuration for Terraform Recipes. Controls how Terraform plans and applies templates as part of Recipe deployment."},"env":{"Type":155,"Flags":0,"Description":"The environment variables injected during Terraform Recipe execution for the recipes in the environment."}}}},{"2":{"Name":"TerraformConfigProperties","Properties":{"authentication":{"Type":148,"Flags":0,"Description":"Authentication information used to access private Terraform module sources. Supported module sources: Git."},"providers":{"Type":154,"Flags":0,"Description":"Configuration for Terraform Recipe Providers. Controls how Terraform interacts with cloud providers, SaaS providers, and other APIs. For more information, please see: https://developer.hashicorp.com/terraform/language/providers/configuration."}}}},{"2":{"Name":"AuthConfig","Properties":{"git":{"Type":149,"Flags":0,"Description":"Authentication information used to access private Terraform modules from Git repository sources."}}}},{"2":{"Name":"GitAuthConfig","Properties":{"pat":{"Type":151,"Flags":0,"Description":"Personal Access Token (PAT) configuration used to authenticate to Git platforms."}}}},{"2":{"Name":"SecretConfig","Properties":{"secret":{"Type":4,"Flags":0,"Description":"The ID of an Applications.Core/SecretStore resource containing the Git platform personal access token (PAT). The secret store must have a secret named 'pat', containing the PAT value. A secret named 'username' is optional, containing the username associated with the pat. By default no username is specified."}}}},{"2":{"Name":"GitAuthConfigPat","Properties":{},"AdditionalProperties":150}},{"2":{"Name":"ProviderConfigProperties","Properties":{},"AdditionalProperties":0}},{"3":{"ItemType":152}},{"2":{"Name":"TerraformConfigPropertiesProviders","Properties":{},"AdditionalProperties":153}},{"2":{"Name":"EnvironmentVariables","Properties":{},"AdditionalProperties":4}},{"3":{"ItemType":20}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/environments@2023-10-01-preview","ScopeType":0,"Body":126}},{"6":{"Value":"Applications.Core/extenders"}},{"6":{"Value":"2023-10-01-preview"}},{"2":{"Name":"Applications.Core/extenders","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":159,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":160,"Flags":10,"Description":"The resource api version"},"properties":{"Type":162,"Flags":1,"Description":"ExtenderResource portable resource properties"},"tags":{"Type":175,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":47,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"ExtenderProperties","Properties":{"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to"},"application":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by (if applicable)"},"provisioningState":{"Type":170,"Flags":2,"Description":"Provisioning state of the resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"secrets":{"Type":0,"Flags":0,"Description":"Any object"},"recipe":{"Type":171,"Flags":0,"Description":"The recipe used to automatically deploy underlying infrastructure for a portable resource"},"resourceProvisioning":{"Type":174,"Flags":0,"Description":"Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values."}},"AdditionalProperties":0}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[163,164,165,166,167,168,169]}},{"2":{"Name":"Recipe","Properties":{"name":{"Type":4,"Flags":1,"Description":"The name of the recipe within the environment to use"},"parameters":{"Type":0,"Flags":0,"Description":"Any object"}}}},{"6":{"Value":"recipe"}},{"6":{"Value":"manual"}},{"5":{"Elements":[172,173]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/extenders@2023-10-01-preview","ScopeType":0,"Body":161}},{"6":{"Value":"Applications.Core/gateways"}},{"6":{"Value":"2023-10-01-preview"}},{"2":{"Name":"Applications.Core/gateways","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":177,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":178,"Flags":10,"Description":"The resource api version"},"properties":{"Type":180,"Flags":1,"Description":"Gateway properties"},"tags":{"Type":196,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":47,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"GatewayProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the application is linked to"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application"},"provisioningState":{"Type":188,"Flags":2,"Description":"Provisioning state of the resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"internal":{"Type":2,"Flags":0,"Description":"Sets Gateway to not be exposed externally (no public IP address associated). Defaults to false (exposed to internet)."},"hostname":{"Type":189,"Flags":0,"Description":"Declare hostname information for the Gateway. Leaving the hostname empty auto-assigns one: mygateway.myapp.PUBLICHOSTNAMEORIP.nip.io."},"routes":{"Type":191,"Flags":1,"Description":"Routes attached to this Gateway"},"tls":{"Type":192,"Flags":0,"Description":"TLS configuration definition for Gateway resource."},"url":{"Type":4,"Flags":2,"Description":"URL of the gateway resource. Readonly"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[181,182,183,184,185,186,187]}},{"2":{"Name":"GatewayHostname","Properties":{"prefix":{"Type":4,"Flags":0,"Description":"Specify a prefix for the hostname: myhostname.myapp.PUBLICHOSTNAMEORIP.nip.io. Mutually exclusive with 'fullyQualifiedHostname' and will be overridden if both are defined."},"fullyQualifiedHostname":{"Type":4,"Flags":0,"Description":"Specify a fully-qualified domain name: myapp.mydomain.com. Mutually exclusive with 'prefix' and will take priority if both are defined."}}}},{"2":{"Name":"GatewayRoute","Properties":{"path":{"Type":4,"Flags":0,"Description":"The path to match the incoming request path on. Ex - /myservice."},"destination":{"Type":4,"Flags":0,"Description":"The HttpRoute to route to. Ex - myserviceroute.id."},"replacePrefix":{"Type":4,"Flags":0,"Description":"Optionally update the prefix when sending the request to the service. Ex - replacePrefix: '/' and path: '/myservice' will transform '/myservice/myroute' to '/myroute'"}}}},{"3":{"ItemType":190}},{"2":{"Name":"GatewayTls","Properties":{"sslPassthrough":{"Type":2,"Flags":0,"Description":"If true, gateway lets the https traffic sslPassthrough to the backend servers for decryption."},"minimumProtocolVersion":{"Type":195,"Flags":0,"Description":"Tls Minimum versions for Gateway resource."},"certificateFrom":{"Type":4,"Flags":0,"Description":"The resource id for the secret containing the TLS certificate and key for the gateway."}}}},{"6":{"Value":"1.2"}},{"6":{"Value":"1.3"}},{"5":{"Elements":[193,194]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/gateways@2023-10-01-preview","ScopeType":0,"Body":179}},{"6":{"Value":"Applications.Core/httpRoutes"}},{"6":{"Value":"2023-10-01-preview"}},{"2":{"Name":"Applications.Core/httpRoutes","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":198,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":199,"Flags":10,"Description":"The resource api version"},"properties":{"Type":201,"Flags":1,"Description":"HTTPRoute properties"},"tags":{"Type":210,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":47,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"HttpRouteProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the application is linked to"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application"},"provisioningState":{"Type":209,"Flags":2,"Description":"Provisioning state of the resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"hostname":{"Type":4,"Flags":0,"Description":"The internal hostname accepting traffic for the HTTP Route. Readonly."},"port":{"Type":3,"Flags":0,"Description":"The port number for the HTTP Route. Defaults to 80. Readonly."},"scheme":{"Type":4,"Flags":2,"Description":"The scheme used for traffic. Readonly."},"url":{"Type":4,"Flags":2,"Description":"A stable URL that that can be used to route traffic to a resource. Readonly."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[202,203,204,205,206,207,208]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/httpRoutes@2023-10-01-preview","ScopeType":0,"Body":200}},{"6":{"Value":"Applications.Core/secretStores"}},{"6":{"Value":"2023-10-01-preview"}},{"2":{"Name":"Applications.Core/secretStores","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":212,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":213,"Flags":10,"Description":"The resource api version"},"properties":{"Type":215,"Flags":1,"Description":"The properties of SecretStore"},"tags":{"Type":233,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":47,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"SecretStoreProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the application is linked to"},"application":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the application"},"provisioningState":{"Type":223,"Flags":2,"Description":"Provisioning state of the resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"type":{"Type":226,"Flags":0,"Description":"The type of SecretStore data"},"data":{"Type":232,"Flags":1,"Description":"An object to represent key-value type secrets"},"resource":{"Type":4,"Flags":0,"Description":"The resource id of external secret store."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[216,217,218,219,220,221,222]}},{"6":{"Value":"generic"}},{"6":{"Value":"certificate"}},{"5":{"Elements":[224,225]}},{"2":{"Name":"SecretValueProperties","Properties":{"encoding":{"Type":230,"Flags":0,"Description":"The type of SecretValue Encoding"},"value":{"Type":4,"Flags":0,"Description":"The value of secret."},"valueFrom":{"Type":231,"Flags":0,"Description":"The Secret value source properties"}}}},{"6":{"Value":"raw"}},{"6":{"Value":"base64"}},{"5":{"Elements":[228,229]}},{"2":{"Name":"ValueFromProperties","Properties":{"name":{"Type":4,"Flags":1,"Description":"The name of the referenced secret."},"version":{"Type":4,"Flags":0,"Description":"The version of the referenced secret."}}}},{"2":{"Name":"SecretStorePropertiesData","Properties":{},"AdditionalProperties":227}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/secretStores@2023-10-01-preview","ScopeType":0,"Body":214}},{"6":{"Value":"Applications.Core/volumes"}},{"6":{"Value":"2023-10-01-preview"}},{"2":{"Name":"Applications.Core/volumes","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":235,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":236,"Flags":10,"Description":"The resource api version"},"properties":{"Type":238,"Flags":1,"Description":"Volume properties"},"tags":{"Type":270,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":47,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"7":{"Name":"VolumeProperties","Discriminator":"kind","BaseProperties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the application is linked to"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application"},"provisioningState":{"Type":246,"Flags":2,"Description":"Provisioning state of the resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."}},"Elements":{"azure.com.keyvault":247}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[239,240,241,242,243,244,245]}},{"2":{"Name":"AzureKeyVaultVolumeProperties","Properties":{"certificates":{"Type":260,"Flags":0,"Description":"The KeyVault certificates that this volume exposes"},"keys":{"Type":262,"Flags":0,"Description":"The KeyVault keys that this volume exposes"},"resource":{"Type":4,"Flags":1,"Description":"The ID of the keyvault to use for this volume resource"},"secrets":{"Type":268,"Flags":0,"Description":"The KeyVault secrets that this volume exposes"},"kind":{"Type":269,"Flags":1,"Description":"Discriminator property for VolumeProperties."}}}},{"2":{"Name":"CertificateObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk"},"encoding":{"Type":252,"Flags":0,"Description":"Represents secret encodings"},"format":{"Type":255,"Flags":0,"Description":"Represents certificate formats"},"name":{"Type":4,"Flags":1,"Description":"The name of the certificate"},"certType":{"Type":259,"Flags":0,"Description":"Represents certificate types"},"version":{"Type":4,"Flags":0,"Description":"Certificate version"}}}},{"6":{"Value":"utf-8"}},{"6":{"Value":"hex"}},{"6":{"Value":"base64"}},{"5":{"Elements":[249,250,251]}},{"6":{"Value":"pem"}},{"6":{"Value":"pfx"}},{"5":{"Elements":[253,254]}},{"6":{"Value":"certificate"}},{"6":{"Value":"privatekey"}},{"6":{"Value":"publickey"}},{"5":{"Elements":[256,257,258]}},{"2":{"Name":"AzureKeyVaultVolumePropertiesCertificates","Properties":{},"AdditionalProperties":248}},{"2":{"Name":"KeyObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk"},"name":{"Type":4,"Flags":1,"Description":"The name of the key"},"version":{"Type":4,"Flags":0,"Description":"Key version"}}}},{"2":{"Name":"AzureKeyVaultVolumePropertiesKeys","Properties":{},"AdditionalProperties":261}},{"2":{"Name":"SecretObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk"},"encoding":{"Type":267,"Flags":0,"Description":"Represents secret encodings"},"name":{"Type":4,"Flags":1,"Description":"The name of the secret"},"version":{"Type":4,"Flags":0,"Description":"secret version"}}}},{"6":{"Value":"utf-8"}},{"6":{"Value":"hex"}},{"6":{"Value":"base64"}},{"5":{"Elements":[264,265,266]}},{"2":{"Name":"AzureKeyVaultVolumePropertiesSecrets","Properties":{},"AdditionalProperties":263}},{"6":{"Value":"azure.com.keyvault"}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/volumes@2023-10-01-preview","ScopeType":0,"Body":237}},{"8":{"Name":"listSecrets","ResourceType":"Applications.Core/extenders","ApiVersion":"2023-10-01-preview","Output":0,"Input":0}},{"2":{"Name":"SecretStoreListSecretsResult","Properties":{"type":{"Type":276,"Flags":2,"Description":"The type of SecretStore data"},"data":{"Type":277,"Flags":2,"Description":"An object to represent key-value type secrets"}}}},{"6":{"Value":"generic"}},{"6":{"Value":"certificate"}},{"5":{"Elements":[274,275]}},{"2":{"Name":"SecretStoreListSecretsResultData","Properties":{},"AdditionalProperties":227}},{"8":{"Name":"listSecrets","ResourceType":"Applications.Core/secretStores","ApiVersion":"2023-10-01-preview","Output":273,"Input":0}}] \ No newline at end of file +[{"1":{"Kind":1}},{"1":{"Kind":2}},{"1":{"Kind":3}},{"1":{"Kind":4}},{"1":{"Kind":5}},{"1":{"Kind":6}},{"1":{"Kind":7}},{"1":{"Kind":8}},{"6":{"Value":"Applications.Core/applications"}},{"6":{"Value":"2023-10-01-preview"}},{"2":{"Name":"Applications.Core/applications","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":8,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":9,"Flags":10,"Description":"The resource api version"},"properties":{"Type":11,"Flags":1,"Description":"Application properties"},"tags":{"Type":46,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":47,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"ApplicationProperties","Properties":{"provisioningState":{"Type":19,"Flags":2,"Description":"Provisioning state of the resource at the time the operation was called"},"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the application is linked to"},"extensions":{"Type":34,"Flags":0,"Description":"The application extension."},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[12,13,14,15,16,17,18]}},{"7":{"Name":"Extension","Discriminator":"kind","BaseProperties":{},"Elements":{"daprSidecar":21,"kubernetesMetadata":26,"kubernetesNamespace":30,"manualScaling":32}}},{"2":{"Name":"DaprSidecarExtension","Properties":{"appPort":{"Type":3,"Flags":0,"Description":"The Dapr appPort. Specifies the internal listening port for the application to handle requests from the Dapr sidecar."},"appId":{"Type":4,"Flags":1,"Description":"The Dapr appId. Specifies the identifier used by Dapr for service invocation."},"config":{"Type":4,"Flags":0,"Description":"Specifies the Dapr configuration to use for the resource."},"protocol":{"Type":24,"Flags":0,"Description":"The Dapr sidecar extension protocol"},"kind":{"Type":25,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"6":{"Value":"http"}},{"6":{"Value":"grpc"}},{"5":{"Elements":[22,23]}},{"6":{"Value":"daprSidecar"}},{"2":{"Name":"KubernetesMetadataExtension","Properties":{"annotations":{"Type":27,"Flags":0,"Description":"Annotations to be applied to the Kubernetes resources output by the resource"},"labels":{"Type":28,"Flags":0,"Description":"Labels to be applied to the Kubernetes resources output by the resource"},"kind":{"Type":29,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"2":{"Name":"KubernetesMetadataExtensionAnnotations","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"KubernetesMetadataExtensionLabels","Properties":{},"AdditionalProperties":4}},{"6":{"Value":"kubernetesMetadata"}},{"2":{"Name":"KubernetesNamespaceExtension","Properties":{"namespace":{"Type":4,"Flags":1,"Description":"The namespace of the application environment."},"kind":{"Type":31,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"6":{"Value":"kubernetesNamespace"}},{"2":{"Name":"ManualScalingExtension","Properties":{"replicas":{"Type":3,"Flags":1,"Description":"Replica count."},"kind":{"Type":33,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"6":{"Value":"manualScaling"}},{"3":{"ItemType":20}},{"2":{"Name":"ResourceStatus","Properties":{"compute":{"Type":36,"Flags":0,"Description":"Represents backing compute resource"},"recipe":{"Type":43,"Flags":2,"Description":"Recipe status at deployment time for a resource."},"outputResources":{"Type":45,"Flags":0,"Description":"Properties of an output resource"}}}},{"7":{"Name":"EnvironmentCompute","Discriminator":"kind","BaseProperties":{"resourceId":{"Type":4,"Flags":0,"Description":"The resource id of the compute resource for application environment."},"identity":{"Type":37,"Flags":0,"Description":"IdentitySettings is the external identity setting."}},"Elements":{"kubernetes":41}}},{"2":{"Name":"IdentitySettings","Properties":{"kind":{"Type":40,"Flags":1,"Description":"IdentitySettingKind is the kind of supported external identity setting"},"oidcIssuer":{"Type":4,"Flags":0,"Description":"The URI for your compute platform's OIDC issuer"},"resource":{"Type":4,"Flags":0,"Description":"The resource ID of the provisioned identity"}}}},{"6":{"Value":"undefined"}},{"6":{"Value":"azure.com.workload"}},{"5":{"Elements":[38,39]}},{"2":{"Name":"KubernetesCompute","Properties":{"namespace":{"Type":4,"Flags":1,"Description":"The namespace to use for the environment."},"kind":{"Type":42,"Flags":1,"Description":"Discriminator property for EnvironmentCompute."}}}},{"6":{"Value":"kubernetes"}},{"2":{"Name":"RecipeStatus","Properties":{"templateKind":{"Type":4,"Flags":1,"Description":"TemplateKind is the kind of the recipe template used by the portable resource upon deployment."},"templatePath":{"Type":4,"Flags":1,"Description":"TemplatePath is the path of the recipe consumed by the portable resource upon deployment."},"templateVersion":{"Type":4,"Flags":0,"Description":"TemplateVersion is the version number of the template."}}}},{"2":{"Name":"OutputResource","Properties":{"localId":{"Type":4,"Flags":0,"Description":"The logical identifier scoped to the owning Radius resource. This is only needed or used when a resource has a dependency relationship. LocalIDs do not have any particular format or meaning beyond being compared to determine dependency relationships."},"id":{"Type":4,"Flags":0,"Description":"The UCP resource ID of the underlying resource."},"radiusManaged":{"Type":2,"Flags":0,"Description":"Determines whether Radius manages the lifecycle of the underlying resource."}}}},{"3":{"ItemType":44}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"SystemData","Properties":{"createdBy":{"Type":4,"Flags":0,"Description":"The identity that created the resource."},"createdByType":{"Type":52,"Flags":0,"Description":"The type of identity that created the resource."},"createdAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource creation (UTC)."},"lastModifiedBy":{"Type":4,"Flags":0,"Description":"The identity that last modified the resource."},"lastModifiedByType":{"Type":57,"Flags":0,"Description":"The type of identity that created the resource."},"lastModifiedAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource last modification (UTC)"}}}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[48,49,50,51]}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[53,54,55,56]}},{"4":{"Name":"Applications.Core/applications@2023-10-01-preview","ScopeType":0,"Body":10}},{"6":{"Value":"Applications.Core/containers"}},{"6":{"Value":"2023-10-01-preview"}},{"2":{"Name":"Applications.Core/containers","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":59,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":60,"Flags":10,"Description":"The resource api version"},"properties":{"Type":62,"Flags":1,"Description":"Container properties"},"tags":{"Type":122,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":47,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"ContainerProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the application is linked to"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application"},"provisioningState":{"Type":70,"Flags":2,"Description":"Provisioning state of the resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"container":{"Type":71,"Flags":1,"Description":"Definition of a container"},"connections":{"Type":108,"Flags":0,"Description":"Specifies a connection to another resource."},"identity":{"Type":37,"Flags":0,"Description":"IdentitySettings is the external identity setting."},"extensions":{"Type":109,"Flags":0,"Description":"Extensions spec of the resource"},"resourceProvisioning":{"Type":112,"Flags":0,"Description":"Specifies how the underlying service/resource is provisioned and managed. Available values are 'internal', where Radius manages the lifecycle of the resource internally, and 'manual', where a user manages the resource."},"resources":{"Type":114,"Flags":0,"Description":"A collection of references to resources associated with the container"},"restartPolicy":{"Type":118,"Flags":0,"Description":"Restart policy for the container"},"runtimes":{"Type":119,"Flags":0,"Description":"The properties for runtime configuration"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[63,64,65,66,67,68,69]}},{"2":{"Name":"Container","Properties":{"image":{"Type":4,"Flags":1,"Description":"The registry and image to download and run in your container"},"imagePullPolicy":{"Type":75,"Flags":0,"Description":"The image pull policy for the container"},"env":{"Type":76,"Flags":0,"Description":"environment"},"ports":{"Type":81,"Flags":0,"Description":"container ports"},"readinessProbe":{"Type":82,"Flags":0,"Description":"Properties for readiness/liveness probe"},"livenessProbe":{"Type":82,"Flags":0,"Description":"Properties for readiness/liveness probe"},"volumes":{"Type":101,"Flags":0,"Description":"container volumes"},"command":{"Type":102,"Flags":0,"Description":"Entrypoint array. Overrides the container image's ENTRYPOINT"},"args":{"Type":103,"Flags":0,"Description":"Arguments to the entrypoint. Overrides the container image's CMD"},"workingDir":{"Type":4,"Flags":0,"Description":"Working directory for the container"}}}},{"6":{"Value":"Always"}},{"6":{"Value":"IfNotPresent"}},{"6":{"Value":"Never"}},{"5":{"Elements":[72,73,74]}},{"2":{"Name":"ContainerEnv","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"ContainerPortProperties","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"protocol":{"Type":80,"Flags":0,"Description":"The protocol in use by the port"},"scheme":{"Type":4,"Flags":0,"Description":"Specifies the URL scheme of the communication protocol. Consumers can use the scheme to construct a URL. The value defaults to 'http' or 'https' depending on the port value"},"port":{"Type":3,"Flags":0,"Description":"Specifies the port that will be exposed by this container. Must be set when value different from containerPort is desired"}}}},{"6":{"Value":"TCP"}},{"6":{"Value":"UDP"}},{"5":{"Elements":[78,79]}},{"2":{"Name":"ContainerPorts","Properties":{},"AdditionalProperties":77}},{"7":{"Name":"HealthProbeProperties","Discriminator":"kind","BaseProperties":{"initialDelaySeconds":{"Type":3,"Flags":0,"Description":"Initial delay in seconds before probing for readiness/liveness"},"failureThreshold":{"Type":3,"Flags":0,"Description":"Threshold number of times the probe fails after which a failure would be reported"},"periodSeconds":{"Type":3,"Flags":0,"Description":"Interval for the readiness/liveness probe in seconds"},"timeoutSeconds":{"Type":3,"Flags":0,"Description":"Number of seconds after which the readiness/liveness probe times out. Defaults to 5 seconds"}},"Elements":{"exec":83,"httpGet":85,"tcp":88}}},{"2":{"Name":"ExecHealthProbeProperties","Properties":{"command":{"Type":4,"Flags":1,"Description":"Command to execute to probe readiness/liveness"},"kind":{"Type":84,"Flags":1,"Description":"Discriminator property for HealthProbeProperties."}}}},{"6":{"Value":"exec"}},{"2":{"Name":"HttpGetHealthProbeProperties","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"path":{"Type":4,"Flags":1,"Description":"The route to make the HTTP request on"},"headers":{"Type":86,"Flags":0,"Description":"Custom HTTP headers to add to the get request"},"kind":{"Type":87,"Flags":1,"Description":"Discriminator property for HealthProbeProperties."}}}},{"2":{"Name":"HttpGetHealthProbePropertiesHeaders","Properties":{},"AdditionalProperties":4}},{"6":{"Value":"httpGet"}},{"2":{"Name":"TcpHealthProbeProperties","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"kind":{"Type":89,"Flags":1,"Description":"Discriminator property for HealthProbeProperties."}}}},{"6":{"Value":"tcp"}},{"7":{"Name":"Volume","Discriminator":"kind","BaseProperties":{"mountPath":{"Type":4,"Flags":0,"Description":"The path where the volume is mounted"}},"Elements":{"ephemeral":91,"persistent":96}}},{"2":{"Name":"EphemeralVolume","Properties":{"managedStore":{"Type":94,"Flags":1,"Description":"The managed store for the ephemeral volume"},"kind":{"Type":95,"Flags":1,"Description":"Discriminator property for Volume."}}}},{"6":{"Value":"memory"}},{"6":{"Value":"disk"}},{"5":{"Elements":[92,93]}},{"6":{"Value":"ephemeral"}},{"2":{"Name":"PersistentVolume","Properties":{"permission":{"Type":99,"Flags":0,"Description":"The persistent volume permission"},"source":{"Type":4,"Flags":1,"Description":"The source of the volume"},"kind":{"Type":100,"Flags":1,"Description":"Discriminator property for Volume."}}}},{"6":{"Value":"read"}},{"6":{"Value":"write"}},{"5":{"Elements":[97,98]}},{"6":{"Value":"persistent"}},{"2":{"Name":"ContainerVolumes","Properties":{},"AdditionalProperties":90}},{"3":{"ItemType":4}},{"3":{"ItemType":4}},{"2":{"Name":"ConnectionProperties","Properties":{"source":{"Type":4,"Flags":1,"Description":"The source of the connection"},"disableDefaultEnvVars":{"Type":2,"Flags":0,"Description":"default environment variable override"},"iam":{"Type":105,"Flags":0,"Description":"IAM properties"}}}},{"2":{"Name":"IamProperties","Properties":{"kind":{"Type":106,"Flags":1,"Description":"The kind of IAM provider to configure"},"roles":{"Type":107,"Flags":0,"Description":"RBAC permissions to be assigned on the source resource"}}}},{"6":{"Value":"azure"}},{"3":{"ItemType":4}},{"2":{"Name":"ContainerPropertiesConnections","Properties":{},"AdditionalProperties":104}},{"3":{"ItemType":20}},{"6":{"Value":"internal"}},{"6":{"Value":"manual"}},{"5":{"Elements":[110,111]}},{"2":{"Name":"ResourceReference","Properties":{"id":{"Type":4,"Flags":1,"Description":"Resource id of an existing resource"}}}},{"3":{"ItemType":113}},{"6":{"Value":"Always"}},{"6":{"Value":"OnFailure"}},{"6":{"Value":"Never"}},{"5":{"Elements":[115,116,117]}},{"2":{"Name":"RuntimesProperties","Properties":{"kubernetes":{"Type":120,"Flags":0,"Description":"The runtime configuration properties for Kubernetes"}}}},{"2":{"Name":"KubernetesRuntimeProperties","Properties":{"base":{"Type":4,"Flags":0,"Description":"The serialized YAML manifest which represents the base Kubernetes resources to deploy, such as Deployment, Service, ServiceAccount, Secrets, and ConfigMaps."},"pod":{"Type":121,"Flags":0,"Description":"A strategic merge patch that will be applied to the PodSpec object when this container is being deployed."}}}},{"2":{"Name":"KubernetesPodSpec","Properties":{},"AdditionalProperties":0}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/containers@2023-10-01-preview","ScopeType":0,"Body":61}},{"6":{"Value":"Applications.Core/environments"}},{"6":{"Value":"2023-10-01-preview"}},{"2":{"Name":"Applications.Core/environments","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":124,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":125,"Flags":10,"Description":"The resource api version"},"properties":{"Type":127,"Flags":1,"Description":"Environment properties"},"tags":{"Type":157,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":47,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"EnvironmentProperties","Properties":{"provisioningState":{"Type":135,"Flags":2,"Description":"Provisioning state of the resource at the time the operation was called"},"compute":{"Type":36,"Flags":1,"Description":"Represents backing compute resource"},"providers":{"Type":136,"Flags":0,"Description":"The Cloud providers configuration."},"simulated":{"Type":2,"Flags":0,"Description":"Simulated environment."},"recipes":{"Type":145,"Flags":0,"Description":"Specifies Recipes linked to the Environment."},"recipeConfig":{"Type":146,"Flags":0,"Description":"Configuration for Recipes. Defines how each type of Recipe should be configured and run."},"extensions":{"Type":156,"Flags":0,"Description":"The environment extension."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[128,129,130,131,132,133,134]}},{"2":{"Name":"Providers","Properties":{"azure":{"Type":137,"Flags":0,"Description":"The Azure cloud provider definition."},"aws":{"Type":138,"Flags":0,"Description":"The AWS cloud provider definition."}}}},{"2":{"Name":"ProvidersAzure","Properties":{"scope":{"Type":4,"Flags":1,"Description":"Target scope for Azure resources to be deployed into. For example: '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup'."}}}},{"2":{"Name":"ProvidersAws","Properties":{"scope":{"Type":4,"Flags":1,"Description":"Target scope for AWS resources to be deployed into. For example: '/planes/aws/aws/accounts/000000000000/regions/us-west-2'."}}}},{"7":{"Name":"RecipeProperties","Discriminator":"templateKind","BaseProperties":{"templatePath":{"Type":4,"Flags":1,"Description":"Path to the template provided by the recipe. Currently only link to Azure Container Registry is supported."},"parameters":{"Type":0,"Flags":0,"Description":"Any object"}},"Elements":{"bicep":140,"terraform":142}}},{"2":{"Name":"BicepRecipeProperties","Properties":{"plainHttp":{"Type":2,"Flags":0,"Description":"Connect to the Bicep registry using HTTP (not-HTTPS). This should be used when the registry is known not to support HTTPS, for example in a locally-hosted registry. Defaults to false (use HTTPS/TLS)."},"templateKind":{"Type":141,"Flags":1,"Description":"Discriminator property for RecipeProperties."}}}},{"6":{"Value":"bicep"}},{"2":{"Name":"TerraformRecipeProperties","Properties":{"templateVersion":{"Type":4,"Flags":0,"Description":"Version of the template to deploy. For Terraform recipes using a module registry this is required, but must be omitted for other module sources."},"templateKind":{"Type":143,"Flags":1,"Description":"Discriminator property for RecipeProperties."}}}},{"6":{"Value":"terraform"}},{"2":{"Name":"DictionaryOfRecipeProperties","Properties":{},"AdditionalProperties":139}},{"2":{"Name":"EnvironmentPropertiesRecipes","Properties":{},"AdditionalProperties":144}},{"2":{"Name":"RecipeConfigProperties","Properties":{"terraform":{"Type":147,"Flags":0,"Description":"Configuration for Terraform Recipes. Controls how Terraform plans and applies templates as part of Recipe deployment."},"env":{"Type":155,"Flags":0,"Description":"The environment variables injected during Terraform Recipe execution for the recipes in the environment."}}}},{"2":{"Name":"TerraformConfigProperties","Properties":{"authentication":{"Type":148,"Flags":0,"Description":"Authentication information used to access private Terraform module sources. Supported module sources: Git."},"providers":{"Type":154,"Flags":0,"Description":"Configuration for Terraform Recipe Providers. Controls how Terraform interacts with cloud providers, SaaS providers, and other APIs. For more information, please see: https://developer.hashicorp.com/terraform/language/providers/configuration."}}}},{"2":{"Name":"AuthConfig","Properties":{"git":{"Type":149,"Flags":0,"Description":"Authentication information used to access private Terraform modules from Git repository sources."}}}},{"2":{"Name":"GitAuthConfig","Properties":{"pat":{"Type":151,"Flags":0,"Description":"Personal Access Token (PAT) configuration used to authenticate to Git platforms."}}}},{"2":{"Name":"SecretConfig","Properties":{"secret":{"Type":4,"Flags":0,"Description":"The ID of an Applications.Core/SecretStore resource containing the Git platform personal access token (PAT). The secret store must have a secret named 'pat', containing the PAT value. A secret named 'username' is optional, containing the username associated with the pat. By default no username is specified."}}}},{"2":{"Name":"GitAuthConfigPat","Properties":{},"AdditionalProperties":150}},{"2":{"Name":"ProviderConfigProperties","Properties":{},"AdditionalProperties":0}},{"3":{"ItemType":152}},{"2":{"Name":"TerraformConfigPropertiesProviders","Properties":{},"AdditionalProperties":153}},{"2":{"Name":"EnvironmentVariables","Properties":{},"AdditionalProperties":4}},{"3":{"ItemType":20}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/environments@2023-10-01-preview","ScopeType":0,"Body":126}},{"6":{"Value":"Applications.Core/extenders"}},{"6":{"Value":"2023-10-01-preview"}},{"2":{"Name":"Applications.Core/extenders","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":159,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":160,"Flags":10,"Description":"The resource api version"},"properties":{"Type":162,"Flags":1,"Description":"ExtenderResource portable resource properties"},"tags":{"Type":175,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":47,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"ExtenderProperties","Properties":{"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to"},"application":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by (if applicable)"},"provisioningState":{"Type":170,"Flags":2,"Description":"Provisioning state of the resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"secrets":{"Type":0,"Flags":0,"Description":"Any object"},"recipe":{"Type":171,"Flags":0,"Description":"The recipe used to automatically deploy underlying infrastructure for a portable resource"},"resourceProvisioning":{"Type":174,"Flags":0,"Description":"Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values."}},"AdditionalProperties":0}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[163,164,165,166,167,168,169]}},{"2":{"Name":"Recipe","Properties":{"name":{"Type":4,"Flags":1,"Description":"The name of the recipe within the environment to use"},"parameters":{"Type":0,"Flags":0,"Description":"Any object"}}}},{"6":{"Value":"recipe"}},{"6":{"Value":"manual"}},{"5":{"Elements":[172,173]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/extenders@2023-10-01-preview","ScopeType":0,"Body":161}},{"6":{"Value":"Applications.Core/gateways"}},{"6":{"Value":"2023-10-01-preview"}},{"2":{"Name":"Applications.Core/gateways","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":177,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":178,"Flags":10,"Description":"The resource api version"},"properties":{"Type":180,"Flags":1,"Description":"Gateway properties"},"tags":{"Type":196,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":47,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"GatewayProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the application is linked to"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application"},"provisioningState":{"Type":188,"Flags":2,"Description":"Provisioning state of the resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"internal":{"Type":2,"Flags":0,"Description":"Sets Gateway to not be exposed externally (no public IP address associated). Defaults to false (exposed to internet)."},"hostname":{"Type":189,"Flags":0,"Description":"Declare hostname information for the Gateway. Leaving the hostname empty auto-assigns one: mygateway.myapp.PUBLICHOSTNAMEORIP.nip.io."},"routes":{"Type":191,"Flags":1,"Description":"Routes attached to this Gateway"},"tls":{"Type":192,"Flags":0,"Description":"TLS configuration definition for Gateway resource."},"url":{"Type":4,"Flags":2,"Description":"URL of the gateway resource. Readonly"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[181,182,183,184,185,186,187]}},{"2":{"Name":"GatewayHostname","Properties":{"prefix":{"Type":4,"Flags":0,"Description":"Specify a prefix for the hostname: myhostname.myapp.PUBLICHOSTNAMEORIP.nip.io. Mutually exclusive with 'fullyQualifiedHostname' and will be overridden if both are defined."},"fullyQualifiedHostname":{"Type":4,"Flags":0,"Description":"Specify a fully-qualified domain name: myapp.mydomain.com. Mutually exclusive with 'prefix' and will take priority if both are defined."}}}},{"2":{"Name":"GatewayRoute","Properties":{"path":{"Type":4,"Flags":0,"Description":"The path to match the incoming request path on. Ex - /myservice."},"destination":{"Type":4,"Flags":0,"Description":"The URL or id of the service to route to. Ex - 'http://myservice'."},"replacePrefix":{"Type":4,"Flags":0,"Description":"Optionally update the prefix when sending the request to the service. Ex - replacePrefix: '/' and path: '/myservice' will transform '/myservice/myroute' to '/myroute'"}}}},{"3":{"ItemType":190}},{"2":{"Name":"GatewayTls","Properties":{"sslPassthrough":{"Type":2,"Flags":0,"Description":"If true, gateway lets the https traffic sslPassthrough to the backend servers for decryption."},"minimumProtocolVersion":{"Type":195,"Flags":0,"Description":"Tls Minimum versions for Gateway resource."},"certificateFrom":{"Type":4,"Flags":0,"Description":"The resource id for the secret containing the TLS certificate and key for the gateway."}}}},{"6":{"Value":"1.2"}},{"6":{"Value":"1.3"}},{"5":{"Elements":[193,194]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/gateways@2023-10-01-preview","ScopeType":0,"Body":179}},{"6":{"Value":"Applications.Core/secretStores"}},{"6":{"Value":"2023-10-01-preview"}},{"2":{"Name":"Applications.Core/secretStores","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":198,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":199,"Flags":10,"Description":"The resource api version"},"properties":{"Type":201,"Flags":1,"Description":"The properties of SecretStore"},"tags":{"Type":219,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":47,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"SecretStoreProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the application is linked to"},"application":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the application"},"provisioningState":{"Type":209,"Flags":2,"Description":"Provisioning state of the resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"type":{"Type":212,"Flags":0,"Description":"The type of SecretStore data"},"data":{"Type":218,"Flags":1,"Description":"An object to represent key-value type secrets"},"resource":{"Type":4,"Flags":0,"Description":"The resource id of external secret store."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[202,203,204,205,206,207,208]}},{"6":{"Value":"generic"}},{"6":{"Value":"certificate"}},{"5":{"Elements":[210,211]}},{"2":{"Name":"SecretValueProperties","Properties":{"encoding":{"Type":216,"Flags":0,"Description":"The type of SecretValue Encoding"},"value":{"Type":4,"Flags":0,"Description":"The value of secret."},"valueFrom":{"Type":217,"Flags":0,"Description":"The Secret value source properties"}}}},{"6":{"Value":"raw"}},{"6":{"Value":"base64"}},{"5":{"Elements":[214,215]}},{"2":{"Name":"ValueFromProperties","Properties":{"name":{"Type":4,"Flags":1,"Description":"The name of the referenced secret."},"version":{"Type":4,"Flags":0,"Description":"The version of the referenced secret."}}}},{"2":{"Name":"SecretStorePropertiesData","Properties":{},"AdditionalProperties":213}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/secretStores@2023-10-01-preview","ScopeType":0,"Body":200}},{"6":{"Value":"Applications.Core/volumes"}},{"6":{"Value":"2023-10-01-preview"}},{"2":{"Name":"Applications.Core/volumes","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":221,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":222,"Flags":10,"Description":"The resource api version"},"properties":{"Type":224,"Flags":1,"Description":"Volume properties"},"tags":{"Type":256,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":47,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"7":{"Name":"VolumeProperties","Discriminator":"kind","BaseProperties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the application is linked to"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application"},"provisioningState":{"Type":232,"Flags":2,"Description":"Provisioning state of the resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."}},"Elements":{"azure.com.keyvault":233}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[225,226,227,228,229,230,231]}},{"2":{"Name":"AzureKeyVaultVolumeProperties","Properties":{"certificates":{"Type":246,"Flags":0,"Description":"The KeyVault certificates that this volume exposes"},"keys":{"Type":248,"Flags":0,"Description":"The KeyVault keys that this volume exposes"},"resource":{"Type":4,"Flags":1,"Description":"The ID of the keyvault to use for this volume resource"},"secrets":{"Type":254,"Flags":0,"Description":"The KeyVault secrets that this volume exposes"},"kind":{"Type":255,"Flags":1,"Description":"Discriminator property for VolumeProperties."}}}},{"2":{"Name":"CertificateObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk"},"encoding":{"Type":238,"Flags":0,"Description":"Represents secret encodings"},"format":{"Type":241,"Flags":0,"Description":"Represents certificate formats"},"name":{"Type":4,"Flags":1,"Description":"The name of the certificate"},"certType":{"Type":245,"Flags":0,"Description":"Represents certificate types"},"version":{"Type":4,"Flags":0,"Description":"Certificate version"}}}},{"6":{"Value":"utf-8"}},{"6":{"Value":"hex"}},{"6":{"Value":"base64"}},{"5":{"Elements":[235,236,237]}},{"6":{"Value":"pem"}},{"6":{"Value":"pfx"}},{"5":{"Elements":[239,240]}},{"6":{"Value":"certificate"}},{"6":{"Value":"privatekey"}},{"6":{"Value":"publickey"}},{"5":{"Elements":[242,243,244]}},{"2":{"Name":"AzureKeyVaultVolumePropertiesCertificates","Properties":{},"AdditionalProperties":234}},{"2":{"Name":"KeyObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk"},"name":{"Type":4,"Flags":1,"Description":"The name of the key"},"version":{"Type":4,"Flags":0,"Description":"Key version"}}}},{"2":{"Name":"AzureKeyVaultVolumePropertiesKeys","Properties":{},"AdditionalProperties":247}},{"2":{"Name":"SecretObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk"},"encoding":{"Type":253,"Flags":0,"Description":"Represents secret encodings"},"name":{"Type":4,"Flags":1,"Description":"The name of the secret"},"version":{"Type":4,"Flags":0,"Description":"secret version"}}}},{"6":{"Value":"utf-8"}},{"6":{"Value":"hex"}},{"6":{"Value":"base64"}},{"5":{"Elements":[250,251,252]}},{"2":{"Name":"AzureKeyVaultVolumePropertiesSecrets","Properties":{},"AdditionalProperties":249}},{"6":{"Value":"azure.com.keyvault"}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/volumes@2023-10-01-preview","ScopeType":0,"Body":223}},{"8":{"Name":"listSecrets","ResourceType":"Applications.Core/extenders","ApiVersion":"2023-10-01-preview","Output":0,"Input":0}},{"2":{"Name":"SecretStoreListSecretsResult","Properties":{"type":{"Type":262,"Flags":2,"Description":"The type of SecretStore data"},"data":{"Type":263,"Flags":2,"Description":"An object to represent key-value type secrets"}}}},{"6":{"Value":"generic"}},{"6":{"Value":"certificate"}},{"5":{"Elements":[260,261]}},{"2":{"Name":"SecretStoreListSecretsResultData","Properties":{},"AdditionalProperties":213}},{"8":{"Name":"listSecrets","ResourceType":"Applications.Core/secretStores","ApiVersion":"2023-10-01-preview","Output":259,"Input":0}}] \ No newline at end of file diff --git a/hack/bicep-types-radius/generated/index.json b/hack/bicep-types-radius/generated/index.json index 4f9ae7bee0..2cd93b575c 100644 --- a/hack/bicep-types-radius/generated/index.json +++ b/hack/bicep-types-radius/generated/index.json @@ -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}]}}} \ No newline at end of file +{"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}]}}} \ No newline at end of file diff --git a/pkg/cli/clients/management.go b/pkg/cli/clients/management.go index 20e9fdd243..90a9a60cc1 100644 --- a/pkg/cli/clients/management.go +++ b/pkg/cli/clients/management.go @@ -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" @@ -60,7 +59,6 @@ var ( dapr_ctrl.DaprPubSubBrokersResourceType, ext_ctrl.ResourceTypeName, gtwy_ctrl.ResourceTypeName, - hrt_ctrl.ResourceTypeName, cntr_ctrl.ResourceTypeName, sstr_ctrl.ResourceTypeName, } diff --git a/pkg/cli/clivalidation.go b/pkg/cli/clivalidation.go index 7cb35ff42e..1341cf5ce5 100644 --- a/pkg/cli/clivalidation.go +++ b/pkg/cli/clivalidation.go @@ -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 diff --git a/pkg/cli/cmd/app/graph/display_test.go b/pkg/cli/cmd/app/graph/display_test.go index e9e993e158..d4203f8062 100644 --- a/pkg/cli/cmd/app/graph/display_test.go +++ b/pkg/cli/cmd/app/graph/display_test.go @@ -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" @@ -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, }, }, }, @@ -82,8 +82,8 @@ func Test_display(t *testing.T) { OutputResources: []*corerpv20231001preview.ApplicationGraphOutputResource{}, Connections: []*corerpv20231001preview.ApplicationGraphConnection{ { + ID: &backendID, Direction: &dirOutbound, - ID: &sqlRteID, }, }, }, @@ -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) diff --git a/pkg/cli/cmd/app/status/status_test.go b/pkg/cli/cmd/app/status/status_test.go index 21ba73ee3e..a98f1b503f 100644 --- a/pkg/cli/cmd/app/status/status_test.go +++ b/pkg/cli/cmd/app/status/status_test.go @@ -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"), @@ -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). @@ -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", diff --git a/pkg/cli/cmd/resource/delete/delete.go b/pkg/cli/cmd/resource/delete/delete.go index cb1035494b..5f0eff695b 100644 --- a/pkg/cli/cmd/resource/delete/delete.go +++ b/pkg/cli/cmd/resource/delete/delete.go @@ -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`, diff --git a/pkg/cli/cmd/resource/list/list.go b/pkg/cli/cmd/resource/list/list.go index 4ac79c0cf5..6cb88869b9 100644 --- a/pkg/cli/cmd/resource/list/list.go +++ b/pkg/cli/cmd/resource/list/list.go @@ -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 diff --git a/pkg/cli/cmd/resource/show/show.go b/pkg/cli/cmd/resource/show/show.go index 703905adf0..edf709b20d 100644 --- a/pkg/cli/cmd/resource/show/show.go +++ b/pkg/cli/cmd/resource/show/show.go @@ -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 diff --git a/pkg/corerp/api/v20231001preview/container_conversion.go b/pkg/corerp/api/v20231001preview/container_conversion.go index c15e062159..e92a0c2eff 100644 --- a/pkg/corerp/api/v20231001preview/container_conversion.go +++ b/pkg/corerp/api/v20231001preview/container_conversion.go @@ -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 { @@ -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 { diff --git a/pkg/corerp/api/v20231001preview/httproute_conversion.go b/pkg/corerp/api/v20231001preview/httproute_conversion.go deleted file mode 100644 index bb2df03aa9..0000000000 --- a/pkg/corerp/api/v20231001preview/httproute_conversion.go +++ /dev/null @@ -1,82 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v20231001preview - -import ( - v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" - "github.com/radius-project/radius/pkg/corerp/datamodel" - rpv1 "github.com/radius-project/radius/pkg/rp/v1" - "github.com/radius-project/radius/pkg/to" -) - -// ConvertTo converts from the versioned HTTPRoute resource to version-agnostic datamodel. -func (src *HTTPRouteResource) ConvertTo() (v1.DataModelInterface, error) { - // Note: SystemData conversion isn't required since this property comes ARM and datastore. - converted := &datamodel.HTTPRoute{ - BaseResource: v1.BaseResource{ - TrackedResource: v1.TrackedResource{ - ID: to.String(src.ID), - Name: to.String(src.Name), - Type: to.String(src.Type), - Location: to.String(src.Location), - Tags: to.StringMap(src.Tags), - }, - InternalMetadata: v1.InternalMetadata{ - UpdatedAPIVersion: Version, - AsyncProvisioningState: toProvisioningStateDataModel(src.Properties.ProvisioningState), - }, - }, - Properties: &datamodel.HTTPRouteProperties{ - BasicResourceProperties: rpv1.BasicResourceProperties{ - Application: to.String(src.Properties.Application), - }, - Hostname: to.String(src.Properties.Hostname), - Port: to.Int32(src.Properties.Port), - Scheme: to.String(src.Properties.Scheme), - URL: to.String(src.Properties.URL), - }, - } - return converted, nil -} - -// ConvertFrom converts from version-agnostic datamodel to the versioned HTTPRoute resource. -func (dst *HTTPRouteResource) ConvertFrom(src v1.DataModelInterface) error { - route, ok := src.(*datamodel.HTTPRoute) - if !ok { - return v1.ErrInvalidModelConversion - } - - dst.ID = to.Ptr(route.ID) - dst.Name = to.Ptr(route.Name) - dst.Type = to.Ptr(route.Type) - dst.SystemData = fromSystemDataModel(route.SystemData) - dst.Location = to.Ptr(route.Location) - dst.Tags = *to.StringMapPtr(route.Tags) - dst.Properties = &HTTPRouteProperties{ - Status: &ResourceStatus{ - OutputResources: toOutputResourcesDataModel(route.Properties.Status.OutputResources), - }, - ProvisioningState: fromProvisioningStateDataModel(route.InternalMetadata.AsyncProvisioningState), - Application: to.Ptr(route.Properties.Application), - Hostname: to.Ptr(route.Properties.Hostname), - Port: to.Ptr(route.Properties.Port), - Scheme: to.Ptr(route.Properties.Scheme), - URL: to.Ptr(route.Properties.URL), - } - - return nil -} diff --git a/pkg/corerp/api/v20231001preview/httproute_conversion_test.go b/pkg/corerp/api/v20231001preview/httproute_conversion_test.go deleted file mode 100644 index 00fb40c690..0000000000 --- a/pkg/corerp/api/v20231001preview/httproute_conversion_test.go +++ /dev/null @@ -1,95 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v20231001preview - -import ( - "encoding/json" - "testing" - - v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" - "github.com/radius-project/radius/pkg/corerp/datamodel" - rpv1 "github.com/radius-project/radius/pkg/rp/v1" - "github.com/radius-project/radius/test/testutil" - "github.com/radius-project/radius/test/testutil/resourcetypeutil" - - "github.com/stretchr/testify/require" -) - -func TestHTTPRouteConvertVersionedToDataModel(t *testing.T) { - // arrange - rawPayload := testutil.ReadFixture("httprouteresource.json") - r := &HTTPRouteResource{} - err := json.Unmarshal(rawPayload, r) - require.NoError(t, err) - - // act - dm, err := r.ConvertTo() - - // assert - require.NoError(t, err) - ct := dm.(*datamodel.HTTPRoute) - require.Equal(t, "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/httpRoutes/route0", ct.ID) - require.Equal(t, "route0", ct.Name) - require.Equal(t, "Applications.Core/httpRoutes", ct.Type) - require.Equal(t, "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", ct.Properties.Application) - require.Equal(t, "localhost", ct.Properties.Hostname) - require.Equal(t, int32(8080), ct.Properties.Port) - require.Equal(t, "http", ct.Properties.Scheme) - require.Equal(t, "http://testapplications.com/httproute/", ct.Properties.URL) - require.Equal(t, []rpv1.OutputResource(nil), ct.Properties.Status.OutputResources) - require.Equal(t, "2023-10-01-preview", ct.InternalMetadata.UpdatedAPIVersion) -} - -func TestHTTPRouteConvertDataModelToVersioned(t *testing.T) { - // arrange - rawPayload := testutil.ReadFixture("httprouteresourcedatamodel.json") - r := &datamodel.HTTPRoute{} - err := json.Unmarshal(rawPayload, r) - require.NoError(t, err) - - // act - versioned := &HTTPRouteResource{} - err = versioned.ConvertFrom(r) - - // assert - require.NoError(t, err) - require.Equal(t, "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/httpRoutes/route0", r.ID) - require.Equal(t, "route0", r.Name) - require.Equal(t, "Applications.Core/httpRoutes", r.Type) - require.Equal(t, "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", r.Properties.Application) - require.Equal(t, "localhost", r.Properties.Hostname) - require.Equal(t, int32(8080), r.Properties.Port) - require.Equal(t, "http", r.Properties.Scheme) - require.Equal(t, "http://testapplications.com/httproute/", r.Properties.URL) - require.Equal(t, resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), versioned.Properties.Status) -} - -func TestHTTPRouteConvertFromValidation(t *testing.T) { - validationTests := []struct { - src v1.DataModelInterface - err error - }{ - {&resourcetypeutil.FakeResource{}, v1.ErrInvalidModelConversion}, - {nil, v1.ErrInvalidModelConversion}, - } - - for _, tc := range validationTests { - versioned := &HTTPRouteResource{} - err := versioned.ConvertFrom(tc.src) - require.ErrorAs(t, tc.err, &err) - } -} diff --git a/pkg/corerp/api/v20231001preview/testdata/httprouteresource.json b/pkg/corerp/api/v20231001preview/testdata/httprouteresource.json deleted file mode 100644 index 039861adc5..0000000000 --- a/pkg/corerp/api/v20231001preview/testdata/httprouteresource.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/httpRoutes/route0", - "name": "route0", - "type": "Applications.Core/httpRoutes", - "properties": { - "status": { - "outputResources": [ - { - "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" - } - ] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "hostname": "localhost", - "port": 8080, - "scheme": "http", - "url": "http://testapplications.com/httproute/" - } -} \ No newline at end of file diff --git a/pkg/corerp/api/v20231001preview/testdata/httprouteresourcedatamodel.json b/pkg/corerp/api/v20231001preview/testdata/httprouteresourcedatamodel.json deleted file mode 100644 index b2b3eb364c..0000000000 --- a/pkg/corerp/api/v20231001preview/testdata/httprouteresourcedatamodel.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/httpRoutes/route0", - "name": "route0", - "type": "Applications.Core/httpRoutes", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" - }, - "tags": { - "env": "dev" - }, - "properties": { - "status": { - "outputResources": [ - { - "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" - } - ] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "hostname": "localhost", - "port": 8080, - "scheme": "http", - "url": "http://testapplications.com/httproute/" - } -} \ No newline at end of file diff --git a/pkg/corerp/api/v20231001preview/volume_conversion.go b/pkg/corerp/api/v20231001preview/volume_conversion.go index 804101c4bb..ba9b69e11b 100644 --- a/pkg/corerp/api/v20231001preview/volume_conversion.go +++ b/pkg/corerp/api/v20231001preview/volume_conversion.go @@ -23,7 +23,7 @@ import ( "github.com/radius-project/radius/pkg/to" ) -// ConvertTo converts from the versioned HTTPRoute resource to version-agnostic datamodel. +// ConvertTo converts from the versioned Volume resource to version-agnostic datamodel. func (src *VolumeResource) ConvertTo() (v1.DataModelInterface, error) { converted := &datamodel.VolumeResource{ BaseResource: v1.BaseResource{ diff --git a/pkg/corerp/api/v20231001preview/volume_conversion_test.go b/pkg/corerp/api/v20231001preview/volume_conversion_test.go index 04610cff15..5c2d1df363 100644 --- a/pkg/corerp/api/v20231001preview/volume_conversion_test.go +++ b/pkg/corerp/api/v20231001preview/volume_conversion_test.go @@ -87,7 +87,7 @@ func TestVolumeConvertFromValidation(t *testing.T) { } for _, tc := range validationTests { - versioned := &HTTPRouteResource{} + versioned := &VolumeResource{} err := versioned.ConvertFrom(tc.src) require.ErrorAs(t, tc.err, &err) } diff --git a/pkg/corerp/api/v20231001preview/zz_generated_client_factory.go b/pkg/corerp/api/v20231001preview/zz_generated_client_factory.go index 9a00d152bb..99dcc0c53a 100644 --- a/pkg/corerp/api/v20231001preview/zz_generated_client_factory.go +++ b/pkg/corerp/api/v20231001preview/zz_generated_client_factory.go @@ -63,11 +63,6 @@ func (c *ClientFactory) NewGatewaysClient() *GatewaysClient { return subClient } -func (c *ClientFactory) NewHTTPRoutesClient() *HTTPRoutesClient { - subClient, _ := NewHTTPRoutesClient(c.rootScope, c.credential, c.options) - return subClient -} - func (c *ClientFactory) NewOperationsClient() *OperationsClient { subClient, _ := NewOperationsClient(c.credential, c.options) return subClient diff --git a/pkg/corerp/api/v20231001preview/zz_generated_httproutes_client.go b/pkg/corerp/api/v20231001preview/zz_generated_httproutes_client.go deleted file mode 100644 index c070d49c52..0000000000 --- a/pkg/corerp/api/v20231001preview/zz_generated_httproutes_client.go +++ /dev/null @@ -1,347 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package v20231001preview - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// HTTPRoutesClient contains the methods for the HTTPRoutes group. -// Don't use this type directly, use NewHTTPRoutesClient() instead. -type HTTPRoutesClient struct { - internal *arm.Client - rootScope string -} - -// NewHTTPRoutesClient creates a new instance of HTTPRoutesClient with the specified values. -// - rootScope - The scope in which the resource is present. UCP Scope is /planes/{planeType}/{planeName}/resourceGroup/{resourcegroupID} -// and Azure resource scope is -// /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewHTTPRoutesClient(rootScope string, credential azcore.TokenCredential, options *arm.ClientOptions) (*HTTPRoutesClient, error) { - cl, err := arm.NewClient(moduleName+".HTTPRoutesClient", moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &HTTPRoutesClient{ - rootScope: rootScope, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - Create a HttpRouteResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-01-preview -// - httpRouteName - HTTPRoute name -// - resource - Resource create parameters. -// - options - HTTPRoutesClientBeginCreateOrUpdateOptions contains the optional parameters for the HTTPRoutesClient.BeginCreateOrUpdate -// method. -func (client *HTTPRoutesClient) BeginCreateOrUpdate(ctx context.Context, httpRouteName string, resource HTTPRouteResource, options *HTTPRoutesClientBeginCreateOrUpdateOptions) (*runtime.Poller[HTTPRoutesClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, httpRouteName, resource, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[HTTPRoutesClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken[HTTPRoutesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) - } -} - -// CreateOrUpdate - Create a HttpRouteResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-01-preview -func (client *HTTPRoutesClient) createOrUpdate(ctx context.Context, httpRouteName string, resource HTTPRouteResource, options *HTTPRoutesClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - req, err := client.createOrUpdateCreateRequest(ctx, httpRouteName, resource, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *HTTPRoutesClient) createOrUpdateCreateRequest(ctx context.Context, httpRouteName string, resource HTTPRouteResource, options *HTTPRoutesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Core/httpRoutes/{httpRouteName}" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - if httpRouteName == "" { - return nil, errors.New("parameter httpRouteName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{httpRouteName}", url.PathEscape(httpRouteName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, resource); err != nil { - return nil, err -} - return req, nil -} - -// BeginDelete - Delete a HttpRouteResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-01-preview -// - httpRouteName - HTTPRoute name -// - options - HTTPRoutesClientBeginDeleteOptions contains the optional parameters for the HTTPRoutesClient.BeginDelete method. -func (client *HTTPRoutesClient) BeginDelete(ctx context.Context, httpRouteName string, options *HTTPRoutesClientBeginDeleteOptions) (*runtime.Poller[HTTPRoutesClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, httpRouteName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[HTTPRoutesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken[HTTPRoutesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) - } -} - -// Delete - Delete a HttpRouteResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-01-preview -func (client *HTTPRoutesClient) deleteOperation(ctx context.Context, httpRouteName string, options *HTTPRoutesClientBeginDeleteOptions) (*http.Response, error) { - var err error - req, err := client.deleteCreateRequest(ctx, httpRouteName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *HTTPRoutesClient) deleteCreateRequest(ctx context.Context, httpRouteName string, options *HTTPRoutesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Core/httpRoutes/{httpRouteName}" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - if httpRouteName == "" { - return nil, errors.New("parameter httpRouteName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{httpRouteName}", url.PathEscape(httpRouteName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Get a HttpRouteResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-01-preview -// - httpRouteName - HTTPRoute name -// - options - HTTPRoutesClientGetOptions contains the optional parameters for the HTTPRoutesClient.Get method. -func (client *HTTPRoutesClient) Get(ctx context.Context, httpRouteName string, options *HTTPRoutesClientGetOptions) (HTTPRoutesClientGetResponse, error) { - var err error - req, err := client.getCreateRequest(ctx, httpRouteName, options) - if err != nil { - return HTTPRoutesClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return HTTPRoutesClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return HTTPRoutesClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *HTTPRoutesClient) getCreateRequest(ctx context.Context, httpRouteName string, options *HTTPRoutesClientGetOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Core/httpRoutes/{httpRouteName}" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - if httpRouteName == "" { - return nil, errors.New("parameter httpRouteName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{httpRouteName}", url.PathEscape(httpRouteName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *HTTPRoutesClient) getHandleResponse(resp *http.Response) (HTTPRoutesClientGetResponse, error) { - result := HTTPRoutesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.HTTPRouteResource); err != nil { - return HTTPRoutesClientGetResponse{}, err - } - return result, nil -} - -// NewListByScopePager - List HttpRouteResource resources by Scope -// -// Generated from API version 2023-10-01-preview -// - options - HTTPRoutesClientListByScopeOptions contains the optional parameters for the HTTPRoutesClient.NewListByScopePager -// method. -func (client *HTTPRoutesClient) NewListByScopePager(options *HTTPRoutesClientListByScopeOptions) (*runtime.Pager[HTTPRoutesClientListByScopeResponse]) { - return runtime.NewPager(runtime.PagingHandler[HTTPRoutesClientListByScopeResponse]{ - More: func(page HTTPRoutesClientListByScopeResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *HTTPRoutesClientListByScopeResponse) (HTTPRoutesClientListByScopeResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByScopeCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return HTTPRoutesClientListByScopeResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return HTTPRoutesClientListByScopeResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return HTTPRoutesClientListByScopeResponse{}, runtime.NewResponseError(resp) - } - return client.listByScopeHandleResponse(resp) - }, - }) -} - -// listByScopeCreateRequest creates the ListByScope request. -func (client *HTTPRoutesClient) listByScopeCreateRequest(ctx context.Context, options *HTTPRoutesClientListByScopeOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Core/httpRoutes" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByScopeHandleResponse handles the ListByScope response. -func (client *HTTPRoutesClient) listByScopeHandleResponse(resp *http.Response) (HTTPRoutesClientListByScopeResponse, error) { - result := HTTPRoutesClientListByScopeResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.HTTPRouteResourceListResult); err != nil { - return HTTPRoutesClientListByScopeResponse{}, err - } - return result, nil -} - -// BeginUpdate - Update a HttpRouteResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-01-preview -// - httpRouteName - HTTPRoute name -// - properties - The resource properties to be updated. -// - options - HTTPRoutesClientBeginUpdateOptions contains the optional parameters for the HTTPRoutesClient.BeginUpdate method. -func (client *HTTPRoutesClient) BeginUpdate(ctx context.Context, httpRouteName string, properties HTTPRouteResourceUpdate, options *HTTPRoutesClientBeginUpdateOptions) (*runtime.Poller[HTTPRoutesClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, httpRouteName, properties, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[HTTPRoutesClientUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken[HTTPRoutesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) - } -} - -// Update - Update a HttpRouteResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-01-preview -func (client *HTTPRoutesClient) update(ctx context.Context, httpRouteName string, properties HTTPRouteResourceUpdate, options *HTTPRoutesClientBeginUpdateOptions) (*http.Response, error) { - var err error - req, err := client.updateCreateRequest(ctx, httpRouteName, properties, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *HTTPRoutesClient) updateCreateRequest(ctx context.Context, httpRouteName string, properties HTTPRouteResourceUpdate, options *HTTPRoutesClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Core/httpRoutes/{httpRouteName}" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - if httpRouteName == "" { - return nil, errors.New("parameter httpRouteName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{httpRouteName}", url.PathEscape(httpRouteName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, properties); err != nil { - return nil, err -} - return req, nil -} - diff --git a/pkg/corerp/api/v20231001preview/zz_generated_models.go b/pkg/corerp/api/v20231001preview/zz_generated_models.go index 010a8f4d2d..dd7897f6a7 100644 --- a/pkg/corerp/api/v20231001preview/zz_generated_models.go +++ b/pkg/corerp/api/v20231001preview/zz_generated_models.go @@ -310,9 +310,6 @@ type ContainerPortProperties struct { // Protocol in use by the port Protocol *PortProtocol - // Specifies a route provided by this port - Provides *string - // Specifies the URL scheme of the communication protocol. Consumers can use the scheme to construct a URL. The value defaults // to 'http' or 'https' depending on the port value Scheme *string @@ -329,9 +326,6 @@ type ContainerPortPropertiesUpdate struct { // Protocol in use by the port Protocol *PortProtocol - // Specifies a route provided by this port - Provides *string - // Specifies the URL scheme of the communication protocol. Consumers can use the scheme to construct a URL. The value defaults // to 'http' or 'https' depending on the port value Scheme *string @@ -914,7 +908,7 @@ type GatewayResourceUpdateProperties struct { // GatewayRoute - Route attached to Gateway type GatewayRoute struct { - // The HttpRoute to route to. Ex - myserviceroute.id. + // The URL or id of the service to route to. Ex - 'http://myservice'. Destination *string // The path to match the incoming request path on. Ex - /myservice. @@ -981,90 +975,6 @@ func (h *HTTPGetHealthProbeProperties) GetHealthProbeProperties() *HealthProbePr } } -// HTTPRouteProperties - HTTPRoute properties -type HTTPRouteProperties struct { - // REQUIRED; Fully qualified resource ID for the application - Application *string - - // Fully qualified resource ID for the environment that the application is linked to - Environment *string - - // The internal hostname accepting traffic for the HTTP Route. Readonly. - Hostname *string - - // The port number for the HTTP Route. Defaults to 80. Readonly. - Port *int32 - - // READ-ONLY; The status of the asynchronous operation. - ProvisioningState *ProvisioningState - - // READ-ONLY; The scheme used for traffic. Readonly. - Scheme *string - - // READ-ONLY; Status of a resource. - Status *ResourceStatus - - // READ-ONLY; A stable URL that that can be used to route traffic to a resource. Readonly. - URL *string -} - -// HTTPRouteResource - Radius HTTPRoute Resource. -type HTTPRouteResource struct { - // REQUIRED; The geo-location where the resource lives - Location *string - - // REQUIRED; The resource-specific properties for this resource. - Properties *HTTPRouteProperties - - // Resource tags. - Tags map[string]*string - - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} - -// HTTPRouteResourceListResult - The response of a HttpRouteResource list operation. -type HTTPRouteResourceListResult struct { - // REQUIRED; The HttpRouteResource items on this page - Value []*HTTPRouteResource - - // The link to the next page of items - NextLink *string -} - -// HTTPRouteResourceUpdate - The type used for update operations of the HttpRouteResource. -type HTTPRouteResourceUpdate struct { - // The updatable properties of the HttpRouteResource. - Properties *HTTPRouteResourceUpdateProperties - - // Resource tags. - Tags map[string]*string -} - -// HTTPRouteResourceUpdateProperties - The updatable properties of the HttpRouteResource. -type HTTPRouteResourceUpdateProperties struct { - // Fully qualified resource ID for the application - Application *string - - // Fully qualified resource ID for the environment that the application is linked to - Environment *string - - // The internal hostname accepting traffic for the HTTP Route. Readonly. - Hostname *string - - // The port number for the HTTP Route. Defaults to 80. Readonly. - Port *int32 -} - // HealthProbeProperties - Properties for readiness/liveness probe type HealthProbeProperties struct { // REQUIRED; Discriminator property for HealthProbeProperties. diff --git a/pkg/corerp/api/v20231001preview/zz_generated_models_serde.go b/pkg/corerp/api/v20231001preview/zz_generated_models_serde.go index 742fca77ce..95a61a5def 100644 --- a/pkg/corerp/api/v20231001preview/zz_generated_models_serde.go +++ b/pkg/corerp/api/v20231001preview/zz_generated_models_serde.go @@ -687,7 +687,6 @@ func (c ContainerPortProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "containerPort", c.ContainerPort) populate(objectMap, "port", c.Port) populate(objectMap, "protocol", c.Protocol) - populate(objectMap, "provides", c.Provides) populate(objectMap, "scheme", c.Scheme) return json.Marshal(objectMap) } @@ -710,9 +709,6 @@ func (c *ContainerPortProperties) UnmarshalJSON(data []byte) error { case "protocol": err = unpopulate(val, "Protocol", &c.Protocol) delete(rawMsg, key) - case "provides": - err = unpopulate(val, "Provides", &c.Provides) - delete(rawMsg, key) case "scheme": err = unpopulate(val, "Scheme", &c.Scheme) delete(rawMsg, key) @@ -730,7 +726,6 @@ func (c ContainerPortPropertiesUpdate) MarshalJSON() ([]byte, error) { populate(objectMap, "containerPort", c.ContainerPort) populate(objectMap, "port", c.Port) populate(objectMap, "protocol", c.Protocol) - populate(objectMap, "provides", c.Provides) populate(objectMap, "scheme", c.Scheme) return json.Marshal(objectMap) } @@ -753,9 +748,6 @@ func (c *ContainerPortPropertiesUpdate) UnmarshalJSON(data []byte) error { case "protocol": err = unpopulate(val, "Protocol", &c.Protocol) delete(rawMsg, key) - case "provides": - err = unpopulate(val, "Provides", &c.Provides) - delete(rawMsg, key) case "scheme": err = unpopulate(val, "Scheme", &c.Scheme) delete(rawMsg, key) @@ -2257,213 +2249,6 @@ func (h *HTTPGetHealthProbeProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type HTTPRouteProperties. -func (h HTTPRouteProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "application", h.Application) - populate(objectMap, "environment", h.Environment) - populate(objectMap, "hostname", h.Hostname) - populate(objectMap, "port", h.Port) - populate(objectMap, "provisioningState", h.ProvisioningState) - populate(objectMap, "scheme", h.Scheme) - populate(objectMap, "status", h.Status) - populate(objectMap, "url", h.URL) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPRouteProperties. -func (h *HTTPRouteProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "application": - err = unpopulate(val, "Application", &h.Application) - delete(rawMsg, key) - case "environment": - err = unpopulate(val, "Environment", &h.Environment) - delete(rawMsg, key) - case "hostname": - err = unpopulate(val, "Hostname", &h.Hostname) - delete(rawMsg, key) - case "port": - err = unpopulate(val, "Port", &h.Port) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &h.ProvisioningState) - delete(rawMsg, key) - case "scheme": - err = unpopulate(val, "Scheme", &h.Scheme) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &h.Status) - delete(rawMsg, key) - case "url": - err = unpopulate(val, "URL", &h.URL) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type HTTPRouteResource. -func (h HTTPRouteResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", h.ID) - populate(objectMap, "location", h.Location) - populate(objectMap, "name", h.Name) - populate(objectMap, "properties", h.Properties) - populate(objectMap, "systemData", h.SystemData) - populate(objectMap, "tags", h.Tags) - populate(objectMap, "type", h.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPRouteResource. -func (h *HTTPRouteResource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &h.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &h.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &h.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &h.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &h.SystemData) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &h.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &h.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type HTTPRouteResourceListResult. -func (h HTTPRouteResourceListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", h.NextLink) - populate(objectMap, "value", h.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPRouteResourceListResult. -func (h *HTTPRouteResourceListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &h.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &h.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type HTTPRouteResourceUpdate. -func (h HTTPRouteResourceUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "properties", h.Properties) - populate(objectMap, "tags", h.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPRouteResourceUpdate. -func (h *HTTPRouteResourceUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "properties": - err = unpopulate(val, "Properties", &h.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &h.Tags) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type HTTPRouteResourceUpdateProperties. -func (h HTTPRouteResourceUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "application", h.Application) - populate(objectMap, "environment", h.Environment) - populate(objectMap, "hostname", h.Hostname) - populate(objectMap, "port", h.Port) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPRouteResourceUpdateProperties. -func (h *HTTPRouteResourceUpdateProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "application": - err = unpopulate(val, "Application", &h.Application) - delete(rawMsg, key) - case "environment": - err = unpopulate(val, "Environment", &h.Environment) - delete(rawMsg, key) - case "hostname": - err = unpopulate(val, "Hostname", &h.Hostname) - delete(rawMsg, key) - case "port": - err = unpopulate(val, "Port", &h.Port) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type HealthProbeProperties. func (h HealthProbeProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) diff --git a/pkg/corerp/api/v20231001preview/zz_generated_options.go b/pkg/corerp/api/v20231001preview/zz_generated_options.go index 0df4478c18..b5984dbc9a 100644 --- a/pkg/corerp/api/v20231001preview/zz_generated_options.go +++ b/pkg/corerp/api/v20231001preview/zz_generated_options.go @@ -158,35 +158,6 @@ type GatewaysClientListByScopeOptions struct { // placeholder for future optional parameters } -// HTTPRoutesClientBeginCreateOrUpdateOptions contains the optional parameters for the HTTPRoutesClient.BeginCreateOrUpdate -// method. -type HTTPRoutesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// HTTPRoutesClientBeginDeleteOptions contains the optional parameters for the HTTPRoutesClient.BeginDelete method. -type HTTPRoutesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// HTTPRoutesClientBeginUpdateOptions contains the optional parameters for the HTTPRoutesClient.BeginUpdate method. -type HTTPRoutesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// HTTPRoutesClientGetOptions contains the optional parameters for the HTTPRoutesClient.Get method. -type HTTPRoutesClientGetOptions struct { - // placeholder for future optional parameters -} - -// HTTPRoutesClientListByScopeOptions contains the optional parameters for the HTTPRoutesClient.NewListByScopePager method. -type HTTPRoutesClientListByScopeOptions struct { - // placeholder for future optional parameters -} - // OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. type OperationsClientListOptions struct { // placeholder for future optional parameters diff --git a/pkg/corerp/api/v20231001preview/zz_generated_response_types.go b/pkg/corerp/api/v20231001preview/zz_generated_response_types.go index bee4700718..d00c2577bf 100644 --- a/pkg/corerp/api/v20231001preview/zz_generated_response_types.go +++ b/pkg/corerp/api/v20231001preview/zz_generated_response_types.go @@ -170,35 +170,6 @@ type GatewaysClientListByScopeResponse struct { GatewayResourceListResult } -// HTTPRoutesClientCreateOrUpdateResponse contains the response from method HTTPRoutesClient.BeginCreateOrUpdate. -type HTTPRoutesClientCreateOrUpdateResponse struct { - // Radius HTTPRoute Resource. - HTTPRouteResource -} - -// HTTPRoutesClientDeleteResponse contains the response from method HTTPRoutesClient.BeginDelete. -type HTTPRoutesClientDeleteResponse struct { - // placeholder for future response values -} - -// HTTPRoutesClientGetResponse contains the response from method HTTPRoutesClient.Get. -type HTTPRoutesClientGetResponse struct { - // Radius HTTPRoute Resource. - HTTPRouteResource -} - -// HTTPRoutesClientListByScopeResponse contains the response from method HTTPRoutesClient.NewListByScopePager. -type HTTPRoutesClientListByScopeResponse struct { - // The response of a HttpRouteResource list operation. - HTTPRouteResourceListResult -} - -// HTTPRoutesClientUpdateResponse contains the response from method HTTPRoutesClient.BeginUpdate. -type HTTPRoutesClientUpdateResponse struct { - // Radius HTTPRoute Resource. - HTTPRouteResource -} - // OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { // A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. diff --git a/pkg/corerp/backend/controller/createorupdateresource.go b/pkg/corerp/backend/controller/createorupdateresource.go index 3ca8c6787b..8a9a5f0b60 100644 --- a/pkg/corerp/backend/controller/createorupdateresource.go +++ b/pkg/corerp/backend/controller/createorupdateresource.go @@ -28,7 +28,6 @@ import ( "github.com/radius-project/radius/pkg/corerp/datamodel" "github.com/radius-project/radius/pkg/corerp/renderers/container" "github.com/radius-project/radius/pkg/corerp/renderers/gateway" - "github.com/radius-project/radius/pkg/corerp/renderers/httproute" "github.com/radius-project/radius/pkg/corerp/renderers/volume" rpv1 "github.com/radius-project/radius/pkg/rp/v1" "github.com/radius-project/radius/pkg/ucp/resources" @@ -54,8 +53,6 @@ func getDataModel(id resources.ID) (v1.DataModelInterface, error) { return &datamodel.ContainerResource{}, nil case strings.ToLower(gateway.ResourceType): return &datamodel.Gateway{}, nil - case strings.ToLower(httproute.ResourceType): - return &datamodel.HTTPRoute{}, nil case strings.ToLower(volume.ResourceType): return &datamodel.VolumeResource{}, nil default: diff --git a/pkg/corerp/backend/controller/createorupdateresource_test.go b/pkg/corerp/backend/controller/createorupdateresource_test.go index 25246d7894..ae141d2f25 100644 --- a/pkg/corerp/backend/controller/createorupdateresource_test.go +++ b/pkg/corerp/backend/controller/createorupdateresource_test.go @@ -32,7 +32,6 @@ import ( "github.com/radius-project/radius/pkg/corerp/renderers" "github.com/radius-project/radius/pkg/corerp/renderers/container" "github.com/radius-project/radius/pkg/corerp/renderers/gateway" - "github.com/radius-project/radius/pkg/corerp/renderers/httproute" ds_ctrl "github.com/radius-project/radius/pkg/datastoresrp/frontend/controller" rpv1 "github.com/radius-project/radius/pkg/rp/v1" "github.com/radius-project/radius/pkg/ucp/resources" @@ -100,30 +99,6 @@ func TestCreateOrUpdateResourceRun_20231001Preview(t *testing.T) { nil, errors.New("error getting object"), }, - { - "http-route-put-success", - httproute.ResourceType, - "APPLICATIONS.CORE/HTTPROUTES|PUT", - fmt.Sprintf("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/httpRoutes/%s", uuid.NewString()), - nil, - false, - nil, - nil, - nil, - nil, - }, - { - "http-route-put-not-found", - httproute.ResourceType, - "APPLICATIONS.CORE/HTTPROUTES|PUT", - fmt.Sprintf("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/httpRoutes/%s", uuid.NewString()), - &store.ErrNotFound{}, - false, - nil, - nil, - nil, - nil, - }, { "gateway-put-success", gateway.ResourceType, @@ -297,30 +272,6 @@ func TestCreateOrUpdateResourceRun_20231001Preview(t *testing.T) { nil, errors.New("error getting object"), }, - { - "http-route-patch-success", - httproute.ResourceType, - "APPLICATIONS.CORE/HTTPROUTES|PATCH", - fmt.Sprintf("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/httpRoutes/%s", uuid.NewString()), - nil, - false, - nil, - nil, - nil, - nil, - }, - { - "http-route-patch-not-found", - httproute.ResourceType, - "APPLICATIONS.CORE/HTTPROUTES|PATCH", - fmt.Sprintf("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/httpRoutes/%s", uuid.NewString()), - &store.ErrNotFound{}, - false, - nil, - nil, - nil, - &store.ErrNotFound{}, - }, { "gateway-patch-success", gateway.ResourceType, diff --git a/pkg/corerp/backend/deployment/deploymentprocessor.go b/pkg/corerp/backend/deployment/deploymentprocessor.go index f149a06973..e6a7193085 100644 --- a/pkg/corerp/backend/deployment/deploymentprocessor.go +++ b/pkg/corerp/backend/deployment/deploymentprocessor.go @@ -514,12 +514,6 @@ func (dp *deploymentProcessor) getResourceDataByID(ctx context.Context, resource return ResourceData{}, fmt.Errorf(errMsg, resourceID.String(), err) } return dp.buildResourceDependency(resourceID, obj.Properties.Application, obj, obj.Properties.Status.OutputResources, obj.ComputedValues, obj.SecretValues, portableresources.RecipeData{}) - case strings.ToLower(corerp_dm.HTTPRouteResourceType): - obj := &corerp_dm.HTTPRoute{} - if err = resource.As(obj); err != nil { - return ResourceData{}, fmt.Errorf(errMsg, resourceID.String(), err) - } - return dp.buildResourceDependency(resourceID, obj.Properties.Application, obj, obj.Properties.Status.OutputResources, obj.ComputedValues, obj.SecretValues, portableresources.RecipeData{}) case strings.ToLower(corerp_dm.SecretStoreResourceType): obj := &corerp_dm.SecretStore{} if err = resource.As(obj); err != nil { diff --git a/pkg/corerp/backend/deployment/deploymentprocessor_test.go b/pkg/corerp/backend/deployment/deploymentprocessor_test.go index ad67d91920..e49eecee3f 100644 --- a/pkg/corerp/backend/deployment/deploymentprocessor_test.go +++ b/pkg/corerp/backend/deployment/deploymentprocessor_test.go @@ -301,21 +301,20 @@ func Test_Render(t *testing.T) { }, } - mocks := setup(t) - dp := deploymentProcessor{mocks.model, mocks.dbProvider, nil, nil} - t.Run("verify render success", func(t *testing.T) { + mocks := setup(t) + dp := deploymentProcessor{mocks.model, mocks.dbProvider, nil, nil} + testResource := getTestResource() testRendererOutput := getTestRendererOutput() resourceID := getTestResourceID(testResource.ID) - depId1, _ := resources.ParseResource("/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Core/httpRoutes/A") - depId2, _ := resources.ParseResource("/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Datastores/mongoDatabases/test-mongo") - requiredResources := []resources.ID{depId1, depId2} + depId1, _ := resources.ParseResource("/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Datastores/mongoDatabases/test-mongo") + requiredResources := []resources.ID{depId1} mocks.renderer.EXPECT().Render(gomock.Any(), gomock.Any(), gomock.Any()).Times(1).Return(testRendererOutput, nil) mocks.renderer.EXPECT().GetDependencyIDs(gomock.Any(), gomock.Any()).Times(1).Return(requiredResources, nil, nil) - mocks.dbProvider.EXPECT().GetStorageClient(gomock.Any(), gomock.Any()).Times(5).Return(mocks.db, nil) + mocks.dbProvider.EXPECT().GetStorageClient(gomock.Any(), gomock.Any()).AnyTimes().Return(mocks.db, nil) cr := store.Object{ Metadata: store.Metadata{ @@ -350,26 +349,6 @@ func Test_Render(t *testing.T) { Data: env, } mocks.db.EXPECT().Get(gomock.Any(), gomock.Any()).Times(1).Return(&er, nil) - httprouteA := datamodel.HTTPRoute{ - BaseResource: v1.BaseResource{ - TrackedResource: v1.TrackedResource{ - ID: "/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Core/httpRoutes/A", - }, - }, - Properties: &datamodel.HTTPRouteProperties{ - BasicResourceProperties: rpv1.BasicResourceProperties{ - Application: "/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Core/applications/test-application", - }, - }, - } - nr := store.Object{ - Metadata: store.Metadata{ - ID: httprouteA.ID, - }, - Data: httprouteA, - } - - mocks.db.EXPECT().Get(gomock.Any(), gomock.Any()).Times(1).Return(&nr, nil) mongoResource := dsrp_dm.MongoDatabase{ BaseResource: v1.BaseResource{ @@ -398,16 +377,16 @@ func Test_Render(t *testing.T) { }) t.Run("verify render success lowercase resourcetype", func(t *testing.T) { + mocks := setup(t) + dp := deploymentProcessor{mocks.model, mocks.dbProvider, nil, nil} + testResource := getLowerCaseTestResource() testRendererOutput := getTestRendererOutput() resourceID := getTestResourceID(testResource.ID) - depId1, _ := resources.ParseResource("/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Core/httpRoutes/A") - requiredResources := []resources.ID{depId1} - mocks.renderer.EXPECT().Render(gomock.Any(), gomock.Any(), gomock.Any()).Times(1).Return(testRendererOutput, nil) - mocks.renderer.EXPECT().GetDependencyIDs(gomock.Any(), gomock.Any()).Times(1).Return(requiredResources, nil, nil) - mocks.dbProvider.EXPECT().GetStorageClient(gomock.Any(), gomock.Any()).Times(4).Return(mocks.db, nil) + mocks.renderer.EXPECT().GetDependencyIDs(gomock.Any(), gomock.Any()).Times(1).Return([]resources.ID{}, nil, nil) + mocks.dbProvider.EXPECT().GetStorageClient(gomock.Any(), gomock.Any()).AnyTimes().Return(mocks.db, nil) cr := store.Object{ Metadata: store.Metadata{ @@ -442,25 +421,6 @@ func Test_Render(t *testing.T) { Data: env, } mocks.db.EXPECT().Get(gomock.Any(), gomock.Any()).Times(1).Return(&er, nil) - httprouteA := datamodel.HTTPRoute{ - BaseResource: v1.BaseResource{ - TrackedResource: v1.TrackedResource{ - ID: "/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Core/httpRoutes/A", - }, - }, - Properties: &datamodel.HTTPRouteProperties{ - BasicResourceProperties: rpv1.BasicResourceProperties{ - Application: "/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Core/applications/test-application", - }, - }, - } - nr := store.Object{ - Metadata: store.Metadata{ - ID: httprouteA.ID, - }, - Data: httprouteA, - } - mocks.db.EXPECT().Get(gomock.Any(), gomock.Any()).Times(1).Return(&nr, nil) rendererOutput, err := dp.Render(ctx, resourceID, &testResource) require.NoError(t, err) @@ -468,16 +428,16 @@ func Test_Render(t *testing.T) { }) t.Run("verify render success uppercase resourcetype", func(t *testing.T) { + mocks := setup(t) + dp := deploymentProcessor{mocks.model, mocks.dbProvider, nil, nil} + testResource := getUpperCaseTestResource() testRendererOutput := getTestRendererOutput() resourceID := getTestResourceID(testResource.ID) - depId1, _ := resources.ParseResource("/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Core/httpRoutes/A") - requiredResources := []resources.ID{depId1} - mocks.renderer.EXPECT().Render(gomock.Any(), gomock.Any(), gomock.Any()).Times(1).Return(testRendererOutput, nil) - mocks.renderer.EXPECT().GetDependencyIDs(gomock.Any(), gomock.Any()).Times(1).Return(requiredResources, nil, nil) - mocks.dbProvider.EXPECT().GetStorageClient(gomock.Any(), gomock.Any()).Times(4).Return(mocks.db, nil) + mocks.renderer.EXPECT().GetDependencyIDs(gomock.Any(), gomock.Any()).Times(1).Return([]resources.ID{}, nil, nil) + mocks.dbProvider.EXPECT().GetStorageClient(gomock.Any(), gomock.Any()).AnyTimes().Return(mocks.db, nil) cr := store.Object{ Metadata: store.Metadata{ @@ -512,25 +472,6 @@ func Test_Render(t *testing.T) { Data: env, } mocks.db.EXPECT().Get(gomock.Any(), gomock.Any()).Times(1).Return(&er, nil) - httprouteA := datamodel.HTTPRoute{ - BaseResource: v1.BaseResource{ - TrackedResource: v1.TrackedResource{ - ID: "/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Core/httpRoutes/A", - }, - }, - Properties: &datamodel.HTTPRouteProperties{ - BasicResourceProperties: rpv1.BasicResourceProperties{ - Application: "/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Core/applications/test-application", - }, - }, - } - nr := store.Object{ - Metadata: store.Metadata{ - ID: httprouteA.ID, - }, - Data: httprouteA, - } - mocks.db.EXPECT().Get(gomock.Any(), gomock.Any()).Times(1).Return(&nr, nil) rendererOutput, err := dp.Render(ctx, resourceID, &testResource) require.NoError(t, err) @@ -538,13 +479,14 @@ func Test_Render(t *testing.T) { }) t.Run("verify render error", func(t *testing.T) { + mocks := setup(t) + dp := deploymentProcessor{mocks.model, mocks.dbProvider, nil, nil} + testResource := getTestResource() resourceID := getTestResourceID(testResource.ID) - depId1, _ := resources.ParseResource("/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Core/httpRoutes/A") - requiredResources := []resources.ID{depId1} - mocks.renderer.EXPECT().GetDependencyIDs(gomock.Any(), gomock.Any()).Times(1).Return(requiredResources, nil, nil) - mocks.dbProvider.EXPECT().GetStorageClient(gomock.Any(), gomock.Any()).Times(4).Return(mocks.db, nil) + mocks.renderer.EXPECT().GetDependencyIDs(gomock.Any(), gomock.Any()).Times(1).Return([]resources.ID{}, nil, nil) + mocks.dbProvider.EXPECT().GetStorageClient(gomock.Any(), gomock.Any()).AnyTimes().Return(mocks.db, nil) mocks.renderer.EXPECT().Render(gomock.Any(), gomock.Any(), gomock.Any()).Times(1).Return(renderers.RendererOutput{}, errors.New("failed to render the resource")) cr := store.Object{ @@ -580,31 +522,15 @@ func Test_Render(t *testing.T) { Data: env, } mocks.db.EXPECT().Get(gomock.Any(), gomock.Any()).Times(1).Return(&er, nil) - httprouteA := datamodel.HTTPRoute{ - BaseResource: v1.BaseResource{ - TrackedResource: v1.TrackedResource{ - ID: "/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Core/httpRoutes/A", - }, - }, - Properties: &datamodel.HTTPRouteProperties{ - BasicResourceProperties: rpv1.BasicResourceProperties{ - Application: "/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Core/applications/test-application", - }, - }, - } - nr := store.Object{ - Metadata: store.Metadata{ - ID: httprouteA.ID, - }, - Data: httprouteA, - } - mocks.db.EXPECT().Get(gomock.Any(), gomock.Any()).Times(1).Return(&nr, nil) _, err := dp.Render(ctx, resourceID, &testResource) require.Error(t, err, "failed to render the resource") }) t.Run("Failure to get storage client", func(t *testing.T) { + mocks := setup(t) + dp := deploymentProcessor{mocks.model, mocks.dbProvider, nil, nil} + testResource := getTestResource() resourceID := getTestResourceID(testResource.ID) @@ -616,6 +542,9 @@ func Test_Render(t *testing.T) { }) t.Run("Resource not found in data store", func(t *testing.T) { + mocks := setup(t) + dp := deploymentProcessor{mocks.model, mocks.dbProvider, nil, nil} + testResource := getTestResource() resourceID := getTestResourceID(testResource.ID) @@ -630,6 +559,9 @@ func Test_Render(t *testing.T) { }) t.Run("Data store access error", func(t *testing.T) { + mocks := setup(t) + dp := deploymentProcessor{mocks.model, mocks.dbProvider, nil, nil} + testResource := getTestResource() resourceID := getTestResourceID(testResource.ID) @@ -643,6 +575,9 @@ func Test_Render(t *testing.T) { }) t.Run("Invalid resource type", func(t *testing.T) { + mocks := setup(t) + dp := deploymentProcessor{mocks.model, mocks.dbProvider, nil, nil} + testInvalidResourceID := "/subscriptions/test-sub/resourceGroups/test-group/providers/Applications.foo/foo/foo" testResource := getTestResource() resourceID := getTestResourceID(testInvalidResourceID) @@ -652,6 +587,9 @@ func Test_Render(t *testing.T) { }) t.Run("Invalid application id", func(t *testing.T) { + mocks := setup(t) + dp := deploymentProcessor{mocks.model, mocks.dbProvider, nil, nil} + testResource := getTestResource() resourceID := getTestResourceID(testResource.ID) testResource.Properties.Application = "invalid-app-id" @@ -673,6 +611,9 @@ func Test_Render(t *testing.T) { }) t.Run("Missing application id", func(t *testing.T) { + mocks := setup(t) + dp := deploymentProcessor{mocks.model, mocks.dbProvider, nil, nil} + testResource := getTestResource() resourceID := getTestResourceID(testResource.ID) testResource.Properties.Application = "" @@ -693,6 +634,9 @@ func Test_Render(t *testing.T) { }) t.Run("Invalid application resource type", func(t *testing.T) { + mocks := setup(t) + dp := deploymentProcessor{mocks.model, mocks.dbProvider, nil, nil} + testResource := getTestResource() resourceID := getTestResourceID(testResource.ID) testResource.Properties.Application = "/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Core/app/test-application" @@ -714,17 +658,18 @@ func Test_Render(t *testing.T) { }) t.Run("Missing output resource provider", func(t *testing.T) { + mocks := setup(t) + dp := deploymentProcessor{mocks.model, mocks.dbProvider, nil, nil} + testResource := getTestResource() testRendererOutput := getTestRendererOutput() resourceID := getTestResourceID(testResource.ID) testRendererOutput.Resources[0].CreateResource.ResourceType.Provider = "" - depId1, _ := resources.ParseResource("/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Core/httpRoutes/A") - requiredResources := []resources.ID{depId1} mocks.renderer.EXPECT().Render(gomock.Any(), gomock.Any(), gomock.Any()).Times(1).Return(testRendererOutput, nil) - mocks.renderer.EXPECT().GetDependencyIDs(gomock.Any(), gomock.Any()).Times(1).Return(requiredResources, nil, nil) - mocks.dbProvider.EXPECT().GetStorageClient(gomock.Any(), gomock.Any()).Times(4).Return(mocks.db, nil) + mocks.renderer.EXPECT().GetDependencyIDs(gomock.Any(), gomock.Any()).Times(1).Return([]resources.ID{}, nil, nil) + mocks.dbProvider.EXPECT().GetStorageClient(gomock.Any(), gomock.Any()).AnyTimes().Return(mocks.db, nil) cr := store.Object{ Metadata: store.Metadata{ @@ -759,41 +704,23 @@ func Test_Render(t *testing.T) { Data: env, } mocks.db.EXPECT().Get(gomock.Any(), gomock.Any()).Times(1).Return(&er, nil) - httprouteA := datamodel.HTTPRoute{ - BaseResource: v1.BaseResource{ - TrackedResource: v1.TrackedResource{ - ID: "/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Core/httpRoutes/A", - }, - }, - Properties: &datamodel.HTTPRouteProperties{ - BasicResourceProperties: rpv1.BasicResourceProperties{ - Application: "/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Core/applications/test-application", - }, - }, - } - nr := store.Object{ - Metadata: store.Metadata{ - ID: httprouteA.ID, - }, - Data: httprouteA, - } - mocks.db.EXPECT().Get(gomock.Any(), gomock.Any()).Times(1).Return(&nr, nil) _, err := dp.Render(ctx, resourceID, &testResource) require.Error(t, err, "output resource \"Deployment\" does not have a provider specified") }) t.Run("Unsupported output resource provider", func(t *testing.T) { + mocks := setup(t) + dp := deploymentProcessor{mocks.model, mocks.dbProvider, nil, nil} + testResource := getTestResource() testRendererOutput := getTestRendererOutput() resourceID := getTestResourceID(testResource.ID) testRendererOutput.Resources[0].CreateResource.ResourceType.Provider = "unknown" - depId1, _ := resources.ParseResource("/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Core/httpRoutes/A") - requiredResources := []resources.ID{depId1} - mocks.renderer.EXPECT().GetDependencyIDs(gomock.Any(), gomock.Any()).Times(1).Return(requiredResources, nil, nil) - mocks.dbProvider.EXPECT().GetStorageClient(gomock.Any(), gomock.Any()).Times(4).Return(mocks.db, nil) + mocks.renderer.EXPECT().GetDependencyIDs(gomock.Any(), gomock.Any()).Times(1).Return([]resources.ID{}, nil, nil) + mocks.dbProvider.EXPECT().GetStorageClient(gomock.Any(), gomock.Any()).AnyTimes().Return(mocks.db, nil) cr := store.Object{ Metadata: store.Metadata{ @@ -828,25 +755,7 @@ func Test_Render(t *testing.T) { Data: env, } mocks.db.EXPECT().Get(gomock.Any(), gomock.Any()).Times(1).Return(&er, nil) - httprouteA := datamodel.HTTPRoute{ - BaseResource: v1.BaseResource{ - TrackedResource: v1.TrackedResource{ - ID: "/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Core/httpRoutes/A", - }, - }, - Properties: &datamodel.HTTPRouteProperties{ - BasicResourceProperties: rpv1.BasicResourceProperties{ - Application: "/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Core/applications/test-application", - }, - }, - } - nr := store.Object{ - Metadata: store.Metadata{ - ID: httprouteA.ID, - }, - Data: httprouteA, - } - mocks.db.EXPECT().Get(gomock.Any(), gomock.Any()).Times(1).Return(&nr, nil) + mocks.renderer.EXPECT().Render(gomock.Any(), gomock.Any(), gomock.Any()).Times(1).Return(testRendererOutput, nil) _, err := dp.Render(ctx, resourceID, &testResource) diff --git a/pkg/corerp/backend/deployment/testdata/containerresourcedatamodel.json b/pkg/corerp/backend/deployment/testdata/containerresourcedatamodel.json index c54bc0051b..f5e830d353 100644 --- a/pkg/corerp/backend/deployment/testdata/containerresourcedatamodel.json +++ b/pkg/corerp/backend/deployment/testdata/containerresourcedatamodel.json @@ -49,8 +49,7 @@ }, "ports": { "web": { - "containerPort": 5000, - "provides": "/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Core/applications/test-application/HttpRoute/B" + "containerPort": 5000 } } } diff --git a/pkg/corerp/backend/deployment/testdata/containerresourcedatamodellowercase.json b/pkg/corerp/backend/deployment/testdata/containerresourcedatamodellowercase.json index 16dc3ecb03..613bb441f9 100644 --- a/pkg/corerp/backend/deployment/testdata/containerresourcedatamodellowercase.json +++ b/pkg/corerp/backend/deployment/testdata/containerresourcedatamodellowercase.json @@ -49,8 +49,7 @@ }, "ports": { "web": { - "containerPort": 5000, - "provides": "/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Core/applications/test-application/HttpRoute/B" + "containerPort": 5000 } } } diff --git a/pkg/corerp/backend/deployment/testdata/containerresourcedatamodeluppercase.json b/pkg/corerp/backend/deployment/testdata/containerresourcedatamodeluppercase.json index 503f55d500..56d11ef962 100644 --- a/pkg/corerp/backend/deployment/testdata/containerresourcedatamodeluppercase.json +++ b/pkg/corerp/backend/deployment/testdata/containerresourcedatamodeluppercase.json @@ -49,8 +49,7 @@ }, "ports": { "web": { - "containerPort": 5000, - "provides": "/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Core/applications/test-application/HttpRoute/B" + "containerPort": 5000 } } } diff --git a/pkg/corerp/datamodel/container.go b/pkg/corerp/datamodel/container.go index a82850d705..c1b6f0eeb9 100644 --- a/pkg/corerp/datamodel/container.go +++ b/pkg/corerp/datamodel/container.go @@ -134,7 +134,6 @@ type ContainerPort struct { Port int32 `json:"port,omitempty"` Scheme string `json:"scheme,omitempty"` Protocol Protocol `json:"protocol,omitempty"` - Provides string `json:"provides,omitempty"` } // Protocol - Protocol in use by the port diff --git a/pkg/corerp/datamodel/converter/httproute_converter.go b/pkg/corerp/datamodel/converter/httproute_converter.go deleted file mode 100644 index 35917980e5..0000000000 --- a/pkg/corerp/datamodel/converter/httproute_converter.go +++ /dev/null @@ -1,54 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package converter - -import ( - "encoding/json" - - v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" - v20231001preview "github.com/radius-project/radius/pkg/corerp/api/v20231001preview" - "github.com/radius-project/radius/pkg/corerp/datamodel" -) - -// HTTPRouteDataModelToVersioned converts version agnostic HTTPRoute datamodel to versioned model. -func HTTPRouteDataModelToVersioned(model *datamodel.HTTPRoute, version string) (v1.VersionedModelInterface, error) { - switch version { - case v20231001preview.Version: - versioned := &v20231001preview.HTTPRouteResource{} - err := versioned.ConvertFrom(model) - return versioned, err - - default: - return nil, v1.ErrUnsupportedAPIVersion - } -} - -// HTTPRouteDataModelFromVersioned converts versioned HTTPRoute model to datamodel. -func HTTPRouteDataModelFromVersioned(content []byte, version string) (*datamodel.HTTPRoute, error) { - switch version { - case v20231001preview.Version: - am := &v20231001preview.HTTPRouteResource{} - if err := json.Unmarshal(content, am); err != nil { - return nil, err - } - dm, err := am.ConvertTo() - return dm.(*datamodel.HTTPRoute), err - - default: - return nil, v1.ErrUnsupportedAPIVersion - } -} diff --git a/pkg/corerp/datamodel/converter/httproute_converter_test.go b/pkg/corerp/datamodel/converter/httproute_converter_test.go deleted file mode 100644 index c91cb8a9aa..0000000000 --- a/pkg/corerp/datamodel/converter/httproute_converter_test.go +++ /dev/null @@ -1,99 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package converter - -import ( - "encoding/json" - "testing" - - v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" - "github.com/radius-project/radius/pkg/corerp/api/v20231001preview" - "github.com/radius-project/radius/pkg/corerp/datamodel" - "github.com/stretchr/testify/require" -) - -// NOTE: this test is to validate the type conversion between versioned model and data model. -// Converted content must be tested in ConvertFrom and ConvertTo tests in api models under /pkg/api/[api-version]. - -func TestHTTPRouteDataModelToVersioned(t *testing.T) { - testset := []struct { - dataModelFile string - apiVersion string - apiModelType any - err error - }{ - { - "../../api/v20231001preview/testdata/httprouteresourcedatamodel.json", - "2023-10-01-preview", - &v20231001preview.HTTPRouteResource{}, - nil, - }, - { - "", - "unsupported", - nil, - v1.ErrUnsupportedAPIVersion, - }, - } - - for _, tc := range testset { - t.Run(tc.apiVersion, func(t *testing.T) { - c := loadTestData(tc.dataModelFile) - dm := &datamodel.HTTPRoute{} - _ = json.Unmarshal(c, dm) - am, err := HTTPRouteDataModelToVersioned(dm, tc.apiVersion) - if tc.err != nil { - require.ErrorAs(t, tc.err, &err) - } else { - require.NoError(t, err) - require.IsType(t, tc.apiModelType, am) - } - }) - } -} - -func TestHTTPRouteDataModelFromVersioned(t *testing.T) { - testset := []struct { - versionedModelFile string - apiVersion string - err error - }{ - { - "../../api/v20231001preview/testdata/httprouteresource.json", - "2023-10-01-preview", - nil, - }, - { - "", - "unsupported", - v1.ErrUnsupportedAPIVersion, - }, - } - - for _, tc := range testset { - t.Run(tc.apiVersion, func(t *testing.T) { - c := loadTestData(tc.versionedModelFile) - dm, err := HTTPRouteDataModelFromVersioned(c, tc.apiVersion) - if tc.err != nil { - require.ErrorAs(t, tc.err, &err) - } else { - require.NoError(t, err) - require.IsType(t, tc.apiVersion, dm.InternalMetadata.UpdatedAPIVersion) - } - }) - } -} diff --git a/pkg/corerp/datamodel/httproute.go b/pkg/corerp/datamodel/httproute.go deleted file mode 100644 index 7cfa894b37..0000000000 --- a/pkg/corerp/datamodel/httproute.go +++ /dev/null @@ -1,83 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package datamodel - -import ( - v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" - rpv1 "github.com/radius-project/radius/pkg/rp/v1" -) - -const HTTPRouteResourceType = "Applications.Core/httpRoutes" - -// HTTPRoute represents HTTPRoute resource. -type HTTPRoute struct { - v1.BaseResource - - // TODO: remove this from CoreRP - PortableResourceMetadata - // Properties is the properties of the resource. - Properties *HTTPRouteProperties `json:"properties"` -} - -// ResourceTypeName returns the type of the resource. -func (h *HTTPRoute) ResourceTypeName() string { - return HTTPRouteResourceType -} - -// ApplyDeploymentOutput sets the Properties, ComputedValues, and SecretValues fields of the HTTPRoute struct -// based on the DeploymentOutput parameter and returns nil. -func (h *HTTPRoute) ApplyDeploymentOutput(do rpv1.DeploymentOutput) error { - if h.Properties != nil { - h.Properties.Status.OutputResources = do.DeployedOutputResources - } - - h.ComputedValues = do.ComputedValues - h.SecretValues = do.SecretValues - - if port, ok := do.ComputedValues["port"].(int32); ok { - h.Properties.Port = port - } - if hostname, ok := do.ComputedValues["hostname"].(string); ok { - h.Properties.Hostname = hostname - } - if scheme, ok := do.ComputedValues["scheme"].(string); ok { - h.Properties.Scheme = scheme - } - if url, ok := do.ComputedValues["url"].(string); ok { - h.Properties.URL = url - } - return nil -} - -// OutputResources returns the OutputResources from the Properties. -func (h *HTTPRoute) OutputResources() []rpv1.OutputResource { - return h.Properties.Status.OutputResources -} - -// ResourceMetadata returns the BasicResourceProperties of the HTTPRoute instance. -func (h *HTTPRoute) ResourceMetadata() *rpv1.BasicResourceProperties { - return &h.Properties.BasicResourceProperties -} - -// HTTPRouteProperties represents the properties of HTTPRoute. -type HTTPRouteProperties struct { - rpv1.BasicResourceProperties - Hostname string `json:"hostname,omitempty"` - Port int32 `json:"port,omitempty"` - Scheme string `json:"scheme,omitempty"` - URL string `json:"url,omitempty"` -} diff --git a/pkg/corerp/frontend/controller/applications/graph_util.go b/pkg/corerp/frontend/controller/applications/graph_util.go index 3f9e5c50b1..4f5b08ef49 100644 --- a/pkg/corerp/frontend/controller/applications/graph_util.go +++ b/pkg/corerp/frontend/controller/applications/graph_util.go @@ -256,8 +256,6 @@ func computeGraph(applicationResources []generated.GenericResource, environmentR connections := resolveConnections(resource, connectionsPath, connectionsResolver(resources)) // Resolve Outbound connections based on 'routes'. connections = append(connections, resolveConnections(resource, routesPath, routesPathResolver(resources))...) - // Resolve Inbound connections based on 'provides'. - connections = append(connections, resolveConnections(resource, portsPath, providersResolver)...) sort.Slice(connections, func(i, j int) bool { return to.String(connections[i].ID) < to.String(connections[j].ID) @@ -343,8 +341,7 @@ func computeGraph(applicationResources []generated.GenericResource, environmentR } connectionsByDestination[otherID] = append(connectionsByDestination[otherID], connectionInbound) } else { - // We dont have to note anything in connectionsOutbound because 'provides' allows us to determine just the - // missing inbound connections to HTTPRoutes. All outbound connections are already captured by 'connections'. + // All outbound connections are already captured by 'connections'. connectionsBySource[otherID] = append(connectionsBySource[otherID], *connection) } } @@ -591,29 +588,6 @@ func routesPathResolver(resources []generated.GenericResource) resolver { } } -// providersResolver is specifically to support HTTPRoute. -// Any Radius resource type that exposes a port uses the following property path to return them. -// The port may have a 'provides' attribute that specifies a httproute. -// This route should be parsed to find the connections between containers. -// For example, if container A provides a route and container B consumes it, -// then we have port.provides in container A and container.connection in container B. -// This gives us the connection: container A --> route R --> container B. -// Without parsing the 'provides' attribute, we would miss the connection between container A and route R. -func providersResolver(item any) (string, corerpv20231001preview.Direction, error) { - data := &corerpv20231001preview.ContainerPortProperties{} - err := toStronglyTypedData(item, data) - if err != nil { - return "", "", err - } - - id := to.String(data.Provides) - if id == "" { - return "", "", nil - } - - return id, corerpv20231001preview.DirectionInbound, nil -} - // toStronglyTypedData uses JSON marshalling and unmarshalling to convert a weakly-typed // representation to a strongly-typed one. func toStronglyTypedData(data any, result any) error { diff --git a/pkg/corerp/frontend/controller/applications/graph_util_test.go b/pkg/corerp/frontend/controller/applications/graph_util_test.go index 4286e2eaa5..d226f85079 100644 --- a/pkg/corerp/frontend/controller/applications/graph_util_test.go +++ b/pkg/corerp/frontend/controller/applications/graph_util_test.go @@ -125,18 +125,6 @@ func Test_computeGraph(t *testing.T) { envResourceDataFile string expectedDataFile string }{ - { - name: "using httproute without inbound resource", - appResourceDataFile: "graph-app-httproute-in.json", - envResourceDataFile: "", - expectedDataFile: "graph-app-httproute-out.json", - }, - { - name: "using httproute with inbound resource", - appResourceDataFile: "graph-app-httproute2-in.json", - envResourceDataFile: "", - expectedDataFile: "graph-app-httproute2-out.json", - }, { name: "direct route", appResourceDataFile: "graph-app-directroute-in.json", diff --git a/pkg/corerp/frontend/controller/applications/testdata/graph-app-httproute-in.json b/pkg/corerp/frontend/controller/applications/testdata/graph-app-httproute-in.json deleted file mode 100644 index 917de30ace..0000000000 --- a/pkg/corerp/frontend/controller/applications/testdata/graph-app-httproute-in.json +++ /dev/null @@ -1,55 +0,0 @@ -[ - { - "id": "/planes/radius/local/resourcegroups/default/providers/Applications.Core/httpRoutes/sql-rte", - "name": "sql-rte", - "properties": { - "application": "/planes/radius/local/resourcegroups/default/providers/Applications.Core/Applications/myapp", - "provisioningState": "Succeeded" - }, - "type": "Applications.Core/httpRoutes" - }, - { - "id": "/planes/radius/local/resourcegroups/default/providers/Applications.Core/containers/sql-app-ctnr", - "name": "sql-app-ctnr", - "properties": { - "application": "/planes/radius/local/resourcegroups/default/providers/Applications.Core/Applications/myapp", - "connections": { - "sql": { - "source": "/planes/radius/local/resourcegroups/default/providers/Applications.Datastores/sqlDatabases/sql-db" - } - }, - "provisioningState": "Succeeded", - "status": { - "outputResources": { - "id": "/some/thing/else", - "localId": "something" - } - } - }, - "type": "Applications.Core/containers" - }, - { - "id": "/planes/radius/local/resourcegroups/default/providers/Applications.Core/containers/sql-ctnr", - "name": "sql-ctnr", - "properties": { - "application": "/planes/radius/local/resourcegroups/default/providers/Applications.Core/Applications/myapp", - "container": { - "ports": { - "web": { - "port": 8080, - "protocol": "TCP", - "provides": "/planes/radius/local/resourcegroups/default/providers/Applications.Core/httpRoutes/sql-rte" - } - } - }, - "provisioningState": "Succeeded", - "status": { - "outputResources": { - "id": "/some/thing/else", - "localId": "something" - } - } - }, - "type": "Applications.Core/containers" - } -] diff --git a/pkg/corerp/frontend/controller/applications/testdata/graph-app-httproute-out.json b/pkg/corerp/frontend/controller/applications/testdata/graph-app-httproute-out.json deleted file mode 100644 index fda2bc267c..0000000000 --- a/pkg/corerp/frontend/controller/applications/testdata/graph-app-httproute-out.json +++ /dev/null @@ -1,48 +0,0 @@ -[ - { - "connections": [ - { - "direction": "Inbound", - "id": "/planes/radius/local/resourcegroups/default/providers/Applications.Core/httpRoutes/sql-rte" - } - ], - "id": "/planes/radius/local/resourcegroups/default/providers/Applications.Core/containers/sql-ctnr", - "name": "sql-ctnr", - "outputResources": [], - "provisioningState": "Succeeded", - "type": "Applications.Core/containers" - }, - { - "connections": [ - { - "direction": "Inbound", - "id": "/planes/radius/local/resourcegroups/default/providers/Applications.Core/containers/sql-app-ctnr" - } - ], - "id": "/planes/radius/local/resourcegroups/default/providers/Applications.Datastores/sqlDatabases/sql-db", - "name": "sql-db", - "provisioningState": "Succeeded", - "type": "Applications.Datastores/sqlDatabases" - }, - { - "connections": [], - "id": "/planes/radius/local/resourcegroups/default/providers/Applications.Core/httpRoutes/sql-rte", - "name": "sql-rte", - "outputResources": [], - "provisioningState": "Succeeded", - "type": "Applications.Core/httpRoutes" - }, - { - "connections": [ - { - "direction": "Outbound", - "id": "/planes/radius/local/resourcegroups/default/providers/Applications.Datastores/sqlDatabases/sql-db" - } - ], - "id": "/planes/radius/local/resourcegroups/default/providers/Applications.Core/containers/sql-app-ctnr", - "name": "sql-app-ctnr", - "outputResources": [], - "provisioningState": "Succeeded", - "type": "Applications.Core/containers" - } -] \ No newline at end of file diff --git a/pkg/corerp/frontend/controller/applications/testdata/graph-app-httproute2-in.json b/pkg/corerp/frontend/controller/applications/testdata/graph-app-httproute2-in.json deleted file mode 100644 index aa98ab190b..0000000000 --- a/pkg/corerp/frontend/controller/applications/testdata/graph-app-httproute2-in.json +++ /dev/null @@ -1,72 +0,0 @@ -[ - { - "id": "/planes/radius/local/resourcegroups/default/providers/Applications.Core/httpRoutes/http-back-rte-simple1", - "name": "http-back-rte-simple1", - "properties": { - "application": "/planes/radius/local/resourcegroups/default/providers/Applications.Core/Applications/myapp", - "provisioningState": "Succeeded" - }, - "type": "Applications.Core/httpRoutes" - }, - { - "id": "/planes/radius/local/resourcegroups/default/providers/Applications.Core/containers/http-front-ctnr-simple1", - "name": "http-front-ctnr-simple1", - "properties": { - "application": "/planes/radius/local/resourcegroups/default/providers/Applications.Core/Applications/myapp", - "containers": { - "image": "magpie:latest", - "ports": { - "web": { - "port": 8080 - } - }, - "readinessProbe": { - "kind": "httpGet", - "path": "/healthz", - "containerPort": 8080 - } - }, - "connections": { - "backend": { - "source": "/planes/radius/local/resourcegroups/default/providers/Applications.Core/httpRoutes/http-back-rte-simple1" - } - }, - "provisioningState": "Succeeded", - "status": { - "outputResources": { - "id": "/some/thing/else", - "localId": "something" - } - } - }, - "type": "Applications.Core/containers" - }, - { - "id": "/planes/radius/local/resourcegroups/default/providers/Applications.Core/containers/http-back-ctnr-simple1", - "name": "http-back-ctnr-simple1", - "properties": { - "application": "/planes/radius/local/resourcegroups/default/providers/Applications.Core/Applications/myapp", - "container": { - "ports": { - "web": { - "port": 8080, - "provides": "/planes/radius/local/resourcegroups/default/providers/Applications.Core/httpRoutes/http-back-rte-simple1" - } - }, - "readinessProbe": { - "kind": "httpGet", - "path": "/healthz", - "containerPort": 8080 - } - }, - "provisioningState": "Succeeded", - "status": { - "outputResources": { - "id": "/some/thing/else", - "localId": "something" - } - } - }, - "type": "Applications.Core/containers" - } -] diff --git a/pkg/corerp/frontend/controller/applications/testdata/graph-app-httproute2-out.json b/pkg/corerp/frontend/controller/applications/testdata/graph-app-httproute2-out.json deleted file mode 100644 index 930c2d9350..0000000000 --- a/pkg/corerp/frontend/controller/applications/testdata/graph-app-httproute2-out.json +++ /dev/null @@ -1,41 +0,0 @@ -[ - { - "connections": [ - { - "direction": "Inbound", - "id": "/planes/radius/local/resourcegroups/default/providers/Applications.Core/containers/http-front-ctnr-simple1" - } - ], - "id": "/planes/radius/local/resourcegroups/default/providers/Applications.Core/httpRoutes/http-back-rte-simple1", - "name": "http-back-rte-simple1", - "outputResources": [], - "provisioningState": "Succeeded", - "type": "Applications.Core/httpRoutes" - }, - { - "connections": [ - { - "direction": "Outbound", - "id": "/planes/radius/local/resourcegroups/default/providers/Applications.Core/httpRoutes/http-back-rte-simple1" - } - ], - "id": "/planes/radius/local/resourcegroups/default/providers/Applications.Core/containers/http-front-ctnr-simple1", - "name": "http-front-ctnr-simple1", - "outputResources": [], - "provisioningState": "Succeeded", - "type": "Applications.Core/containers" - }, - { - "connections": [ - { - "direction": "Inbound", - "id": "/planes/radius/local/resourcegroups/default/providers/Applications.Core/httpRoutes/http-back-rte-simple1" - } - ], - "id": "/planes/radius/local/resourcegroups/default/providers/Applications.Core/containers/http-back-ctnr-simple1", - "name": "http-back-ctnr-simple1", - "outputResources": [], - "provisioningState": "Succeeded", - "type": "Applications.Core/containers" - } -] \ No newline at end of file diff --git a/pkg/corerp/frontend/controller/applications/types.go b/pkg/corerp/frontend/controller/applications/types.go index 47d78d06c9..8a899aa690 100644 --- a/pkg/corerp/frontend/controller/applications/types.go +++ b/pkg/corerp/frontend/controller/applications/types.go @@ -20,7 +20,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" @@ -42,7 +41,6 @@ var ( dapr_ctrl.DaprPubSubBrokersResourceType, ext_ctrl.ResourceTypeName, gtwy_ctrl.ResourceTypeName, - hrt_ctrl.ResourceTypeName, cntr_ctrl.ResourceTypeName, sstr_ctrl.ResourceTypeName, } diff --git a/pkg/corerp/frontend/controller/httproutes/testdata/httproute20231001preview_datamodel.json b/pkg/corerp/frontend/controller/httproutes/testdata/httproute20231001preview_datamodel.json deleted file mode 100644 index ebf5a25c4d..0000000000 --- a/pkg/corerp/frontend/controller/httproutes/testdata/httproute20231001preview_datamodel.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.core/httproutes/hrt0", - "name": "hrt0", - "type": "applications.core/httproutes", - "location": "West US", - "systemData": { - "createdAt": "2022-03-22T18:54:52.6857175Z", - "createdBy": "fake@hotmail.com", - "createdByType": "User", - "lastModifiedAt": "2022-03-22T18:57:52.6857175Z", - "lastModifiedBy": "fake@hotmail.com", - "lastModifiedByType": "User" - }, - "provisioningState": "Succeeded", - "properties": { - "status": { - "outputResources": [ - { - "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" - } - ] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "hostname": "foo.example.com", - "port": 8080, - "scheme": "https", - "url": "https://foo.example.com" - }, - "tenantId": "00000000-0000-0000-0000-000000000000", - "subscriptionId": "00000000-0000-0000-0000-000000000000", - "resourceGroup": "radius-test-rg", - "createdApiVersion": "2023-10-01-preview", - "updatedApiVersion": "2023-10-01-preview" -} \ No newline at end of file diff --git a/pkg/corerp/frontend/controller/httproutes/testdata/httproute20231001preview_input.json b/pkg/corerp/frontend/controller/httproutes/testdata/httproute20231001preview_input.json deleted file mode 100644 index d4c386573b..0000000000 --- a/pkg/corerp/frontend/controller/httproutes/testdata/httproute20231001preview_input.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "location": "West US", - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "hostname": "foo.example.com", - "port": 8080, - "scheme": "https", - "url": "https://foo.example.com" - } -} \ No newline at end of file diff --git a/pkg/corerp/frontend/controller/httproutes/testdata/httproute20231001preview_input_appid.json b/pkg/corerp/frontend/controller/httproutes/testdata/httproute20231001preview_input_appid.json deleted file mode 100644 index a16f8c7246..0000000000 --- a/pkg/corerp/frontend/controller/httproutes/testdata/httproute20231001preview_input_appid.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "location": "West US", - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/invalid", - "hostname": "foo.example.com", - "port": 8080, - "scheme": "https", - "url": "https://foo.example.com" - } -} \ No newline at end of file diff --git a/pkg/corerp/frontend/controller/httproutes/testdata/httproute20231001preview_output.json b/pkg/corerp/frontend/controller/httproutes/testdata/httproute20231001preview_output.json deleted file mode 100644 index 3c6c0f4d96..0000000000 --- a/pkg/corerp/frontend/controller/httproutes/testdata/httproute20231001preview_output.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.core/httproutes/hrt0", - "location": "West US", - "name": "hrt0", - "properties": { - "status": { - "outputResources": [ - { - "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" - } - ] - }, - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "hostname": "foo.example.com", - "port": 8080, - "scheme": "https", - "url": "https://foo.example.com" - }, - "systemData": { - "createdAt": "2022-03-22T18:54:52.6857175Z", - "createdBy": "fake@hotmail.com", - "createdByType": "User", - "lastModifiedAt": "2022-03-22T18:57:52.6857175Z", - "lastModifiedBy": "fake@hotmail.com", - "lastModifiedByType": "User" - }, - "tags": {}, - "type": "applications.core/httproutes" -} \ No newline at end of file diff --git a/pkg/corerp/frontend/controller/httproutes/types.go b/pkg/corerp/frontend/controller/httproutes/types.go deleted file mode 100644 index b00b679356..0000000000 --- a/pkg/corerp/frontend/controller/httproutes/types.go +++ /dev/null @@ -1,21 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package httproutes - -const ( - ResourceTypeName = "Applications.Core/httproutes" -) diff --git a/pkg/corerp/frontend/controller/secretstores/kubernetes_test.go b/pkg/corerp/frontend/controller/secretstores/kubernetes_test.go index d3e6b5b7fe..8ba370b541 100644 --- a/pkg/corerp/frontend/controller/secretstores/kubernetes_test.go +++ b/pkg/corerp/frontend/controller/secretstores/kubernetes_test.go @@ -119,8 +119,8 @@ func TestFromResourceID(t *testing.T) { err error }{ { - resourceID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.core/httproutes/hrt0", - err: errors.New("'/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.core/httproutes/hrt0' is the invalid resource id"), + resourceID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.core/containers/c", + err: errors.New("'/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.core/containers/c' is the invalid resource id"), }, { resourceID: "name", diff --git a/pkg/corerp/model/application_model.go b/pkg/corerp/model/application_model.go index bd86257eaf..6708efd6ec 100644 --- a/pkg/corerp/model/application_model.go +++ b/pkg/corerp/model/application_model.go @@ -26,7 +26,6 @@ import ( azcontainer "github.com/radius-project/radius/pkg/corerp/renderers/container/azure" "github.com/radius-project/radius/pkg/corerp/renderers/daprextension" "github.com/radius-project/radius/pkg/corerp/renderers/gateway" - "github.com/radius-project/radius/pkg/corerp/renderers/httproute" "github.com/radius-project/radius/pkg/corerp/renderers/kubernetesmetadata" "github.com/radius-project/radius/pkg/corerp/renderers/manualscale" "github.com/radius-project/radius/pkg/corerp/renderers/volume" @@ -97,10 +96,6 @@ func NewApplicationModel(arm *armauth.ArmConfig, k8sClient client.Client, k8sCli }, }, }, - { - ResourceType: httproute.ResourceType, - Renderer: &httproute.Renderer{}, - }, { ResourceType: gateway.ResourceType, Renderer: &gateway.Renderer{}, diff --git a/pkg/corerp/renderers/container/render.go b/pkg/corerp/renderers/container/render.go index 0bfb415701..58670f15a3 100644 --- a/pkg/corerp/renderers/container/render.go +++ b/pkg/corerp/renderers/container/render.go @@ -28,7 +28,6 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/util/intstr" v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" @@ -87,8 +86,6 @@ func (r Renderer) GetDependencyIDs(ctx context.Context, dm v1.DataModelInterface // in the future... eg: volumes // // Anywhere we accept a resource ID in the model should have its value returned from here - - // ensure that users cannot use DNS-SD and httproutes simultaneously. for _, connection := range properties.Connections { if isURL(connection.Source) { continue @@ -112,25 +109,6 @@ func (r Renderer) GetDependencyIDs(ctx context.Context, dm v1.DataModelInterface } } - for _, port := range properties.Container.Ports { - provides := port.Provides - - // if provides is empty, skip this port. A service for this port will be generated later on. - if provides == "" { - continue - } - - resourceID, err := resources.ParseResource(provides) - if err != nil { - return nil, nil, v1.NewClientErrInvalidRequest(err.Error()) - } - - if resources_radius.IsRadiusResource(resourceID) { - radiusResourceIDs = append(radiusResourceIDs, resourceID) - continue - } - } - for _, volume := range properties.Container.Volumes { switch volume.Kind { case datamodel.Persistent: @@ -190,7 +168,7 @@ func (r Renderer) Render(ctx context.Context, dm v1.DataModelInterface, options continue } - // If source is not a URL, it must be either resource ID, invalid string, or empty (example: containerhttproute.id). + // If source is not a URL, it must be either resource ID, invalid string, or empty (example: myRedis.id). _, err := resources.ParseResource(connection.Source) if err != nil { return renderers.RendererOutput{}, v1.NewClientErrInvalidRequest(fmt.Sprintf("invalid source: %s. Must be either a URL or a valid resourceID", connection.Source)) @@ -209,10 +187,8 @@ func (r Renderer) Render(ctx context.Context, dm v1.DataModelInterface, options properties.Container.Ports[portName] = port } - // if the container has an exposed port, but no 'provides' field, it requires DNS service generation. - if port.Provides == "" { - needsServiceGeneration = true - } + // if the container has an exposed port, it requires DNS service generation. + needsServiceGeneration = true } dependencies := options.Dependencies @@ -324,11 +300,6 @@ func (r Renderer) makeDeployment( computedValues map[string]rpv1.ComputedValueReference, resource *datamodel.ContainerResource, roles []rpv1.OutputResource) ([]rpv1.OutputResource, map[string][]byte, error) { - // Keep track of the set of routes, we will need these to generate labels later - routes := []struct { - Name string - Type string - }{} // If the container requires azure role, it needs to configure workload identity (aka federated identity). identityRequired := len(roles) > 0 @@ -351,35 +322,10 @@ func (r Renderer) makeDeployment( ports := []corev1.ContainerPort{} for _, port := range properties.Container.Ports { - if provides := port.Provides; provides != "" { - resourceId, err := resources.ParseResource(provides) - if err != nil { - return []rpv1.OutputResource{}, nil, v1.NewClientErrInvalidRequest(err.Error()) - } - - routeName := kubernetes.NormalizeResourceName(resourceId.Name()) - routeType := resourceId.TypeSegments()[len(resourceId.TypeSegments())-1].Type - routeTypeParts := strings.Split(routeType, "/") - - routeTypeSuffix := kubernetes.NormalizeResourceName(routeTypeParts[len(routeTypeParts)-1]) - - routes = append(routes, struct { - Name string - Type string - }{Name: routeName, Type: routeTypeSuffix}) - - ports = append(ports, corev1.ContainerPort{ - // Name generation logic has to match the code in HttpRoute - Name: kubernetes.GetShortenedTargetPortName(routeTypeSuffix + routeName), - ContainerPort: port.ContainerPort, - Protocol: corev1.ProtocolTCP, - }) - } else { - ports = append(ports, corev1.ContainerPort{ - ContainerPort: port.ContainerPort, - Protocol: corev1.ProtocolTCP, - }) - } + ports = append(ports, corev1.ContainerPort{ + ContainerPort: port.ContainerPort, + Protocol: corev1.ProtocolTCP, + }) } container.Image = properties.Container.Image @@ -532,13 +478,6 @@ func (r Renderer) makeDeployment( } } - // In addition to the descriptive labels, we need to attach labels for each route - // so that the generated services can find these pods - for _, routeInfo := range routes { - routeLabels := kubernetes.MakeRouteSelectorLabels(applicationName, routeInfo.Type, routeInfo.Name) - podLabels = labels.Merge(routeLabels, podLabels) - } - serviceAccountBase := getServiceAccountBase(manifest, applicationName, resource, &options) // In order to enable per-container identity, it creates user-assigned managed identity, federated identity, and service account. if identityRequired { diff --git a/pkg/corerp/renderers/container/render_test.go b/pkg/corerp/renderers/container/render_test.go index 59099a324b..3c1743fa8f 100644 --- a/pkg/corerp/renderers/container/render_test.go +++ b/pkg/corerp/renderers/container/render_test.go @@ -146,10 +146,10 @@ func Test_GetDependencyIDs_Success(t *testing.T) { }, Connections: map[string]datamodel.ConnectionProperties{ "A": { - Source: makeRadiusResourceID(t, "Applications.Core/httpRoutes", "A").String(), + Source: makeRadiusResourceID(t, "Applications.Datastores/redisCaches", "A").String(), }, "B": { - Source: makeRadiusResourceID(t, "Applications.Core/httpRoutes", "B").String(), + Source: makeRadiusResourceID(t, "Applications.Datastores/redisCaches", "B").String(), IAM: datamodel.IAMProperties{ Kind: datamodel.KindHTTP, Roles: []string{"administrator"}, @@ -171,7 +171,6 @@ func Test_GetDependencyIDs_Success(t *testing.T) { Ports: map[string]datamodel.ContainerPort{ "web": { ContainerPort: 5000, - Provides: makeRadiusResourceID(t, "Applications.Core/httpRoutes", "C").String(), }, }, Volumes: map[string]datamodel.VolumeProperties{ @@ -194,13 +193,12 @@ func Test_GetDependencyIDs_Success(t *testing.T) { renderer := Renderer{} radiusResourceIDs, azureResourceIDs, err := renderer.GetDependencyIDs(ctx, resource) require.NoError(t, err) - require.Len(t, radiusResourceIDs, 3) + require.Len(t, radiusResourceIDs, 2) require.Len(t, azureResourceIDs, 1) expectedRadiusResourceIDs := []resources.ID{ - makeRadiusResourceID(t, "Applications.Core/httpRoutes", "A"), - makeRadiusResourceID(t, "Applications.Core/httpRoutes", "B"), - makeRadiusResourceID(t, "Applications.Core/httpRoutes", "C"), + makeRadiusResourceID(t, "Applications.Datastores/redisCaches", "A"), + makeRadiusResourceID(t, "Applications.Datastores/redisCaches", "B"), } require.ElementsMatch(t, expectedRadiusResourceIDs, radiusResourceIDs) @@ -477,62 +475,6 @@ func Test_Render_PortWithoutRoute(t *testing.T) { require.Len(t, output.Resources, 5) } -func Test_Render_PortConnectedToRoute(t *testing.T) { - properties := datamodel.ContainerProperties{ - BasicResourceProperties: rpv1.BasicResourceProperties{ - Application: applicationResourceID, - }, - Container: datamodel.Container{ - Image: "someimage:latest", - Ports: map[string]datamodel.ContainerPort{ - "web": { - ContainerPort: 5000, - Protocol: datamodel.ProtocolTCP, - Provides: makeRadiusResourceID(t, "Applications.Core/httpRoutes", "A").String(), - }, - }, - }, - } - resource := makeResource(properties) - dependencies := map[string]renderers.RendererDependency{} - - ctx := testcontext.New(t) - renderer := Renderer{} - output, err := renderer.Render(ctx, resource, renderers.RenderOptions{Dependencies: dependencies}) - require.NoError(t, err) - require.Empty(t, output.ComputedValues) - require.Empty(t, output.SecretValues) - - labels := kubernetes.MakeDescriptiveLabels(applicationName, resource.Name, resource.ResourceTypeName()) - podLabels := kubernetes.MakeDescriptiveLabels(applicationName, resource.Name, resource.ResourceTypeName()) - podLabels["radapp.io/route-httproutes-a"] = "true" - - t.Run("verify deployment", func(t *testing.T) { - deployment, _ := kubernetes.FindDeployment(output.Resources) - require.NotNil(t, deployment) - - require.Len(t, deployment.Spec.Template.Spec.Containers, 1) - container := deployment.Spec.Template.Spec.Containers[0] - - // Labels are somewhat specialized when a route is involved - require.Equal(t, labels, deployment.Labels) - require.Equal(t, podLabels, deployment.Spec.Template.Labels) - - require.Len(t, container.Ports, 1) - port := container.Ports[0] - - routeID := makeRadiusResourceID(t, "Applications.Core/httpRoutes", "A") - - expected := corev1.ContainerPort{ - Name: kubernetes.GetShortenedTargetPortName("httpRoutes" + routeID.Name()), - ContainerPort: 5000, - Protocol: corev1.ProtocolTCP, - } - require.Equal(t, expected, port) - }) - require.Len(t, output.Resources, 4) -} - func Test_Render_Connections(t *testing.T) { containerConnectionHostname := "containerB" containerConnectionScheme := "http" diff --git a/pkg/corerp/renderers/gateway/render.go b/pkg/corerp/renderers/gateway/render.go index 2fe79fa094..510f24aa36 100644 --- a/pkg/corerp/renderers/gateway/render.go +++ b/pkg/corerp/renderers/gateway/render.go @@ -40,7 +40,7 @@ import ( type Renderer struct { } -// GetDependencyIDs parses the gateway data model to get the resource IDs of the httpRoutes and the secretStore resource ID +// GetDependencyIDs parses the gateway data model to get the secretStore resource ID // from the certificateFrom property, and returns them as two slices of resource IDs. func (r Renderer) GetDependencyIDs(ctx context.Context, dm v1.DataModelInterface) (radiusResourceIDs []resources.ID, azureResourceIDs []resources.ID, err error) { gateway, ok := dm.(*datamodel.Gateway) @@ -49,21 +49,6 @@ func (r Renderer) GetDependencyIDs(ctx context.Context, dm v1.DataModelInterface } gtwyProperties := gateway.Properties - // Get all httpRoutes that are used by this gateway - for _, route := range gtwyProperties.Routes { - // Skip if destination is a URL. DNS-SD will resolve the route. - if isURL(route.Destination) { - continue - } - - resourceID, err := resources.ParseResource(route.Destination) - if err != nil { - return nil, nil, v1.NewClientErrInvalidRequest(err.Error()) - } - - radiusResourceIDs = append(radiusResourceIDs, resourceID) - } - // Get secretStore resource ID from certificateFrom property if gtwyProperties.TLS != nil && gtwyProperties.TLS.CertificateFrom != "" { resourceID, err := resources.ParseResource(gtwyProperties.TLS.CertificateFrom) @@ -116,11 +101,11 @@ func (r Renderer) Render(ctx context.Context, dm v1.DataModelInterface, options }, } - httpRouteObjects, err := MakeRoutesHTTPProxies(ctx, options, *gateway, &gateway.Properties, gatewayName, gatewayObject, applicationName) + httpProxyObjects, err := MakeRoutesHTTPProxies(ctx, options, *gateway, &gateway.Properties, gatewayName, gatewayObject, applicationName) if err != nil { return renderers.RendererOutput{}, err } - outputResources = append(outputResources, httpRouteObjects...) + outputResources = append(outputResources, httpProxyObjects...) return renderers.RendererOutput{ Resources: outputResources, @@ -323,7 +308,7 @@ func MakeRoutesHTTPProxies(ctx context.Context, options renderers.RenderOptions, } // Create unique localID for dependency graph - localID := fmt.Sprintf("%s-%s", rpv1.LocalIDHttpRoute, routeName) + localID := fmt.Sprintf("%s-%s", rpv1.LocalIDHttpProxy, routeName) routeResourceName := kubernetes.NormalizeResourceName(routeName) var pathRewritePolicy *contourv1.PathRewritePolicy @@ -401,23 +386,12 @@ func MakeRoutesHTTPProxies(ctx context.Context, options renderers.RenderOptions, } func getRouteName(route *datamodel.GatewayRoute) (string, error) { - // if isURL, then name is hostname (DNS-SD case) - if isURL(route.Destination) { - u, err := url.Parse(route.Destination) - if err != nil { - return "", v1.NewClientErrInvalidRequest(err.Error()) - } - - return u.Hostname(), nil - } - - // if not URL, then name is the resourceID (HTTProute case) - resourceID, err := resources.ParseResource(route.Destination) + u, err := url.Parse(route.Destination) if err != nil { return "", v1.NewClientErrInvalidRequest(err.Error()) } - return resourceID.Name(), nil + return u.Hostname(), nil } // getHostname returns the hostname of the public endpoint of the Gateway. diff --git a/pkg/corerp/renderers/gateway/render_test.go b/pkg/corerp/renderers/gateway/render_test.go index e2fa8d5312..b74476917b 100644 --- a/pkg/corerp/renderers/gateway/render_test.go +++ b/pkg/corerp/renderers/gateway/render_test.go @@ -26,7 +26,6 @@ import ( v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" "github.com/radius-project/radius/pkg/corerp/datamodel" "github.com/radius-project/radius/pkg/corerp/renderers" - "github.com/radius-project/radius/pkg/corerp/renderers/httproute" "github.com/radius-project/radius/pkg/kubernetes" rpv1 "github.com/radius-project/radius/pkg/rp/v1" "github.com/radius-project/radius/pkg/to" @@ -64,20 +63,19 @@ const ( overrideVal1 = "override.app.annval1" overrideVal2 = "override.app.lblval1" - managedbyKey = "app.kubernetes.io/managed-by" - managedbyVal = "radius-rp" - nameKey = "app.kubernetes.io/name" - nameRteVal = "test-route" - nameGtwyVal = "test-gateway" - partofKey = "app.kubernetes.io/part-of" - partofVal = "test-application" - appKey = "radapp.io/application" - appVal = "test-application" - resourceKey = "radapp.io/resource" - resourceRteVal = "test-route" - resourceGtwyVal = "test-gateway" - resourcetypeKey = "radapp.io/resource-type" - //resourcetypeRteVal = "applications.core-httproutes" + managedbyKey = "app.kubernetes.io/managed-by" + managedbyVal = "radius-rp" + nameKey = "app.kubernetes.io/name" + nameRteVal = "a" + nameGtwyVal = "test-gateway" + partofKey = "app.kubernetes.io/part-of" + partofVal = "test-application" + appKey = "radapp.io/application" + appVal = "test-application" + resourceKey = "radapp.io/resource" + resourceRteVal = "a" + resourceGtwyVal = "test-gateway" + resourcetypeKey = "radapp.io/resource-type" resourcetypeGtwyVal = "applications.core-gateways" ) @@ -92,15 +90,17 @@ type expectedMaps struct { } func Test_GetDependencyIDs_Success(t *testing.T) { - testRouteAResourceID := makeRouteResourceID("testroutea") - testRouteBResourceID := makeRouteResourceID("testrouteb") + secretStoreID := makeSecretStoreResourceID("testsecret") properties := datamodel.GatewayProperties{ + TLS: &datamodel.GatewayPropertiesTLS{ + CertificateFrom: secretStoreID, + }, Routes: []datamodel.GatewayRoute{ { - Destination: testRouteAResourceID, + Destination: "http://A", }, { - Destination: testRouteBResourceID, + Destination: "http://B", }, }, } @@ -110,13 +110,10 @@ func Test_GetDependencyIDs_Success(t *testing.T) { renderer := Renderer{} radiusResourceIDs, resourceIDs, err := renderer.GetDependencyIDs(ctx, resource) require.NoError(t, err) - require.Len(t, radiusResourceIDs, 2) + require.Len(t, radiusResourceIDs, 1) require.Len(t, resourceIDs, 0) - expectedRadiusResourceIDs := []resources.ID{ - makeResourceID(t, testRouteAResourceID), - makeResourceID(t, testRouteBResourceID), - } + expectedRadiusResourceIDs := []resources.ID{resources.MustParse(secretStoreID)} require.ElementsMatch(t, expectedRadiusResourceIDs, radiusResourceIDs) expectedAzureResourceIDs := []resources.ID{} @@ -151,7 +148,7 @@ func Test_Render_WithIPAndNoHostname(t *testing.T) { Includes: expectedIncludes, } - validateHTTPProxy(t, output.Resources, expectedGatewaySpec, "") + validateContourHTTPProxy(t, output.Resources, expectedGatewaySpec, "") } func Test_Render_WithIPAndPrefix(t *testing.T) { @@ -186,7 +183,7 @@ func Test_Render_WithIPAndPrefix(t *testing.T) { Includes: expectedIncludes, } - validateHTTPProxy(t, output.Resources, expectedGatewaySpec, "") + validateContourHTTPProxy(t, output.Resources, expectedGatewaySpec, "") } func Test_Render_WithIPAndFQHostname(t *testing.T) { @@ -219,7 +216,7 @@ func Test_Render_WithIPAndFQHostname(t *testing.T) { Includes: expectedIncludes, } - validateHTTPProxy(t, output.Resources, expectedGatewaySpec, "") + validateContourHTTPProxy(t, output.Resources, expectedGatewaySpec, "") } func Test_Render_WithFQHostname_OverridesPrefix(t *testing.T) { @@ -254,7 +251,7 @@ func Test_Render_WithFQHostname_OverridesPrefix(t *testing.T) { Includes: expectedIncludes, } - validateHTTPProxy(t, output.Resources, expectedGatewaySpec, "") + validateContourHTTPProxy(t, output.Resources, expectedGatewaySpec, "") } func Test_Render_PublicEndpointOverride(t *testing.T) { @@ -282,7 +279,7 @@ func Test_Render_PublicEndpointOverride(t *testing.T) { Includes: expectedIncludes, } - validateHTTPProxy(t, output.Resources, expectedGatewaySpec, "") + validateContourHTTPProxy(t, output.Resources, expectedGatewaySpec, "") } func Test_Render_PublicEndpointOverride_OverridesAll(t *testing.T) { @@ -315,7 +312,7 @@ func Test_Render_PublicEndpointOverride_OverridesAll(t *testing.T) { Includes: expectedIncludes, } - validateHTTPProxy(t, output.Resources, expectedGatewaySpec, "") + validateContourHTTPProxy(t, output.Resources, expectedGatewaySpec, "") } func Test_Render_PublicEndpointOverride_WithEmptyIP(t *testing.T) { @@ -345,7 +342,7 @@ func Test_Render_PublicEndpointOverride_WithEmptyIP(t *testing.T) { Includes: expectedIncludes, } - validateHTTPProxy(t, output.Resources, expectedGatewaySpec, "") + validateContourHTTPProxy(t, output.Resources, expectedGatewaySpec, "") } func Test_Render_LocalhostPublicEndpointOverride(t *testing.T) { @@ -375,7 +372,7 @@ func Test_Render_LocalhostPublicEndpointOverride(t *testing.T) { Includes: expectedIncludes, } - validateHTTPProxy(t, output.Resources, expectedGatewaySpec, "") + validateContourHTTPProxy(t, output.Resources, expectedGatewaySpec, "") } func Test_Render_Hostname(t *testing.T) { @@ -404,7 +401,7 @@ func Test_Render_Hostname(t *testing.T) { Includes: expectedIncludes, } - validateHTTPProxy(t, output.Resources, expectedGatewaySpec, "") + validateContourHTTPProxy(t, output.Resources, expectedGatewaySpec, "") } func Test_Render_Hostname_WithPort(t *testing.T) { @@ -434,7 +431,7 @@ func Test_Render_Hostname_WithPort(t *testing.T) { Includes: expectedIncludes, } - validateHTTPProxy(t, output.Resources, expectedGatewaySpec, "") + validateContourHTTPProxy(t, output.Resources, expectedGatewaySpec, "") } func Test_Render_Hostname_WithPrefix(t *testing.T) { @@ -468,7 +465,7 @@ func Test_Render_Hostname_WithPrefix(t *testing.T) { Includes: expectedIncludes, } - validateHTTPProxy(t, output.Resources, expectedGatewaySpec, "") + validateContourHTTPProxy(t, output.Resources, expectedGatewaySpec, "") } func Test_Render_Hostname_WithPrefixAndPort(t *testing.T) { @@ -502,7 +499,7 @@ func Test_Render_Hostname_WithPrefixAndPort(t *testing.T) { Includes: expectedIncludes, } - validateHTTPProxy(t, output.Resources, expectedGatewaySpec, "") + validateContourHTTPProxy(t, output.Resources, expectedGatewaySpec, "") } func Test_Render_WithMissingPublicIP(t *testing.T) { @@ -533,13 +530,12 @@ func Test_Render_WithMissingPublicIP(t *testing.T) { Includes: expectedIncludes, } - validateHTTPProxy(t, output.Resources, expectedGatewaySpec, "") + validateContourHTTPProxy(t, output.Resources, expectedGatewaySpec, "") } func Test_Render_Fails_SSLPassthroughWithRoutePath(t *testing.T) { var routes []datamodel.GatewayRoute - routeName := "routename" - destination := makeRouteResourceID(routeName) + destination := "http://A" path := "/" route := datamodel.GatewayRoute{ Destination: destination, @@ -571,17 +567,13 @@ func Test_Render_Fails_SSLPassthroughWithRoutePath(t *testing.T) { func Test_Render_Fails_SSLPassthroughWithMultipleRoutes(t *testing.T) { var routes []datamodel.GatewayRoute - routeName1 := "routename1" - destination1 := makeRouteResourceID(routeName1) path := "/" route1 := datamodel.GatewayRoute{ - Destination: destination1, + Destination: "http://A", Path: path, } - routeName2 := "routename2" - destination2 := makeRouteResourceID(routeName2) route2 := datamodel.GatewayRoute{ - Destination: destination2, + Destination: "http://B", Path: path, } routes = append(routes, route1) @@ -660,7 +652,7 @@ func Test_Render_FQDNOverride(t *testing.T) { Includes: expectedIncludes, } - validateHTTPProxy(t, output.Resources, expectedGatewaySpec, "") + validateContourHTTPProxy(t, output.Resources, expectedGatewaySpec, "") } func Test_Render_Fails_WithoutFQHostnameOrPrefix(t *testing.T) { @@ -688,11 +680,9 @@ func Test_Render_Single_Route(t *testing.T) { r := &Renderer{} var routes []datamodel.GatewayRoute - routeName := "routename" - destination := makeRouteResourceID(routeName) path := "/" route := datamodel.GatewayRoute{ - Destination: destination, + Destination: "http://A", Path: path, } routes = append(routes, route) @@ -716,7 +706,7 @@ func Test_Render_Single_Route(t *testing.T) { expectedIncludes := []contourv1.Include{ { - Name: kubernetes.NormalizeResourceName(routeName), + Name: kubernetes.NormalizeResourceName("A"), Conditions: []contourv1.MatchCondition{ { Prefix: path, @@ -732,18 +722,16 @@ func Test_Render_Single_Route(t *testing.T) { Includes: expectedIncludes, } - validateHTTPProxy(t, output.Resources, expectedGatewaySpec, "") - validateHttpRoute(t, output.Resources, routeName, 80, nil, "") + validateContourHTTPProxy(t, output.Resources, expectedGatewaySpec, "") + validateContourHTTPRoute(t, output.Resources, "A", 80, nil, "") } func Test_Render_SSLPassthrough(t *testing.T) { r := &Renderer{} var routes []datamodel.GatewayRoute - routeName := "routename" - destination := makeRouteResourceID(routeName) route := datamodel.GatewayRoute{ - Destination: destination, + Destination: "http://A", } routes = append(routes, route) tls := &datamodel.GatewayPropertiesTLS{ @@ -770,7 +758,7 @@ func Test_Render_SSLPassthrough(t *testing.T) { expectedIncludes := []contourv1.Include{ { - Name: kubernetes.NormalizeResourceName(routeName), + Name: kubernetes.NormalizeResourceName("A"), Conditions: []contourv1.MatchCondition{ { Prefix: "/", @@ -779,11 +767,8 @@ func Test_Render_SSLPassthrough(t *testing.T) { }, } - routeName, err = getRouteName(&route) - require.NoError(t, err) - // Create unique localID for dependency graph - routeResourceName := kubernetes.NormalizeResourceName(routeName) + routeResourceName := kubernetes.NormalizeResourceName("A") expectedTCPProxy := &contourv1.TCPProxy{ Services: []contourv1.Service{ @@ -805,26 +790,22 @@ func Test_Render_SSLPassthrough(t *testing.T) { Includes: expectedIncludes, } - validateHTTPProxy(t, output.Resources, expectedGatewaySpec, "") - validateHttpRoute(t, output.Resources, routeName, 80, nil, "") + validateContourHTTPProxy(t, output.Resources, expectedGatewaySpec, "") + validateContourHTTPRoute(t, output.Resources, "A", 80, nil, "") } func Test_Render_Multiple_Routes(t *testing.T) { r := &Renderer{} var routes []datamodel.GatewayRoute - routeAName := "routeaname" - routeADestination := makeRouteResourceID(routeAName) routeAPath := "/routea" routeA := datamodel.GatewayRoute{ - Destination: routeADestination, + Destination: "http://A", Path: routeAPath, } - routeBName := "routenbname" - routeBDestination := makeRouteResourceID(routeBName) routeBPath := "/routeb" routeB := datamodel.GatewayRoute{ - Destination: routeBDestination, + Destination: "http://B", Path: routeBPath, } routes = append(routes, routeA) @@ -849,7 +830,7 @@ func Test_Render_Multiple_Routes(t *testing.T) { expectedIncludes := []contourv1.Include{ { - Name: kubernetes.NormalizeResourceName(routeAName), + Name: kubernetes.NormalizeResourceName("A"), Conditions: []contourv1.MatchCondition{ { Prefix: routeAPath, @@ -857,7 +838,7 @@ func Test_Render_Multiple_Routes(t *testing.T) { }, }, { - Name: kubernetes.NormalizeResourceName(routeBName), + Name: kubernetes.NormalizeResourceName("B"), Conditions: []contourv1.MatchCondition{ { Prefix: routeBPath, @@ -873,21 +854,19 @@ func Test_Render_Multiple_Routes(t *testing.T) { Includes: expectedIncludes, } - validateHTTPProxy(t, output.Resources, expectedGatewaySpec, "") - validateHttpRoute(t, output.Resources, routeAName, 80, nil, "") - validateHttpRoute(t, output.Resources, routeBName, 80, nil, "") + validateContourHTTPProxy(t, output.Resources, expectedGatewaySpec, "") + validateContourHTTPRoute(t, output.Resources, "A", 80, nil, "") + validateContourHTTPRoute(t, output.Resources, "B", 80, nil, "") } func Test_Render_Route_WithPrefixRewrite(t *testing.T) { r := &Renderer{} var routes []datamodel.GatewayRoute - routeName := "routename" - destination := makeRouteResourceID(routeName) path := "/backend" rewrite := "/rewrite" route := datamodel.GatewayRoute{ - Destination: destination, + Destination: "http://A", Path: path, ReplacePrefix: rewrite, } @@ -912,7 +891,7 @@ func Test_Render_Route_WithPrefixRewrite(t *testing.T) { expectedIncludes := []contourv1.Include{ { - Name: kubernetes.NormalizeResourceName(routeName), + Name: kubernetes.NormalizeResourceName("A"), Conditions: []contourv1.MatchCondition{ { Prefix: path, @@ -928,7 +907,7 @@ func Test_Render_Route_WithPrefixRewrite(t *testing.T) { Includes: expectedIncludes, } - validateHTTPProxy(t, output.Resources, expectedGatewaySpec, "") + validateContourHTTPProxy(t, output.Resources, expectedGatewaySpec, "") expectedPathRewritePolicy := &contourv1.PathRewritePolicy{ ReplacePrefix: []contourv1.ReplacePrefix{ @@ -938,39 +917,35 @@ func Test_Render_Route_WithPrefixRewrite(t *testing.T) { }, }, } - validateHttpRoute(t, output.Resources, routeName, 80, expectedPathRewritePolicy, "") + validateContourHTTPRoute(t, output.Resources, "A", 80, expectedPathRewritePolicy, "") } func Test_Render_Route_WithMultiplePrefixRewrite(t *testing.T) { r := &Renderer{} var routes []datamodel.GatewayRoute - routeAName := "routeaname" - routeBName := "routebname" - destinationA := makeRouteResourceID(routeAName) - destinationB := makeRouteResourceID(routeBName) routeAPath := "/routea" routeA := datamodel.GatewayRoute{ - Destination: destinationA, + Destination: "http://A", Path: routeAPath, } routeBPath := "/routeb" routeBRewrite := "routebrewrite" routeB := datamodel.GatewayRoute{ - Destination: destinationB, + Destination: "http://B", Path: routeBPath, ReplacePrefix: routeBRewrite, } routeCPath := "/routec" routeCRewrite := "routecrewrite" routeC := datamodel.GatewayRoute{ - Destination: destinationB, + Destination: "http://B", Path: routeCPath, ReplacePrefix: routeCRewrite, } routeDPath := "/routed" routeD := datamodel.GatewayRoute{ - Destination: destinationB, + Destination: "http://B", Path: routeDPath, } routes = append(routes, routeA) @@ -997,7 +972,7 @@ func Test_Render_Route_WithMultiplePrefixRewrite(t *testing.T) { expectedIncludes := []contourv1.Include{ { - Name: kubernetes.NormalizeResourceName(routeAName), + Name: kubernetes.NormalizeResourceName("A"), Conditions: []contourv1.MatchCondition{ { Prefix: routeAPath, @@ -1005,7 +980,7 @@ func Test_Render_Route_WithMultiplePrefixRewrite(t *testing.T) { }, }, { - Name: kubernetes.NormalizeResourceName(routeBName), + Name: kubernetes.NormalizeResourceName("B"), Conditions: []contourv1.MatchCondition{ { Prefix: routeBPath, @@ -1013,7 +988,7 @@ func Test_Render_Route_WithMultiplePrefixRewrite(t *testing.T) { }, }, { - Name: kubernetes.NormalizeResourceName(routeBName), + Name: kubernetes.NormalizeResourceName("B"), Conditions: []contourv1.MatchCondition{ { Prefix: routeCPath, @@ -1021,7 +996,7 @@ func Test_Render_Route_WithMultiplePrefixRewrite(t *testing.T) { }, }, { - Name: kubernetes.NormalizeResourceName(routeBName), + Name: kubernetes.NormalizeResourceName("B"), Conditions: []contourv1.MatchCondition{ { Prefix: routeDPath, @@ -1037,7 +1012,7 @@ func Test_Render_Route_WithMultiplePrefixRewrite(t *testing.T) { Includes: expectedIncludes, } - validateHTTPProxy(t, output.Resources, expectedGatewaySpec, "") + validateContourHTTPProxy(t, output.Resources, expectedGatewaySpec, "") expectedPathRewritePolicy := &contourv1.PathRewritePolicy{ ReplacePrefix: []contourv1.ReplacePrefix{ @@ -1051,24 +1026,26 @@ func Test_Render_Route_WithMultiplePrefixRewrite(t *testing.T) { }, }, } - validateHttpRoute(t, output.Resources, routeAName, 80, nil, "") - validateHttpRoute(t, output.Resources, routeBName, 80, expectedPathRewritePolicy, "") + validateContourHTTPRoute(t, output.Resources, "A", 80, nil, "") + validateContourHTTPRoute(t, output.Resources, "B", 80, expectedPathRewritePolicy, "") } func Test_Render_WithDependencies(t *testing.T) { r := &Renderer{} - var httpRoutePort int32 = 81 - httpRoute := renderHttpRoute(t, httpRoutePort) + secret := makeSecretStoreResource(datamodel.SecretStoreProperties{ + Type: datamodel.SecretTypeCert, + Data: map[string]*datamodel.SecretStoreDataValue{ + "tls.crt": {}, + "tls.key": {}, + }, + }) var routes []datamodel.GatewayRoute - routeName := "routename" - routeDestination := makeRouteResourceID(routeName) routePath := "/routea" - port := float64((httpRoute.ComputedValues["port"].Value).(int32)) route := datamodel.GatewayRoute{ - Destination: routeDestination, + Destination: "http://A:81", Path: routePath, } routes = append(routes, route) @@ -1076,21 +1053,26 @@ func Test_Render_WithDependencies(t *testing.T) { BasicResourceProperties: rpv1.BasicResourceProperties{ Application: "/subscriptions/test-sub-id/resourceGroups/test-rg/providers/Applications.Core/applications/test-application", }, + TLS: &datamodel.GatewayPropertiesTLS{ + CertificateFrom: secret.ID, + }, Routes: routes, } resource := makeResource(properties) dependencies := map[string]renderers.RendererDependency{ - (makeResourceID(t, routeDestination).String()): { - ResourceID: makeResourceID(t, routeDestination), - ComputedValues: map[string]any{ - "port": port, + secret.ID: { + ResourceID: resources.MustParse(secret.ID), + Resource: secret, + ComputedValues: map[string]any{}, + OutputResources: map[string]resources.ID{ + "Secret": resources_kubernetes.IDFromParts("local", "", "Secret", "default", "test-secret"), }, }, } environmentOptions := getEnvironmentOptions("", testExternalIP, "", false, false) expectedHostname := fmt.Sprintf("%s.%s.%s.nip.io", resourceName, applicationName, testExternalIP) - expectedURL := "http://" + expectedHostname + expectedURL := "https://" + expectedHostname output, err := r.Render(context.Background(), resource, renderers.RenderOptions{Dependencies: dependencies, Environment: environmentOptions}) require.NoError(t, err) @@ -1100,7 +1082,7 @@ func Test_Render_WithDependencies(t *testing.T) { expectedIncludes := []contourv1.Include{ { - Name: kubernetes.NormalizeResourceName(routeName), + Name: kubernetes.NormalizeResourceName("a"), Conditions: []contourv1.MatchCondition{ { Prefix: routePath, @@ -1112,23 +1094,24 @@ func Test_Render_WithDependencies(t *testing.T) { expectedGatewaySpec := &contourv1.HTTPProxySpec{ VirtualHost: &contourv1.VirtualHost{ Fqdn: expectedHostname, + TLS: &contourv1.TLS{ + SecretName: "default/test-secret", + }, }, Includes: expectedIncludes, } - validateHTTPProxy(t, output.Resources, expectedGatewaySpec, "") - validateHttpRoute(t, output.Resources, routeName, httpRoutePort, nil, "") + validateContourHTTPProxy(t, output.Resources, expectedGatewaySpec, "") + validateContourHTTPRoute(t, output.Resources, "A", 81, nil, "") } func Test_Render_WithEnvironment_KubernetesMetadata(t *testing.T) { r := &Renderer{} var routes []datamodel.GatewayRoute - routeName := "test-route" - destination := makeRouteResourceID(routeName) path := "/" route := datamodel.GatewayRoute{ - Destination: destination, + Destination: "http://A", Path: path, } routes = append(routes, route) @@ -1152,7 +1135,7 @@ func Test_Render_WithEnvironment_KubernetesMetadata(t *testing.T) { expectedIncludes := []contourv1.Include{ { - Name: kubernetes.NormalizeResourceName(routeName), + Name: kubernetes.NormalizeResourceName("A"), Conditions: []contourv1.MatchCondition{ { Prefix: path, @@ -1168,19 +1151,17 @@ func Test_Render_WithEnvironment_KubernetesMetadata(t *testing.T) { Includes: expectedIncludes, } - validateHTTPProxy(t, output.Resources, expectedGatewaySpec, envKubeMetadata) - validateHttpRoute(t, output.Resources, routeName, 80, nil, envKubeMetadata) + validateContourHTTPProxy(t, output.Resources, expectedGatewaySpec, envKubeMetadata) + validateContourHTTPRoute(t, output.Resources, "A", 80, nil, envKubeMetadata) } func Test_Render_WithEnvironmentApplication_KubernetesMetadata(t *testing.T) { r := &Renderer{} var routes []datamodel.GatewayRoute - routeName := "test-route" - destination := makeRouteResourceID(routeName) path := "/" route := datamodel.GatewayRoute{ - Destination: destination, + Destination: "http://A", Path: path, } routes = append(routes, route) @@ -1205,7 +1186,7 @@ func Test_Render_WithEnvironmentApplication_KubernetesMetadata(t *testing.T) { expectedIncludes := []contourv1.Include{ { - Name: kubernetes.NormalizeResourceName(routeName), + Name: kubernetes.NormalizeResourceName("A"), Conditions: []contourv1.MatchCondition{ { Prefix: path, @@ -1221,8 +1202,8 @@ func Test_Render_WithEnvironmentApplication_KubernetesMetadata(t *testing.T) { Includes: expectedIncludes, } - validateHTTPProxy(t, output.Resources, expectedGatewaySpec, envAppKubeMetadata) - validateHttpRoute(t, output.Resources, routeName, 80, nil, envAppKubeMetadata) + validateContourHTTPProxy(t, output.Resources, expectedGatewaySpec, envAppKubeMetadata) + validateContourHTTPRoute(t, output.Resources, "A", 80, nil, envAppKubeMetadata) } func Test_RenderDNS_WithEnvironmentApplication_KubernetesMetadata(t *testing.T) { @@ -1276,7 +1257,7 @@ func Test_RenderDNS_WithEnvironmentApplication_KubernetesMetadata(t *testing.T) Includes: expectedIncludes, } - validateHTTPProxy(t, output.Resources, expectedGatewaySpec, envAppKubeMetadata) + validateContourHTTPProxy(t, output.Resources, expectedGatewaySpec, envAppKubeMetadata) } func Test_RenderDNS_WithEnvironment_KubernetesMetadata(t *testing.T) { @@ -1329,7 +1310,7 @@ func Test_RenderDNS_WithEnvironment_KubernetesMetadata(t *testing.T) { Includes: expectedIncludes, } - validateHTTPProxy(t, output.Resources, expectedGatewaySpec, envKubeMetadata) + validateContourHTTPProxy(t, output.Resources, expectedGatewaySpec, envKubeMetadata) } func Test_Render_With_TLSTermination(t *testing.T) { @@ -1351,8 +1332,8 @@ func Test_Render_With_TLSTermination(t *testing.T) { environmentOptions := getEnvironmentOptions("", testExternalIP, "", false, false) dependencies := map[string]renderers.RendererDependency{ - (makeResourceID(t, secretStoreResourceId).String()): { - ResourceID: makeResourceID(t, secretStoreResourceId), + secretStoreResourceId: { + ResourceID: resources.MustParse(secretStoreResourceId), Resource: &datamodel.SecretStore{ Properties: &datamodel.SecretStoreProperties{ Type: "certificate", @@ -1398,7 +1379,7 @@ func Test_Render_With_TLSTermination(t *testing.T) { Includes: expectedIncludes, } - validateHTTPProxy(t, output.Resources, expectedGatewaySpec, "") + validateContourHTTPProxy(t, output.Resources, expectedGatewaySpec, "") } func Test_ParseURL(t *testing.T) { @@ -1464,12 +1445,12 @@ func Test_IsURL(t *testing.T) { require.True(t, isURL(valid_default_https_url)) } -func validateHTTPProxy(t *testing.T, outputResources []rpv1.OutputResource, expectedHTTPProxySpec *contourv1.HTTPProxySpec, kmeOption string) { +func validateContourHTTPProxy(t *testing.T, outputResources []rpv1.OutputResource, expectedHTTPProxySpec *contourv1.HTTPProxySpec, kmeOption string) { httpProxy, httpProxyOutputResource := kubernetes.FindContourHTTPProxy(outputResources) expectedHTTPProxyOutputResource := rpv1.NewKubernetesOutputResource(rpv1.LocalIDGateway, httpProxy, httpProxy.ObjectMeta) for _, r := range outputResources { - if strings.Contains(r.LocalID, rpv1.LocalIDHttpRoute) { + if strings.Contains(r.LocalID, rpv1.LocalIDHttpProxy) { expectedHTTPProxyOutputResource.CreateResource.Dependencies = append(expectedHTTPProxyOutputResource.CreateResource.Dependencies, r.LocalID) } } @@ -1491,8 +1472,8 @@ func validateHTTPProxy(t *testing.T, outputResources []rpv1.OutputResource, expe require.Equal(t, expectedHTTPProxySpec, &httpProxy.Spec) } -func validateHttpRoute(t *testing.T, outputResources []rpv1.OutputResource, expectedRouteName string, expectedPort int32, expectedRewrite *contourv1.PathRewritePolicy, kmeOption string) { - expectedLocalID := fmt.Sprintf("%s-%s", rpv1.LocalIDHttpRoute, expectedRouteName) +func validateContourHTTPRoute(t *testing.T, outputResources []rpv1.OutputResource, expectedRouteName string, expectedPort int32, expectedRewrite *contourv1.PathRewritePolicy, kmeOption string) { + expectedLocalID := fmt.Sprintf("%s-%s", rpv1.LocalIDHttpProxy, expectedRouteName) httpRoute, httpRouteOutputResource := kubernetes.FindContourHTTPProxyByLocalID(outputResources, expectedLocalID) expectedHttpRouteOutputResource := rpv1.NewKubernetesOutputResource(expectedLocalID, httpRoute, httpRoute.ObjectMeta) require.Equal(t, expectedHttpRouteOutputResource, httpRouteOutputResource) @@ -1525,28 +1506,6 @@ func validateHttpRoute(t *testing.T, outputResources []rpv1.OutputResource, expe require.Equal(t, expectedHttpRouteSpec, httpRoute.Spec) } -func renderHttpRoute(t *testing.T, port int32) renderers.RendererOutput { - r := &httproute.Renderer{} - - dependencies := map[string]renderers.RendererDependency{} - properties := datamodel.HTTPRouteProperties{ - BasicResourceProperties: rpv1.BasicResourceProperties{ - Application: "/subscriptions/test-sub-id/resourceGroups/test-rg/providers/Applications.Core/applications/test-application", - }, - Port: port, - } - resource := makeDependentResource(properties) - - output, err := r.Render(context.Background(), resource, renderers.RenderOptions{Dependencies: dependencies, Environment: renderers.EnvironmentOptions{}}) - require.NoError(t, err) - - return output -} - -func makeRouteResourceID(routeName string) string { - return "/planes/radius/local/resourcegroups/test-resourcegroup/providers/Applications.Core/httpRoutes/" + routeName -} - func makeSecretStoreResourceID(secretStoreName string) string { return "/planes/radius/local/resourcegroups/test-resourcegroup/providers/Applications.Core/secretStores/" + secretStoreName } @@ -1563,31 +1522,29 @@ func makeResource(properties datamodel.GatewayProperties) *datamodel.Gateway { Properties: properties, } } -func makeDependentResource(properties datamodel.HTTPRouteProperties) *datamodel.HTTPRoute { - dm := datamodel.HTTPRoute{Properties: &properties} - dm.Name = resourceName - - return &dm -} -func makeResourceID(t *testing.T, resourceID string) resources.ID { - id, err := resources.ParseResource(resourceID) - require.NoError(t, err) - return id +func makeSecretStoreResource(properties datamodel.SecretStoreProperties) *datamodel.SecretStore { + return &datamodel.SecretStore{ + BaseResource: v1.BaseResource{ + TrackedResource: v1.TrackedResource{ + ID: "/planes/radius/local/resourceGroups/test-group/providers/Applications.Core/secretStores/test-secretstore", + Name: "test-secretstore", + }, + }, + Properties: &properties, + } } func makeTestGateway(config datamodel.GatewayProperties) (datamodel.GatewayProperties, []contourv1.Include) { - routeName := "routeName" - routeDestination := makeRouteResourceID("routeName") routePath := "/" defaultRoute := datamodel.GatewayRoute{ - Destination: routeDestination, + Destination: "http://A", Path: routePath, } includes := []contourv1.Include{ { - Name: kubernetes.NormalizeResourceName(routeName), + Name: kubernetes.NormalizeResourceName("A"), Conditions: []contourv1.MatchCondition{ { Prefix: routePath, diff --git a/pkg/corerp/renderers/httproute/render.go b/pkg/corerp/renderers/httproute/render.go deleted file mode 100644 index 27ed7d8027..0000000000 --- a/pkg/corerp/renderers/httproute/render.go +++ /dev/null @@ -1,120 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package httproute - -import ( - "context" - "fmt" - "strings" - - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/intstr" - - v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" - "github.com/radius-project/radius/pkg/corerp/datamodel" - "github.com/radius-project/radius/pkg/corerp/renderers" - "github.com/radius-project/radius/pkg/kubernetes" - rpv1 "github.com/radius-project/radius/pkg/rp/v1" - "github.com/radius-project/radius/pkg/ucp/resources" -) - -type Renderer struct { -} - -// GetDependencyIDs returns nils for the resourceIDs, radiusResourceIDs and an error. -func (r Renderer) GetDependencyIDs(ctx context.Context, resource v1.DataModelInterface) (radiusResourceIDs []resources.ID, resourceIDs []resources.ID, err error) { - return nil, nil, nil -} - -// Render checks if the DataModelInterface is a valid HTTP Route, sets default port if none is provided, creates a -// ComputedValueReference map, creates a service resource and returns a RendererOutput with the resources and -// computed values. It returns an error if the service resource creation fails. -func (r Renderer) Render(ctx context.Context, dm v1.DataModelInterface, options renderers.RenderOptions) (renderers.RendererOutput, error) { - route, ok := dm.(*datamodel.HTTPRoute) - if !ok { - return renderers.RendererOutput{}, v1.ErrInvalidModelConversion - } - outputResources := []rpv1.OutputResource{} - - if route.Properties.Port == 0 { - route.Properties.Port = renderers.DefaultPort - } - - computedValues := map[string]rpv1.ComputedValueReference{ - "hostname": { - Value: kubernetes.NormalizeResourceName(route.Name), - }, - "port": { - Value: route.Properties.Port, - }, - "url": { - Value: fmt.Sprintf("http://%s:%d", kubernetes.NormalizeResourceName(route.Name), route.Properties.Port), - }, - "scheme": { - Value: "http", - }, - } - - service, err := r.makeService(route, options) - if err != nil { - return renderers.RendererOutput{}, err - } - outputResources = append(outputResources, service) - - return renderers.RendererOutput{ - Resources: outputResources, - ComputedValues: computedValues, - }, nil -} - -func (r *Renderer) makeService(route *datamodel.HTTPRoute, options renderers.RenderOptions) (rpv1.OutputResource, error) { - appId, err := resources.ParseResource(route.Properties.Application) - if err != nil { - return rpv1.OutputResource{}, v1.NewClientErrInvalidRequest(fmt.Sprintf("invalid application id: %s. id: %s", err.Error(), route.Properties.Application)) - } - - typeParts := strings.Split(ResourceType, "/") - resourceTypeSuffix := typeParts[len(typeParts)-1] - - service := &corev1.Service{ - TypeMeta: metav1.TypeMeta{ - Kind: "Service", - APIVersion: "v1", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: kubernetes.NormalizeResourceName(route.Name), - Namespace: options.Environment.Namespace, - Labels: renderers.GetLabels(options, appId.Name(), route.Name, route.ResourceTypeName()), - Annotations: renderers.GetAnnotations(options), - }, - Spec: corev1.ServiceSpec{ - Selector: kubernetes.MakeRouteSelectorLabels(appId.Name(), resourceTypeSuffix, route.Name), - Type: corev1.ServiceTypeClusterIP, - Ports: []corev1.ServicePort{ - { - Name: route.Name, - Port: route.Properties.Port, - TargetPort: intstr.FromString(kubernetes.GetShortenedTargetPortName(resourceTypeSuffix + route.Name)), - Protocol: corev1.ProtocolTCP, - }, - }, - }, - } - - return rpv1.NewKubernetesOutputResource(rpv1.LocalIDService, service, service.ObjectMeta), nil -} diff --git a/pkg/corerp/renderers/httproute/render_test.go b/pkg/corerp/renderers/httproute/render_test.go deleted file mode 100644 index 23daa17f0f..0000000000 --- a/pkg/corerp/renderers/httproute/render_test.go +++ /dev/null @@ -1,305 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package httproute - -import ( - "context" - "fmt" - "strings" - "testing" - - "github.com/radius-project/radius/pkg/corerp/datamodel" - "github.com/radius-project/radius/pkg/corerp/renderers" - "github.com/radius-project/radius/pkg/kubernetes" - rpv1 "github.com/radius-project/radius/pkg/rp/v1" - "github.com/radius-project/radius/test/testcontext" - - "github.com/stretchr/testify/require" - corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/util/intstr" -) - -const ( - applicationName = "test-application" - resourceName = "test-route" - applicationPath = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/" - - // User Inputs for testing labels and annotations - envAnnotationKey1 = "env.ann1" - envAnnotationKey2 = "env.ann2" - envAnnotationVal1 = "env.annval1" - envAnnotationVal2 = "env.annval2" - - envLabelKey1 = "env.lbl1" - envLabelKey2 = "env.lbl2" - envLabelVal1 = "env.lblval1" - envLabelVal2 = "env.lblval2" - - appAnnotationKey1 = "app.ann1" - appAnnotationKey2 = "app.ann2" - appAnnotationVal1 = "app.annval1" - appAnnotationVal2 = "app.annval2" - - appLabelKey1 = "app.lbl1" - appLabelKey2 = "app.lbl2" - appLabelVal1 = "env.lblval1" - appLabelVal2 = "env.lblval2" - - overrideKey1 = "test.ann1" - overrideKey2 = "test.lbl1" - overrideVal1 = "override.app.annval1" - overrideVal2 = "override.app.lblval1" - - managedbyKey = "app.kubernetes.io/managed-by" - managedbyVal = "radius-rp" - nameKey = "app.kubernetes.io/name" - nameVal = "test-route" - partofKey = "app.kubernetes.io/part-of" - partofVal = "test-application" - appKey = "radapp.io/application" - appVal = "test-application" - resourceKey = "radapp.io/resource" - resourceVal = "test-route" - resourcetypeKey = "radapp.io/resource-type" - resourcetypeVal = "applications.core-httproutes" -) - -type setupMaps struct { - envKubeMetadataExt *datamodel.KubeMetadataExtension - appKubeMetadataExt *datamodel.KubeMetadataExtension -} - -type expectedMaps struct { - metaAnn map[string]string - metaLbl map[string]string -} - -func TestHTTPRouteRenderer(t *testing.T) { - tests := []struct { - name string - port int32 - options renderers.RenderOptions - setupMaps *setupMaps - expectedMaps *expectedMaps - }{ - { - name: "Test_Port", - port: 6379, - options: getRenderOptions(0), - setupMaps: nil, - expectedMaps: nil, - }, - { - name: "Test_DefaultPort", - port: renderers.DefaultPort, - options: getRenderOptions(0), - setupMaps: nil, - expectedMaps: nil, - }, - { - name: "Test_With_Environment_Kubernetes_Metadata", - port: renderers.DefaultPort, - options: getRenderOptions(1), - setupMaps: getSetUpMaps(true), - expectedMaps: getExpectedMaps(true), - }, - { - name: "Test_With_Environment_Application_Kubernetes_Metadata", - port: renderers.DefaultPort, - options: getRenderOptions(2), - setupMaps: getSetUpMaps(false), - expectedMaps: getExpectedMaps(false), - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - r := &Renderer{} - - properties := makeHTTPRouteProperties(tt.port) - resource := makeResource(&properties) - - output, err := r.Render(context.Background(), resource, tt.options) - require.NoError(t, err) - require.Len(t, output.Resources, 1) - require.Empty(t, output.SecretValues) - - expectedServicePort := corev1.ServicePort{ - Name: resourceName, - Port: tt.port, - TargetPort: intstr.FromString(kubernetes.GetShortenedTargetPortName(ResourceTypeSuffix + resource.Name)), - Protocol: "TCP", - } - expectedValues := map[string]rpv1.ComputedValueReference{ - "hostname": {Value: kubernetes.NormalizeResourceName(resourceName)}, - "port": {Value: tt.port}, - "scheme": {Value: "http"}, - "url": {Value: fmt.Sprintf("http://%s:%d", kubernetes.NormalizeResourceName(resourceName), tt.port)}, - } - - require.Equal(t, expectedValues, output.ComputedValues) - - service, outputResource := kubernetes.FindService(output.Resources) - expectedOutputResource := rpv1.NewKubernetesOutputResource(rpv1.LocalIDService, service, service.ObjectMeta) - - require.Equal(t, expectedOutputResource, outputResource) - require.Equal(t, kubernetes.NormalizeResourceName(resource.Name), service.Name) - require.Equal(t, "", service.Namespace) - require.Equal(t, kubernetes.MakeRouteSelectorLabels(applicationName, ResourceTypeSuffix, resourceName), service.Spec.Selector) - require.Equal(t, corev1.ServiceTypeClusterIP, service.Spec.Type) - require.Len(t, service.Spec.Ports, 1) - - servicePort := service.Spec.Ports[0] - require.Equal(t, expectedServicePort, servicePort) - - // Check values of labels and annotations - if tt.expectedMaps != nil { - require.Equal(t, tt.expectedMaps.metaAnn, service.Annotations) - require.Equal(t, tt.expectedMaps.metaLbl, service.Labels) - } else { - require.Equal(t, kubernetes.MakeDescriptiveLabels(applicationName, resourceName, resource.ResourceTypeName()), service.Labels) - require.Nil(t, service.Annotations) - } - }) - } -} - -func Test_GetDependencyIDs_Empty(t *testing.T) { - ctx := testcontext.New(t) - r := &Renderer{} - dependencies, _, err := r.GetDependencyIDs(ctx, &datamodel.HTTPRoute{}) - require.NoError(t, err) - require.Empty(t, dependencies) -} - -func makeHTTPRouteProperties(port int32) datamodel.HTTPRouteProperties { - properties := datamodel.HTTPRouteProperties{} - str := []string{applicationPath, applicationName} - properties.Application = strings.Join(str, "") - if port > 0 { - properties.Port = port - } - - return properties -} - -func makeResource(properties *datamodel.HTTPRouteProperties) *datamodel.HTTPRoute { - dm := datamodel.HTTPRoute{Properties: properties} - dm.Name = resourceName - - return &dm -} - -func getRenderOptions(opt int) renderers.RenderOptions { - /* - opt: 1 - Env KubeMetadata - opt: 2 - Env and App KubeMetadata - */ - - dependencies := map[string]renderers.RendererDependency{} - option := renderers.RenderOptions{Dependencies: dependencies} - if !(opt == 1 || opt == 2) { - return option - } - - option.Environment = renderers.EnvironmentOptions{ - KubernetesMetadata: &datamodel.KubeMetadataExtension{ - Annotations: getSetUpMaps(true).envKubeMetadataExt.Annotations, - Labels: getSetUpMaps(true).envKubeMetadataExt.Labels, - }} - - if opt == 2 { - option.Application = renderers.ApplicationOptions{ - KubernetesMetadata: &datamodel.KubeMetadataExtension{ - Annotations: getSetUpMaps(false).appKubeMetadataExt.Annotations, - Labels: getSetUpMaps(false).appKubeMetadataExt.Labels, - }} - } - - return option -} - -func getSetUpMaps(envOnly bool) *setupMaps { - setupMap := setupMaps{} - - envKubeMetadataExt := &datamodel.KubeMetadataExtension{ - Annotations: map[string]string{ - envAnnotationKey1: envAnnotationVal1, - envAnnotationKey2: envAnnotationVal2, - overrideKey1: envAnnotationVal1, - }, - Labels: map[string]string{ - envLabelKey1: envLabelVal1, - envLabelKey2: envLabelVal2, - overrideKey2: envLabelVal1, - }, - } - appKubeMetadataExt := &datamodel.KubeMetadataExtension{ - Annotations: map[string]string{ - appAnnotationKey1: appAnnotationVal1, - appAnnotationKey2: appAnnotationVal2, - overrideKey1: overrideVal1, - }, - Labels: map[string]string{ - appLabelKey1: appLabelVal1, - appLabelKey2: appLabelVal2, - overrideKey2: overrideVal2, - }, - } - - setupMap.envKubeMetadataExt = envKubeMetadataExt - - if !envOnly { - setupMap.appKubeMetadataExt = appKubeMetadataExt - } - - return &setupMap -} - -func getExpectedMaps(envOnly bool) *expectedMaps { - metaAnn := map[string]string{ - envAnnotationKey1: envAnnotationVal1, - envAnnotationKey2: envAnnotationVal2, - overrideKey1: envAnnotationVal1, - } - metaLbl := map[string]string{ - envLabelKey1: envLabelVal1, - envLabelKey2: envLabelVal2, - overrideKey2: envLabelVal1, - managedbyKey: managedbyVal, - nameKey: nameVal, - partofKey: partofVal, - appKey: appVal, - resourceKey: resourceVal, - resourcetypeKey: resourcetypeVal, - } - - if !envOnly { - metaAnn[appAnnotationKey1] = appAnnotationVal1 - metaAnn[appAnnotationKey2] = appAnnotationVal2 - metaAnn[overrideKey1] = overrideVal1 - - metaLbl[appLabelKey1] = appLabelVal1 - metaLbl[appLabelKey2] = appLabelVal2 - metaLbl[overrideKey2] = overrideVal2 - } - - return &expectedMaps{ - metaAnn: metaAnn, - metaLbl: metaLbl, - } -} diff --git a/pkg/corerp/renderers/httproute/types.go b/pkg/corerp/renderers/httproute/types.go deleted file mode 100644 index 2baa547606..0000000000 --- a/pkg/corerp/renderers/httproute/types.go +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package httproute - -const ( - ResourceType = "Applications.Core/httpRoutes" - ResourceTypeSuffix = "httpRoutes" -) diff --git a/pkg/corerp/setup/operations.go b/pkg/corerp/setup/operations.go index d132ae4800..178836ffd9 100644 --- a/pkg/corerp/setup/operations.go +++ b/pkg/corerp/setup/operations.go @@ -99,36 +99,6 @@ var operationList = []v1.Operation{ }, IsDataAction: false, }, - { - Name: "Applications.Core/httproutes/read", - Display: &v1.OperationDisplayProperties{ - Provider: "Applications.Core", - Resource: "httproutes", - Operation: "List httproutes", - Description: "Get the list of httproutes.", - }, - IsDataAction: false, - }, - { - Name: "Applications.Core/httproutes/write", - Display: &v1.OperationDisplayProperties{ - Provider: "Applications.Core", - Resource: "httproutes", - Operation: "Create/Update httproute", - Description: "Create or update an httproute.", - }, - IsDataAction: false, - }, - { - Name: "Applications.Core/httproutes/delete", - Display: &v1.OperationDisplayProperties{ - Provider: "Applications.Core", - Resource: "httproutes", - Operation: "Delete httproute", - Description: "Delete an httproute.", - }, - IsDataAction: false, - }, { Name: "Applications.Core/applications/read", Display: &v1.OperationDisplayProperties{ diff --git a/pkg/corerp/setup/setup.go b/pkg/corerp/setup/setup.go index 33a8278c53..cb709ef4b8 100644 --- a/pkg/corerp/setup/setup.go +++ b/pkg/corerp/setup/setup.go @@ -91,24 +91,6 @@ func SetupNamespace(recipeControllerConfig *controllerconfig.RecipeControllerCon }, }) - _ = ns.AddResource("httpRoutes", &builder.ResourceOption[*datamodel.HTTPRoute, datamodel.HTTPRoute]{ - RequestConverter: converter.HTTPRouteDataModelFromVersioned, - ResponseConverter: converter.HTTPRouteDataModelToVersioned, - - Put: builder.Operation[datamodel.HTTPRoute]{ - AsyncJobController: backend_ctrl.NewCreateOrUpdateResource, - AsyncOperationRetryAfter: AsyncOperationRetryAfter, - }, - Patch: builder.Operation[datamodel.HTTPRoute]{ - AsyncJobController: backend_ctrl.NewCreateOrUpdateResource, - AsyncOperationRetryAfter: AsyncOperationRetryAfter, - }, - Delete: builder.Operation[datamodel.HTTPRoute]{ - AsyncJobController: backend_ctrl.NewDeleteResource, - AsyncOperationRetryAfter: AsyncOperationRetryAfter, - }, - }) - _ = ns.AddResource("containers", &builder.ResourceOption[*datamodel.ContainerResource, datamodel.ContainerResource]{ RequestConverter: converter.ContainerDataModelFromVersioned, ResponseConverter: converter.ContainerDataModelToVersioned, diff --git a/pkg/corerp/setup/setup_test.go b/pkg/corerp/setup/setup_test.go index 6dcc44dc07..7e6f25529c 100644 --- a/pkg/corerp/setup/setup_test.go +++ b/pkg/corerp/setup/setup_test.go @@ -38,7 +38,6 @@ import ( ctr_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/containers" env_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/environments" gtwy_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/gateways" - hrt_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/httproutes" secret_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/secretstores" vol_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/volumes" ) @@ -144,30 +143,6 @@ var handlerTests = []rpctest.HandlerTestSpec{ OperationType: v1.OperationType{Type: gtwy_ctrl.ResourceTypeName, Method: v1.OperationDelete}, Path: "/resourcegroups/testrg/providers/applications.core/gateways/gateway0", Method: http.MethodDelete, - }, { - OperationType: v1.OperationType{Type: hrt_ctrl.ResourceTypeName, Method: v1.OperationPlaneScopeList}, - Path: "/providers/applications.core/httproutes", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: hrt_ctrl.ResourceTypeName, Method: v1.OperationList}, - Path: "/resourcegroups/testrg/providers/applications.core/httproutes", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: hrt_ctrl.ResourceTypeName, Method: v1.OperationGet}, - Path: "/resourcegroups/testrg/providers/applications.core/httproutes/hrt0", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: hrt_ctrl.ResourceTypeName, Method: v1.OperationPut}, - Path: "/resourcegroups/testrg/providers/applications.core/httproutes/hrt0", - Method: http.MethodPut, - }, { - OperationType: v1.OperationType{Type: hrt_ctrl.ResourceTypeName, Method: v1.OperationPatch}, - Path: "/resourcegroups/testrg/providers/applications.core/httproutes/hrt0", - Method: http.MethodPatch, - }, { - OperationType: v1.OperationType{Type: hrt_ctrl.ResourceTypeName, Method: v1.OperationDelete}, - Path: "/resourcegroups/testrg/providers/applications.core/httproutes/hrt0", - Method: http.MethodDelete, }, { OperationType: v1.OperationType{Type: secret_ctrl.ResourceTypeName, Method: v1.OperationPlaneScopeList}, Path: "/providers/applications.core/secretstores", diff --git a/pkg/kubernetes/labels.go b/pkg/kubernetes/labels.go index 8fc2e5bbd1..38659799fd 100644 --- a/pkg/kubernetes/labels.go +++ b/pkg/kubernetes/labels.go @@ -17,7 +17,6 @@ limitations under the License. package kubernetes import ( - "fmt" "strings" ) @@ -110,21 +109,6 @@ func MakeSelectorLabels(application string, resource string) map[string]string { } } -// MakeRouteSelectorLabels returns a map of labels suitable for a Kubernetes selector to identify a labeled Radius-managed -// Kubernetes object. -// -// This function differs from MakeRouteSelectorLabels in that it's intended to *cross* resources. eg: The Service created by -// an HttpRoute and the Deployment created by a Container. -func MakeRouteSelectorLabels(application string, resourceType string, route string) map[string]string { - return map[string]string{ - LabelRadiusApplication: NormalizeResourceName(application), - - // NOTE: pods can serve multiple routes of different types. Therefore we need to encode the - // the route's type and name in the *key* to support multiple matches. - fmt.Sprintf(LabelRadiusRouteFmt, NormalizeResourceName(strings.TrimSuffix(resourceType, "Route")), NormalizeResourceName(route)): "true", - } -} - // NormalizeResourceName normalizes resource name used for kubernetes resource name scoped in namespace. // All name will be validated by swagger validation so that it does not get non-RFC1035 compliant characters. // Therefore, this function will lowercase the name without allowed character validation. diff --git a/pkg/kubernetes/object.go b/pkg/kubernetes/object.go index 54bd6c2e2d..ca902950fa 100644 --- a/pkg/kubernetes/object.go +++ b/pkg/kubernetes/object.go @@ -119,17 +119,17 @@ func FindContourHTTPProxyByLocalID(resources []rpv1.OutputResource, localID stri continue } - httpRoute, ok := r.CreateResource.Data.(*contourv1.HTTPProxy) + httpProxy, ok := r.CreateResource.Data.(*contourv1.HTTPProxy) if !ok { continue } // If VirtualHost exists, then this is a root HTTPProxy (gateway) - if httpRoute.Spec.VirtualHost != nil { + if httpProxy.Spec.VirtualHost != nil { continue } - return httpRoute, r + return httpProxy, r } return nil, rpv1.OutputResource{} diff --git a/pkg/rp/v1/localids.go b/pkg/rp/v1/localids.go index 1d0507bbe0..e1fe738887 100644 --- a/pkg/rp/v1/localids.go +++ b/pkg/rp/v1/localids.go @@ -53,7 +53,7 @@ const ( LocalIDDaprPubSubBrokerKafka = "DaprPubSubBrokerKafka" LocalIDDeployment = "Deployment" LocalIDGateway = "Gateway" - LocalIDHttpRoute = "HttpRoute" + LocalIDHttpProxy = "HttpProxy" LocalIDKeyVault = "KeyVault" LocalIDSecret = "Secret" LocalIDConfigMap = "ConfigMap" diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/Gateways_CreateOrUpdate.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/Gateways_CreateOrUpdate.json index 85796356d5..71fa5cf16b 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/Gateways_CreateOrUpdate.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/Gateways_CreateOrUpdate.json @@ -11,7 +11,7 @@ "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", "routes":[ { - "destination": "/planes/radius/local/resourcegroups/myawsenv/providers/applications.core/httproutes/gtwy-front-rte" + "destination": "http://frontend" } ], "tls":{ @@ -34,7 +34,7 @@ "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", "routes":[ { - "destination": "/planes/radius/local/resourcegroups/myawsenv/providers/applications.core/httproutes/gtwy-front-rte" + "destination": "http://frontend" } ], "tls":{ diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/Gateways_Get.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/Gateways_Get.json index ccb96c7fc9..7b8a09b399 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/Gateways_Get.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/Gateways_Get.json @@ -17,7 +17,7 @@ "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", "routes":[ { - "destination": "/planes/radius/local/resourcegroups/myawsenv/providers/applications.core/httproutes/gtwy-front-rte" + "destination": "http://frontend" } ], "tls":{ diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/Gateways_List.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/Gateways_List.json index 6e9e65c8ef..4a2c0e8e39 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/Gateways_List.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/Gateways_List.json @@ -18,7 +18,7 @@ "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", "routes":[ { - "destination": "/planes/radius/local/resourcegroups/myawsenv/providers/applications.core/httproutes/gtwy-front-rte" + "destination": "http://frontend" } ], "tls":{ diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/Gateways_ListByScope.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/Gateways_ListByScope.json index 4e4798e5e4..225b186679 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/Gateways_ListByScope.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/Gateways_ListByScope.json @@ -18,7 +18,7 @@ "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", "routes":[ { - "destination": "/planes/radius/local/resourcegroups/myawsenv/providers/applications.core/httproutes/gtwy-front-rte", + "destination": "http://frontend", "path":"/" } ], @@ -39,7 +39,7 @@ "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", "routes":[ { - "destination": "/planes/radius/local/resourcegroups/myawsenv/providers/applications.core/httproutes/gtwy-back-rte", + "destination": "http://frontend", "path":"/backend2" } ], diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/HttpRoutes_CreateOrUpdate.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/HttpRoutes_CreateOrUpdate.json deleted file mode 100644 index 43774c3686..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/HttpRoutes_CreateOrUpdate.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "operationId": "HttpRoutes_CreateOrUpdate", - "title": "Create or Update httpRoutes resources", - "parameters": { - "rootScope": "/planes/radius/local/resourceGroups/testGroup", - "httpRouteName": "route0", - "api-version": "2023-10-01-preview", - "HttpRouteResource": { - "location": "West US", - "properties": { - "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" - } - } - }, - "responses": { - "200": { - "body": { - "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/httpRoutes/routes0", - "name": "routes0", - "type": "Applications.Core/httpRoutes", - "properties": { - "provisioningState": "Succeeded", - "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" - } - } - } - } -} diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/HttpRoutes_Delete.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/HttpRoutes_Delete.json deleted file mode 100644 index 18576a8128..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/HttpRoutes_Delete.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "operationId": "HttpRoutes_Delete", - "title": "Delete a httpRoutes resource", - "parameters": { - "rootScope": "/planes/radius/local/resourceGroups/testGroup", - "httpRouteName": "route0", - "api-version": "2023-10-01-preview" - }, - "responses": { - "200": {}, - "202": {}, - "204": {} - } -} diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/HttpRoutes_Get.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/HttpRoutes_Get.json deleted file mode 100644 index a05a33f054..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/HttpRoutes_Get.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "operationId": "HttpRoutes_Get", - "title": "Get a httpRoutes resource", - "parameters": { - "rootScope": "/planes/radius/local/resourceGroups/testGroup", - "api-version": "2023-10-01-preview", - "httpRouteName": "route0" - }, - "responses": { - "200": { - "body": { - "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/httpRoutes/route0", - "name": "route0", - "type": "Applications.Core/httpRoutes", - "properties": { - "provisioningState": "Succeeded", - "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" - } - } - } - } -} diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/HttpRoutes_List.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/HttpRoutes_List.json deleted file mode 100644 index ba6942a470..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/HttpRoutes_List.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "operationId": "HttpRoutes_ListByScope", - "title": "List httpRoutes resources by resource group", - "parameters": { - "rootScope": "/planes/radius/local/resourceGroups/testGroup", - "api-version": "2023-10-01-preview" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/httpRoutes/route0", - "name": "route0", - "type": "Applications.Core/httpRoutes", - "properties": { - "provisioningState": "Succeeded", - "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" - } - }, - { - "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/httpRoutes/route1", - "name": "route1", - "type": "Applications.Core/httpRoutes", - "properties": { - "provisioningState": "Succeeded", - "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" - } - } - ], - "nextLink": "https://serviceRoot/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/httproutes?api-version=2023-10-01-preview&$skiptoken=X'12345'" - } - } - } -} diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/HttpRoutes_ListByScope.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/HttpRoutes_ListByScope.json deleted file mode 100644 index 7fa44644e9..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/HttpRoutes_ListByScope.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "operationId": "HttpRoutes_ListByScope", - "title": "List httpRoutes resources by rootScope", - "parameters": { - "rootScope": "/planes/radius/local", - "api-version": "2023-10-01-preview" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/httpRoutes/route0", - "name": "route0", - "type": "Applications.Core/httpRoutes", - "properties": { - "provisioningState": "Succeeded", - "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" - } - }, - { - "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/httpRoutes/route1", - "name": "route1", - "type": "Applications.Core/httpRoutes", - "properties": { - "provisioningState": "Succeeded", - "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" - } - } - ], - "nextLink": "https://serviceRoot/planes/radius/local/providers/Applications.Core/httproutes?api-version=2023-10-01-preview&$skiptoken=X'12345'" - } - } - } -} diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/HttpRoutes_Update.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/HttpRoutes_Update.json deleted file mode 100644 index 78aa9a4126..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/HttpRoutes_Update.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "operationId": "HttpRoutes_Update", - "title": "Update a httpRoutes resource", - "parameters": { - "rootScope": "/planes/radius/local/resourceGroups/testGroup", - "httpRouteName": "route0", - "api-version": "2023-10-01-preview", - "HttpRouteResource": { - "location": "West US", - "properties": { - "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" - } - } - }, - "responses": { - "200": { - "body": { - "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/httpRoutes/routes0", - "name": "routes0", - "type": "Applications.Core/httpRoutes", - "properties": { - "provisioningState": "Succeeded", - "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" - } - } - } - } -} diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/Operations_List.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/Operations_List.json index 298ccc6176..5c2888510a 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/Operations_List.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/Operations_List.json @@ -118,36 +118,6 @@ "description": "Join to application." } }, - { - "name": "Applications.Core/httpRoutes/read", - "isDataAction": false, - "display": { - "provider": "Applications.Core", - "resource": "httpRoutes", - "operation": "Get/List HTTP Route", - "description": "Get or list of HTTP Routes." - } - }, - { - "name": "Applications.Core/httpRoutes/write", - "isDataAction": false, - "display": { - "provider": "Applications.Core", - "resource": "httpRoutes", - "operation": "Create/Update HTTP Route", - "description": "Create or update an HTTP Route." - } - }, - { - "name": "Applications.Core/httpRoutes/delete", - "isDataAction": false, - "display": { - "provider": "Applications.Core", - "resource": "httpRoutes", - "operation": "Delete HTTP Route", - "description": "Deletes an HTTP Route." - } - }, { "name": "Applications.Core/gateways/read", "isDataAction": false, diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/Volumes_CreateOrUpdate.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/Volumes_CreateOrUpdate.json index 39d41f1858..a27bd79cc7 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/Volumes_CreateOrUpdate.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/Volumes_CreateOrUpdate.json @@ -5,7 +5,7 @@ "rootScope": "/planes/radius/local/resourceGroups/testGroup", "volumeName": "keyvault0", "api-version": "2023-10-01-preview", - "HttpRouteResource": { + "VolumeResource": { "location": "West US", "properties": { "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/Volumes_Update.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/Volumes_Update.json index a8c25aa466..a510d20bd2 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/Volumes_Update.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/examples/Volumes_Update.json @@ -5,7 +5,7 @@ "rootScope": "/planes/radius/local/resourceGroups/testGroup", "volumeName": "keyvault0", "api-version": "2023-10-01-preview", - "HttpRouteResource": { + "VolumeResource": { "location": "West US", "properties": { "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/openapi.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/openapi.json index 5f080b9d95..2c280ab4d1 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/openapi.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/openapi.json @@ -54,9 +54,6 @@ { "name": "Gateways" }, - { - "name": "HttpRoutes" - }, { "name": "SecretStores" }, @@ -1564,293 +1561,6 @@ "x-ms-long-running-operation": true } }, - "/{rootScope}/providers/Applications.Core/httpRoutes": { - "get": { - "operationId": "HttpRoutes_ListByScope", - "tags": [ - "HttpRoutes" - ], - "description": "List HttpRouteResource resources by Scope", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParameter" - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/HttpRouteResourceListResult" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples": { - "List httpRoutes resources by resource group": { - "$ref": "./examples/HttpRoutes_List.json" - }, - "List httpRoutes resources by rootScope": { - "$ref": "./examples/HttpRoutes_ListByScope.json" - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - }, - "/{rootScope}/providers/Applications.Core/httpRoutes/{httpRouteName}": { - "get": { - "operationId": "HttpRoutes_Get", - "tags": [ - "HttpRoutes" - ], - "description": "Get a HttpRouteResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParameter" - }, - { - "name": "httpRouteName", - "in": "path", - "description": "HTTPRoute name", - "required": true, - "type": "string", - "maxLength": 63, - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/HttpRouteResource" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples": { - "Get a httpRoutes resource": { - "$ref": "./examples/HttpRoutes_Get.json" - } - } - }, - "put": { - "operationId": "HttpRoutes_CreateOrUpdate", - "tags": [ - "HttpRoutes" - ], - "description": "Create a HttpRouteResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParameter" - }, - { - "name": "httpRouteName", - "in": "path", - "description": "HTTPRoute name", - "required": true, - "type": "string", - "maxLength": 63, - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" - }, - { - "name": "resource", - "in": "body", - "description": "Resource create parameters.", - "required": true, - "schema": { - "$ref": "#/definitions/HttpRouteResource" - } - } - ], - "responses": { - "200": { - "description": "Resource 'HttpRouteResource' update operation succeeded", - "schema": { - "$ref": "#/definitions/HttpRouteResource" - } - }, - "201": { - "description": "Resource 'HttpRouteResource' create operation succeeded", - "schema": { - "$ref": "#/definitions/HttpRouteResource" - }, - "headers": { - "Retry-After": { - "type": "integer", - "format": "int32", - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples": { - "Create or Update httpRoutes resources": { - "$ref": "./examples/HttpRoutes_CreateOrUpdate.json" - } - }, - "x-ms-long-running-operation-options": { - "final-state-via": "azure-async-operation" - }, - "x-ms-long-running-operation": true - }, - "patch": { - "operationId": "HttpRoutes_Update", - "tags": [ - "HttpRoutes" - ], - "description": "Update a HttpRouteResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParameter" - }, - { - "name": "httpRouteName", - "in": "path", - "description": "HTTPRoute name", - "required": true, - "type": "string", - "maxLength": 63, - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" - }, - { - "name": "properties", - "in": "body", - "description": "The resource properties to be updated.", - "required": true, - "schema": { - "$ref": "#/definitions/HttpRouteResourceUpdate" - } - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/HttpRouteResource" - } - }, - "202": { - "description": "Resource update request accepted.", - "headers": { - "Retry-After": { - "type": "integer", - "format": "int32", - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." - }, - "Location": { - "type": "string", - "description": "The Location header contains the URL where the status of the long running operation can be checked." - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples": { - "Update a httpRoutes resource": { - "$ref": "./examples/HttpRoutes_Update.json" - } - }, - "x-ms-long-running-operation-options": { - "final-state-via": "location" - }, - "x-ms-long-running-operation": true - }, - "delete": { - "operationId": "HttpRoutes_Delete", - "tags": [ - "HttpRoutes" - ], - "description": "Delete a HttpRouteResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParameter" - }, - { - "name": "httpRouteName", - "in": "path", - "description": "HTTPRoute name", - "required": true, - "type": "string", - "maxLength": 63, - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" - } - ], - "responses": { - "200": { - "description": "Resource deleted successfully." - }, - "202": { - "description": "Resource deletion accepted.", - "headers": { - "Retry-After": { - "type": "integer", - "format": "int32", - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." - }, - "Location": { - "type": "string", - "description": "The Location header contains the URL where the status of the long running operation can be checked." - } - } - }, - "204": { - "description": "Resource deleted successfully." - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples": { - "Delete a httpRoutes resource": { - "$ref": "./examples/HttpRoutes_Delete.json" - } - }, - "x-ms-long-running-operation-options": { - "final-state-via": "location" - }, - "x-ms-long-running-operation": true - } - }, "/{rootScope}/providers/Applications.Core/secretStores": { "get": { "operationId": "SecretStores_ListByScope", @@ -3029,10 +2739,6 @@ "$ref": "#/definitions/PortProtocol", "description": "Protocol in use by the port" }, - "provides": { - "type": "string", - "description": "Specifies a route provided by this port" - }, "scheme": { "type": "string", "description": "Specifies the URL scheme of the communication protocol. Consumers can use the scheme to construct a URL. The value defaults to 'http' or 'https' depending on the port value" @@ -3060,10 +2766,6 @@ "$ref": "#/definitions/PortProtocol", "description": "Protocol in use by the port" }, - "provides": { - "type": "string", - "description": "Specifies a route provided by this port" - }, "scheme": { "type": "string", "description": "Specifies the URL scheme of the communication protocol. Consumers can use the scheme to construct a URL. The value defaults to 'http' or 'https' depending on the port value" @@ -3993,7 +3695,7 @@ }, "destination": { "type": "string", - "description": "The HttpRoute to route to. Ex - myserviceroute.id." + "description": "The URL or id of the service to route to. Ex - 'http://myservice'." }, "replacePrefix": { "type": "string", @@ -4101,136 +3803,6 @@ ], "x-ms-discriminator-value": "httpGet" }, - "HttpRouteProperties": { - "type": "object", - "description": "HTTPRoute properties", - "properties": { - "environment": { - "type": "string", - "description": "Fully qualified resource ID for the environment that the application is linked to" - }, - "application": { - "type": "string", - "description": "Fully qualified resource ID for the application" - }, - "provisioningState": { - "$ref": "#/definitions/ProvisioningState", - "description": "The status of the asynchronous operation.", - "readOnly": true - }, - "status": { - "$ref": "#/definitions/ResourceStatus", - "description": "Status of a resource.", - "readOnly": true - }, - "hostname": { - "type": "string", - "description": "The internal hostname accepting traffic for the HTTP Route. Readonly." - }, - "port": { - "type": "integer", - "format": "int32", - "description": "The port number for the HTTP Route. Defaults to 80. Readonly." - }, - "scheme": { - "type": "string", - "description": "The scheme used for traffic. Readonly.", - "readOnly": true - }, - "url": { - "type": "string", - "description": "A stable URL that that can be used to route traffic to a resource. Readonly.", - "readOnly": true - } - }, - "required": [ - "application" - ] - }, - "HttpRouteResource": { - "type": "object", - "description": "Radius HTTPRoute Resource.", - "properties": { - "properties": { - "$ref": "#/definitions/HttpRouteProperties", - "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true, - "x-ms-mutability": [ - "read", - "create" - ] - } - }, - "required": [ - "properties" - ], - "allOf": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/TrackedResource" - } - ] - }, - "HttpRouteResourceListResult": { - "type": "object", - "description": "The response of a HttpRouteResource list operation.", - "properties": { - "value": { - "type": "array", - "description": "The HttpRouteResource items on this page", - "items": { - "$ref": "#/definitions/HttpRouteResource" - } - }, - "nextLink": { - "type": "string", - "format": "uri", - "description": "The link to the next page of items" - } - }, - "required": [ - "value" - ] - }, - "HttpRouteResourceUpdate": { - "type": "object", - "description": "The type used for update operations of the HttpRouteResource.", - "properties": { - "tags": { - "type": "object", - "description": "Resource tags.", - "additionalProperties": { - "type": "string" - } - }, - "properties": { - "$ref": "#/definitions/HttpRouteResourceUpdateProperties", - "x-ms-client-flatten": true - } - } - }, - "HttpRouteResourceUpdateProperties": { - "type": "object", - "description": "The updatable properties of the HttpRouteResource.", - "properties": { - "environment": { - "type": "string", - "description": "Fully qualified resource ID for the environment that the application is linked to" - }, - "application": { - "type": "string", - "description": "Fully qualified resource ID for the application" - }, - "hostname": { - "type": "string", - "description": "The internal hostname accepting traffic for the HTTP Route. Readonly." - }, - "port": { - "type": "integer", - "format": "int32", - "description": "The port number for the HTTP Route. Defaults to 80. Readonly." - } - } - }, "IAMKind": { "type": "string", "description": "The kind of IAM provider to configure", diff --git a/test/functional-portable/corerp/noncloud/resources/application_test.go b/test/functional-portable/corerp/noncloud/resources/application_test.go index 37e6ff4d9c..211374e61d 100644 --- a/test/functional-portable/corerp/noncloud/resources/application_test.go +++ b/test/functional-portable/corerp/noncloud/resources/application_test.go @@ -18,6 +18,7 @@ package resource_test import ( "context" + "sort" "testing" "github.com/radius-project/radius/test/rp" @@ -79,11 +80,6 @@ func Test_ApplicationGraph(t *testing.T) { Type: validation.ContainersResource, App: name, }, - { - Name: "http-back-rte-simple1", - Type: validation.HttpRoutesResource, - App: name, - }, { Name: "http-back-ctnr-simple1", Type: validation.ContainersResource, @@ -96,7 +92,8 @@ func Test_ApplicationGraph(t *testing.T) { appNamespace: { validation.NewK8sPodForResource(name, "http-front-ctnr-simple1"), validation.NewK8sPodForResource(name, "http-back-ctnr-simple1"), - validation.NewK8sServiceForResource(name, "http-back-rte-simple1"), + validation.NewK8sServiceForResource(name, "http-front-cntr-simple1").ValidateLabels(false), + validation.NewK8sServiceForResource(name, "http-back-cntr-simple1").ValidateLabels(false), }, }, }, @@ -116,7 +113,22 @@ func Test_ApplicationGraph(t *testing.T) { // assert that the graph is as expected expected := []*v20231001preview.ApplicationGraphResource{} testutil.MustUnmarshalFromFile("corerp-resources-application-graph-out.json", &expected) - require.ElementsMatch(t, expected, res.Resources) + + // For easier comparison, we sort the resources by name. + sort.Slice(res.Resources, func(i, j int) bool { + return *res.Resources[i].Name < *res.Resources[j].Name + }) + sort.Slice(expected, func(i, j int) bool { + return *expected[i].Name < *expected[j].Name + }) + + if len(res.Resources) != len(expected) { + require.ElementsMatch(t, expected, res.Resources) + } else { + for i := range res.Resources { + require.Equal(t, expected[i], res.Resources[i], *expected[i].Name) + } + } }, }, }) diff --git a/test/functional-portable/corerp/noncloud/resources/simulated_environment_test.go b/test/functional-portable/corerp/noncloud/resources/simulated_environment_test.go index cc782a2e72..c4046910d8 100644 --- a/test/functional-portable/corerp/noncloud/resources/simulated_environment_test.go +++ b/test/functional-portable/corerp/noncloud/resources/simulated_environment_test.go @@ -48,21 +48,11 @@ func Test_Deployment_SimulatedEnv(t *testing.T) { Type: validation.GatewaysResource, App: name, }, - { - Name: "http-gtwy-front-rte-simulatedenv", - Type: validation.HttpRoutesResource, - App: name, - }, { Name: "http-gtwy-front-ctnr-simulatedenv", Type: validation.ContainersResource, App: name, }, - { - Name: "http-gtwy-back-rte-simulatedenv", - Type: validation.HttpRoutesResource, - App: name, - }, { Name: "http-gtwy-back-ctnr-simulatedenv", Type: validation.ContainersResource, diff --git a/test/functional-portable/corerp/noncloud/resources/testdata/corerp-resources-application-graph-out.json b/test/functional-portable/corerp/noncloud/resources/testdata/corerp-resources-application-graph-out.json index e0dc5e74ea..1ca37f9efd 100644 --- a/test/functional-portable/corerp/noncloud/resources/testdata/corerp-resources-application-graph-out.json +++ b/test/functional-portable/corerp/noncloud/resources/testdata/corerp-resources-application-graph-out.json @@ -1,99 +1,80 @@ [ - { - "connections": [ - { - "direction": "Inbound", - "id": "/planes/radius/local/resourcegroups/kind-radius/providers/Applications.Core/containers/http-front-ctnr-simple1" - } - ], - "id": "/planes/radius/local/resourcegroups/kind-radius/providers/Applications.Core/httpRoutes/http-back-rte-simple1", - "name": "http-back-rte-simple1", - "outputResources": [ - { - "id": "/planes/kubernetes/local/namespaces/default-corerp-application-simple1/providers/core/Service/http-back-rte-simple1", - "name": "http-back-rte-simple1", - "type": "core/Service" - } - ], - "provisioningState": "Succeeded", - "type": "Applications.Core/httpRoutes" - }, - { - "connections": [ - { - "direction": "Inbound", - "id": "/planes/radius/local/resourcegroups/kind-radius/providers/Applications.Core/httpRoutes/http-back-rte-simple1" - } - ], - "id": "/planes/radius/local/resourcegroups/kind-radius/providers/Applications.Core/containers/http-back-ctnr-simple1", + { + "connections": [ + { + "direction": "Inbound", + "id": "/planes/radius/local/resourcegroups/kind-radius/providers/Applications.Core/containers/http-front-ctnr-simple1" + } + ], + "id": "/planes/radius/local/resourcegroups/kind-radius/providers/Applications.Core/containers/http-back-ctnr-simple1", + "name": "http-back-ctnr-simple1", + "outputResources": [ + { + "id": "/planes/kubernetes/local/namespaces/default-corerp-application-simple1/providers/apps/Deployment/http-back-ctnr-simple1", "name": "http-back-ctnr-simple1", - "outputResources": [ - { - "id": "/planes/kubernetes/local/namespaces/default-corerp-application-simple1/providers/apps/Deployment/http-back-ctnr-simple1", - "name": "http-back-ctnr-simple1", - "type": "apps/Deployment" - }, - { - "id": "/planes/kubernetes/local/namespaces/default-corerp-application-simple1/providers/core/ServiceAccount/http-back-ctnr-simple1", - "name": "http-back-ctnr-simple1", - "type": "core/ServiceAccount" - }, - { - "id": "/planes/kubernetes/local/namespaces/default-corerp-application-simple1/providers/rbac.authorization.k8s.io/Role/http-back-ctnr-simple1", - "name": "http-back-ctnr-simple1", - "type": "rbac.authorization.k8s.io/Role" - }, - { - "id": "/planes/kubernetes/local/namespaces/default-corerp-application-simple1/providers/rbac.authorization.k8s.io/RoleBinding/http-back-ctnr-simple1", - "name": "http-back-ctnr-simple1", - "type": "rbac.authorization.k8s.io/RoleBinding" - } - ], - "provisioningState": "Succeeded", - "type": "Applications.Core/containers" - }, - { - "connections": [ - { - "direction": "Outbound", - "id": "/planes/radius/local/resourcegroups/kind-radius/providers/Applications.Core/httpRoutes/http-back-rte-simple1" - } - ], - "id": "/planes/radius/local/resourcegroups/kind-radius/providers/Applications.Core/containers/http-front-ctnr-simple1", + "type": "apps/Deployment" + }, + { + "id": "/planes/kubernetes/local/namespaces/default-corerp-application-simple1/providers/core/Service/http-back-ctnr-simple1", + "name": "http-back-ctnr-simple1", + "type": "core/Service" + }, + { + "id": "/planes/kubernetes/local/namespaces/default-corerp-application-simple1/providers/core/ServiceAccount/http-back-ctnr-simple1", + "name": "http-back-ctnr-simple1", + "type": "core/ServiceAccount" + }, + { + "id": "/planes/kubernetes/local/namespaces/default-corerp-application-simple1/providers/rbac.authorization.k8s.io/Role/http-back-ctnr-simple1", + "name": "http-back-ctnr-simple1", + "type": "rbac.authorization.k8s.io/Role" + }, + { + "id": "/planes/kubernetes/local/namespaces/default-corerp-application-simple1/providers/rbac.authorization.k8s.io/RoleBinding/http-back-ctnr-simple1", + "name": "http-back-ctnr-simple1", + "type": "rbac.authorization.k8s.io/RoleBinding" + } + ], + "provisioningState": "Succeeded", + "type": "Applications.Core/containers" + }, + { + "connections": [ + { + "direction": "Outbound", + "id": "/planes/radius/local/resourcegroups/kind-radius/providers/Applications.Core/containers/http-back-ctnr-simple1" + } + ], + "id": "/planes/radius/local/resourcegroups/kind-radius/providers/Applications.Core/containers/http-front-ctnr-simple1", + "name": "http-front-ctnr-simple1", + "outputResources": [ + { + "id": "/planes/kubernetes/local/namespaces/default-corerp-application-simple1/providers/apps/Deployment/http-front-ctnr-simple1", + "name": "http-front-ctnr-simple1", + "type": "apps/Deployment" + }, + { + "id": "/planes/kubernetes/local/namespaces/default-corerp-application-simple1/providers/core/Service/http-front-ctnr-simple1", + "name": "http-front-ctnr-simple1", + "type": "core/Service" + }, + { + "id": "/planes/kubernetes/local/namespaces/default-corerp-application-simple1/providers/core/ServiceAccount/http-front-ctnr-simple1", + "name": "http-front-ctnr-simple1", + "type": "core/ServiceAccount" + }, + { + "id": "/planes/kubernetes/local/namespaces/default-corerp-application-simple1/providers/rbac.authorization.k8s.io/Role/http-front-ctnr-simple1", + "name": "http-front-ctnr-simple1", + "type": "rbac.authorization.k8s.io/Role" + }, + { + "id": "/planes/kubernetes/local/namespaces/default-corerp-application-simple1/providers/rbac.authorization.k8s.io/RoleBinding/http-front-ctnr-simple1", "name": "http-front-ctnr-simple1", - "outputResources": [ - { - "id": "/planes/kubernetes/local/namespaces/default-corerp-application-simple1/providers/apps/Deployment/http-front-ctnr-simple1", - "name": "http-front-ctnr-simple1", - "type": "apps/Deployment" - }, - { - "id": "/planes/kubernetes/local/namespaces/default-corerp-application-simple1/providers/core/Secret/http-front-ctnr-simple1", - "name": "http-front-ctnr-simple1", - "type": "core/Secret" - }, - { - "id": "/planes/kubernetes/local/namespaces/default-corerp-application-simple1/providers/core/Service/http-front-ctnr-simple1", - "name": "http-front-ctnr-simple1", - "type": "core/Service" - }, - { - "id": "/planes/kubernetes/local/namespaces/default-corerp-application-simple1/providers/core/ServiceAccount/http-front-ctnr-simple1", - "name": "http-front-ctnr-simple1", - "type": "core/ServiceAccount" - }, - { - "id": "/planes/kubernetes/local/namespaces/default-corerp-application-simple1/providers/rbac.authorization.k8s.io/Role/http-front-ctnr-simple1", - "name": "http-front-ctnr-simple1", - "type": "rbac.authorization.k8s.io/Role" - }, - { - "id": "/planes/kubernetes/local/namespaces/default-corerp-application-simple1/providers/rbac.authorization.k8s.io/RoleBinding/http-front-ctnr-simple1", - "name": "http-front-ctnr-simple1", - "type": "rbac.authorization.k8s.io/RoleBinding" - } - ], - "provisioningState": "Succeeded", - "type": "Applications.Core/containers" - } + "type": "rbac.authorization.k8s.io/RoleBinding" + } + ], + "provisioningState": "Succeeded", + "type": "Applications.Core/containers" + } ] \ No newline at end of file diff --git a/test/functional-portable/corerp/noncloud/resources/testdata/corerp-resources-application-graph.bicep b/test/functional-portable/corerp/noncloud/resources/testdata/corerp-resources-application-graph.bicep index 6c1c138728..94f5a75522 100644 --- a/test/functional-portable/corerp/noncloud/resources/testdata/corerp-resources-application-graph.bicep +++ b/test/functional-portable/corerp/noncloud/resources/testdata/corerp-resources-application-graph.bicep @@ -40,19 +40,12 @@ resource frontendContainer 'Applications.Core/containers@2023-10-01-preview' = { } connections: { backend: { - source: backendRoute.id + source: 'http://http-back-ctnr-simple1:3000' } } } } -resource backendRoute 'Applications.Core/httpRoutes@2023-10-01-preview' = { - name: 'http-back-rte-simple1' - location: location - properties: { - application: app.id - } -} resource backendContainer 'Applications.Core/containers@2023-10-01-preview' = { name: 'http-back-ctnr-simple1' @@ -65,7 +58,6 @@ resource backendContainer 'Applications.Core/containers@2023-10-01-preview' = { ports: { web: { containerPort: port - provides: backendRoute.id } } readinessProbe: { diff --git a/test/functional-portable/corerp/noncloud/resources/testdata/corerp-resources-simulatedenv.bicep b/test/functional-portable/corerp/noncloud/resources/testdata/corerp-resources-simulatedenv.bicep index 1e3a6282b1..b0d0812b18 100644 --- a/test/functional-portable/corerp/noncloud/resources/testdata/corerp-resources-simulatedenv.bicep +++ b/test/functional-portable/corerp/noncloud/resources/testdata/corerp-resources-simulatedenv.bicep @@ -38,31 +38,23 @@ resource gateway 'Applications.Core/gateways@2023-10-01-preview' = { routes: [ { path: '/' - destination: frontendRoute.id + destination: 'http://http-gtwy-front-ctnr-simulatedenv:${port}' } { path: '/backend1' - destination: backendRoute.id + destination: 'http://http-gtwy-back-ctnr-simulatedenv:${port}' } { // Route /backend2 requests to the backend, and // transform the request to / path: '/backend2' - destination: backendRoute.id + destination: 'http://http-gtwy-back-ctnr-simulatedenv:${port}' replacePrefix: '/' } ] } } -resource frontendRoute 'Applications.Core/httpRoutes@2023-10-01-preview' = { - name: 'http-gtwy-front-rte-simulatedenv' - location: location - properties: { - application: app.id - port: 81 - } -} resource frontendContainer 'Applications.Core/containers@2023-10-01-preview' = { name: 'http-gtwy-front-ctnr-simulatedenv' @@ -74,7 +66,6 @@ resource frontendContainer 'Applications.Core/containers@2023-10-01-preview' = { ports: { web: { containerPort: port - provides: frontendRoute.id } } readinessProbe: { @@ -85,19 +76,12 @@ resource frontendContainer 'Applications.Core/containers@2023-10-01-preview' = { } connections: { backend: { - source: backendRoute.id + source: 'http://http-gtwy-back-ctnr-simulatedenv:${port}' } } } } -resource backendRoute 'Applications.Core/httpRoutes@2023-10-01-preview' = { - name: 'http-gtwy-back-rte-simulatedenv' - location: location - properties: { - application: app.id - } -} resource backendContainer 'Applications.Core/containers@2023-10-01-preview' = { name: 'http-gtwy-back-ctnr-simulatedenv' @@ -112,7 +96,6 @@ resource backendContainer 'Applications.Core/containers@2023-10-01-preview' = { ports: { web: { containerPort: port - provides: backendRoute.id } } readinessProbe: { diff --git a/test/functional-portable/daprrp/noncloud/resources/testdata/daprrp-resources-serviceinvocation.bicep b/test/functional-portable/daprrp/noncloud/resources/testdata/daprrp-resources-serviceinvocation.bicep index 2e0d25e29e..84737a9bb2 100644 --- a/test/functional-portable/daprrp/noncloud/resources/testdata/daprrp-resources-serviceinvocation.bicep +++ b/test/functional-portable/daprrp/noncloud/resources/testdata/daprrp-resources-serviceinvocation.bicep @@ -21,7 +21,7 @@ resource frontend 'Applications.Core/containers@2023-10-01-preview' = { image: magpieimage env: { // Used by magpie to communicate with the backend. - CONNECTION_DAPRHTTPROUTE_APPID: 'backend' + CONNECTION_DAPRHTTP_APPID: 'backend' } readinessProbe:{ kind:'httpGet' diff --git a/test/magpiego/bindings/daprhttpinvoke.go b/test/magpiego/bindings/daprhttp.go similarity index 83% rename from test/magpiego/bindings/daprhttpinvoke.go rename to test/magpiego/bindings/daprhttp.go index 901b9f34cd..382b929c34 100644 --- a/test/magpiego/bindings/daprhttpinvoke.go +++ b/test/magpiego/bindings/daprhttp.go @@ -9,14 +9,14 @@ import ( dapr "github.com/dapr/go-sdk/client" ) -// DaprHttpRouteBinding checks if the environment parameter "APPID" is present and if so, creates a Dapr client and invokes +// DaprHttpBinding checks if the environment parameter "APPID" is present and if so, creates a Dapr client and invokes // a method on it, returning a BindingStatus object with a boolean and a message. If an error occurs, the BindingStatus // object will contain false and an error message. // // requires both the value to be set as env variables -// - CONNECTION_DAPRHTTPROUTE_APPID +// - CONNECTION_DAPRHTTP_APPID // - DAPR_GRPC_PORT -func DaprHttpRouteBinding(envParams map[string]string) BindingStatus { +func DaprHttpBinding(envParams map[string]string) BindingStatus { appID := envParams["APPID"] if appID == "" { log.Println("APPID is required") diff --git a/test/magpiego/server.go b/test/magpiego/server.go index cc4f78104c..b506f95f15 100644 --- a/test/magpiego/server.go +++ b/test/magpiego/server.go @@ -28,7 +28,7 @@ var Providers = map[string]bindings.BindingProvider{ "DAPRSTATESTORE": bindings.DaprStateStoreBinding, "RABBITMQ": bindings.RabbitMQBinding, "DAPRSECRETSTORE": bindings.DaprSecretStoreBinding, - "DAPRHTTPROUTE": bindings.DaprHttpRouteBinding, + "DAPRHTTP": bindings.DaprHttpBinding, "STORAGE": bindings.StorageBinding, } diff --git a/test/validation/shared.go b/test/validation/shared.go index f0636e1da4..d731c182b9 100644 --- a/test/validation/shared.go +++ b/test/validation/shared.go @@ -37,7 +37,6 @@ import ( const ( EnvironmentsResource = "applications.core/environments" ApplicationsResource = "applications.core/applications" - HttpRoutesResource = "applications.core/httpRoutes" GatewaysResource = "applications.core/gateways" ContainersResource = "applications.core/containers" VolumesResource = "applications.core/volumes" diff --git a/typespec/Applications.Core/containers.tsp b/typespec/Applications.Core/containers.tsp index 66b060abed..dfd642819f 100644 --- a/typespec/Applications.Core/containers.tsp +++ b/typespec/Applications.Core/containers.tsp @@ -125,9 +125,6 @@ model ContainerPortProperties { @doc("Protocol in use by the port") protocol?: PortProtocol; - @doc("Specifies a route provided by this port") - provides?: string; - @doc("Specifies the URL scheme of the communication protocol. Consumers can use the scheme to construct a URL. The value defaults to 'http' or 'https' depending on the port value") scheme?: string; diff --git a/typespec/Applications.Core/examples/2023-10-01-preview/Gateways_CreateOrUpdate.json b/typespec/Applications.Core/examples/2023-10-01-preview/Gateways_CreateOrUpdate.json index 85796356d5..71fa5cf16b 100644 --- a/typespec/Applications.Core/examples/2023-10-01-preview/Gateways_CreateOrUpdate.json +++ b/typespec/Applications.Core/examples/2023-10-01-preview/Gateways_CreateOrUpdate.json @@ -11,7 +11,7 @@ "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", "routes":[ { - "destination": "/planes/radius/local/resourcegroups/myawsenv/providers/applications.core/httproutes/gtwy-front-rte" + "destination": "http://frontend" } ], "tls":{ @@ -34,7 +34,7 @@ "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", "routes":[ { - "destination": "/planes/radius/local/resourcegroups/myawsenv/providers/applications.core/httproutes/gtwy-front-rte" + "destination": "http://frontend" } ], "tls":{ diff --git a/typespec/Applications.Core/examples/2023-10-01-preview/Gateways_Get.json b/typespec/Applications.Core/examples/2023-10-01-preview/Gateways_Get.json index ccb96c7fc9..7b8a09b399 100644 --- a/typespec/Applications.Core/examples/2023-10-01-preview/Gateways_Get.json +++ b/typespec/Applications.Core/examples/2023-10-01-preview/Gateways_Get.json @@ -17,7 +17,7 @@ "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", "routes":[ { - "destination": "/planes/radius/local/resourcegroups/myawsenv/providers/applications.core/httproutes/gtwy-front-rte" + "destination": "http://frontend" } ], "tls":{ diff --git a/typespec/Applications.Core/examples/2023-10-01-preview/Gateways_List.json b/typespec/Applications.Core/examples/2023-10-01-preview/Gateways_List.json index 6e9e65c8ef..4a2c0e8e39 100644 --- a/typespec/Applications.Core/examples/2023-10-01-preview/Gateways_List.json +++ b/typespec/Applications.Core/examples/2023-10-01-preview/Gateways_List.json @@ -18,7 +18,7 @@ "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", "routes":[ { - "destination": "/planes/radius/local/resourcegroups/myawsenv/providers/applications.core/httproutes/gtwy-front-rte" + "destination": "http://frontend" } ], "tls":{ diff --git a/typespec/Applications.Core/examples/2023-10-01-preview/Gateways_ListByScope.json b/typespec/Applications.Core/examples/2023-10-01-preview/Gateways_ListByScope.json index 4e4798e5e4..225b186679 100644 --- a/typespec/Applications.Core/examples/2023-10-01-preview/Gateways_ListByScope.json +++ b/typespec/Applications.Core/examples/2023-10-01-preview/Gateways_ListByScope.json @@ -18,7 +18,7 @@ "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", "routes":[ { - "destination": "/planes/radius/local/resourcegroups/myawsenv/providers/applications.core/httproutes/gtwy-front-rte", + "destination": "http://frontend", "path":"/" } ], @@ -39,7 +39,7 @@ "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", "routes":[ { - "destination": "/planes/radius/local/resourcegroups/myawsenv/providers/applications.core/httproutes/gtwy-back-rte", + "destination": "http://frontend", "path":"/backend2" } ], diff --git a/typespec/Applications.Core/examples/2023-10-01-preview/Gateways_Update.json b/typespec/Applications.Core/examples/2023-10-01-preview/Gateways_Update.json index 39308fc4f7..a0906f47f1 100644 --- a/typespec/Applications.Core/examples/2023-10-01-preview/Gateways_Update.json +++ b/typespec/Applications.Core/examples/2023-10-01-preview/Gateways_Update.json @@ -11,7 +11,7 @@ "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", "routes":[ { - "destination": "/planes/radius/local/resourcegroups/myawsenv/providers/applications.core/httproutes/gtwy-front-rte" + "destination": "http://frontend" } ], "tls":{ @@ -34,7 +34,7 @@ "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", "routes":[ { - "destination": "/planes/radius/local/resourcegroups/myawsenv/providers/applications.core/httproutes/gtwy-front-rte" + "destination": "http://frontend" } ], "tls":{ diff --git a/typespec/Applications.Core/examples/2023-10-01-preview/HttpRoutes_CreateOrUpdate.json b/typespec/Applications.Core/examples/2023-10-01-preview/HttpRoutes_CreateOrUpdate.json deleted file mode 100644 index 43774c3686..0000000000 --- a/typespec/Applications.Core/examples/2023-10-01-preview/HttpRoutes_CreateOrUpdate.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "operationId": "HttpRoutes_CreateOrUpdate", - "title": "Create or Update httpRoutes resources", - "parameters": { - "rootScope": "/planes/radius/local/resourceGroups/testGroup", - "httpRouteName": "route0", - "api-version": "2023-10-01-preview", - "HttpRouteResource": { - "location": "West US", - "properties": { - "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" - } - } - }, - "responses": { - "200": { - "body": { - "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/httpRoutes/routes0", - "name": "routes0", - "type": "Applications.Core/httpRoutes", - "properties": { - "provisioningState": "Succeeded", - "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" - } - } - } - } -} diff --git a/typespec/Applications.Core/examples/2023-10-01-preview/HttpRoutes_Delete.json b/typespec/Applications.Core/examples/2023-10-01-preview/HttpRoutes_Delete.json deleted file mode 100644 index 18576a8128..0000000000 --- a/typespec/Applications.Core/examples/2023-10-01-preview/HttpRoutes_Delete.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "operationId": "HttpRoutes_Delete", - "title": "Delete a httpRoutes resource", - "parameters": { - "rootScope": "/planes/radius/local/resourceGroups/testGroup", - "httpRouteName": "route0", - "api-version": "2023-10-01-preview" - }, - "responses": { - "200": {}, - "202": {}, - "204": {} - } -} diff --git a/typespec/Applications.Core/examples/2023-10-01-preview/HttpRoutes_Get.json b/typespec/Applications.Core/examples/2023-10-01-preview/HttpRoutes_Get.json deleted file mode 100644 index a05a33f054..0000000000 --- a/typespec/Applications.Core/examples/2023-10-01-preview/HttpRoutes_Get.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "operationId": "HttpRoutes_Get", - "title": "Get a httpRoutes resource", - "parameters": { - "rootScope": "/planes/radius/local/resourceGroups/testGroup", - "api-version": "2023-10-01-preview", - "httpRouteName": "route0" - }, - "responses": { - "200": { - "body": { - "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/httpRoutes/route0", - "name": "route0", - "type": "Applications.Core/httpRoutes", - "properties": { - "provisioningState": "Succeeded", - "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" - } - } - } - } -} diff --git a/typespec/Applications.Core/examples/2023-10-01-preview/HttpRoutes_List.json b/typespec/Applications.Core/examples/2023-10-01-preview/HttpRoutes_List.json deleted file mode 100644 index ba6942a470..0000000000 --- a/typespec/Applications.Core/examples/2023-10-01-preview/HttpRoutes_List.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "operationId": "HttpRoutes_ListByScope", - "title": "List httpRoutes resources by resource group", - "parameters": { - "rootScope": "/planes/radius/local/resourceGroups/testGroup", - "api-version": "2023-10-01-preview" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/httpRoutes/route0", - "name": "route0", - "type": "Applications.Core/httpRoutes", - "properties": { - "provisioningState": "Succeeded", - "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" - } - }, - { - "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/httpRoutes/route1", - "name": "route1", - "type": "Applications.Core/httpRoutes", - "properties": { - "provisioningState": "Succeeded", - "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" - } - } - ], - "nextLink": "https://serviceRoot/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/httproutes?api-version=2023-10-01-preview&$skiptoken=X'12345'" - } - } - } -} diff --git a/typespec/Applications.Core/examples/2023-10-01-preview/HttpRoutes_ListByScope.json b/typespec/Applications.Core/examples/2023-10-01-preview/HttpRoutes_ListByScope.json deleted file mode 100644 index 7fa44644e9..0000000000 --- a/typespec/Applications.Core/examples/2023-10-01-preview/HttpRoutes_ListByScope.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "operationId": "HttpRoutes_ListByScope", - "title": "List httpRoutes resources by rootScope", - "parameters": { - "rootScope": "/planes/radius/local", - "api-version": "2023-10-01-preview" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/httpRoutes/route0", - "name": "route0", - "type": "Applications.Core/httpRoutes", - "properties": { - "provisioningState": "Succeeded", - "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" - } - }, - { - "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/httpRoutes/route1", - "name": "route1", - "type": "Applications.Core/httpRoutes", - "properties": { - "provisioningState": "Succeeded", - "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" - } - } - ], - "nextLink": "https://serviceRoot/planes/radius/local/providers/Applications.Core/httproutes?api-version=2023-10-01-preview&$skiptoken=X'12345'" - } - } - } -} diff --git a/typespec/Applications.Core/examples/2023-10-01-preview/HttpRoutes_Update.json b/typespec/Applications.Core/examples/2023-10-01-preview/HttpRoutes_Update.json deleted file mode 100644 index 78aa9a4126..0000000000 --- a/typespec/Applications.Core/examples/2023-10-01-preview/HttpRoutes_Update.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "operationId": "HttpRoutes_Update", - "title": "Update a httpRoutes resource", - "parameters": { - "rootScope": "/planes/radius/local/resourceGroups/testGroup", - "httpRouteName": "route0", - "api-version": "2023-10-01-preview", - "HttpRouteResource": { - "location": "West US", - "properties": { - "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" - } - } - }, - "responses": { - "200": { - "body": { - "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/httpRoutes/routes0", - "name": "routes0", - "type": "Applications.Core/httpRoutes", - "properties": { - "provisioningState": "Succeeded", - "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" - } - } - } - } -} diff --git a/typespec/Applications.Core/examples/2023-10-01-preview/Operations_List.json b/typespec/Applications.Core/examples/2023-10-01-preview/Operations_List.json index 298ccc6176..5c2888510a 100644 --- a/typespec/Applications.Core/examples/2023-10-01-preview/Operations_List.json +++ b/typespec/Applications.Core/examples/2023-10-01-preview/Operations_List.json @@ -118,36 +118,6 @@ "description": "Join to application." } }, - { - "name": "Applications.Core/httpRoutes/read", - "isDataAction": false, - "display": { - "provider": "Applications.Core", - "resource": "httpRoutes", - "operation": "Get/List HTTP Route", - "description": "Get or list of HTTP Routes." - } - }, - { - "name": "Applications.Core/httpRoutes/write", - "isDataAction": false, - "display": { - "provider": "Applications.Core", - "resource": "httpRoutes", - "operation": "Create/Update HTTP Route", - "description": "Create or update an HTTP Route." - } - }, - { - "name": "Applications.Core/httpRoutes/delete", - "isDataAction": false, - "display": { - "provider": "Applications.Core", - "resource": "httpRoutes", - "operation": "Delete HTTP Route", - "description": "Deletes an HTTP Route." - } - }, { "name": "Applications.Core/gateways/read", "isDataAction": false, diff --git a/typespec/Applications.Core/examples/2023-10-01-preview/Volumes_CreateOrUpdate.json b/typespec/Applications.Core/examples/2023-10-01-preview/Volumes_CreateOrUpdate.json index 39d41f1858..a27bd79cc7 100644 --- a/typespec/Applications.Core/examples/2023-10-01-preview/Volumes_CreateOrUpdate.json +++ b/typespec/Applications.Core/examples/2023-10-01-preview/Volumes_CreateOrUpdate.json @@ -5,7 +5,7 @@ "rootScope": "/planes/radius/local/resourceGroups/testGroup", "volumeName": "keyvault0", "api-version": "2023-10-01-preview", - "HttpRouteResource": { + "VolumeResource": { "location": "West US", "properties": { "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" diff --git a/typespec/Applications.Core/examples/2023-10-01-preview/Volumes_Update.json b/typespec/Applications.Core/examples/2023-10-01-preview/Volumes_Update.json index a8c25aa466..a510d20bd2 100644 --- a/typespec/Applications.Core/examples/2023-10-01-preview/Volumes_Update.json +++ b/typespec/Applications.Core/examples/2023-10-01-preview/Volumes_Update.json @@ -5,7 +5,7 @@ "rootScope": "/planes/radius/local/resourceGroups/testGroup", "volumeName": "keyvault0", "api-version": "2023-10-01-preview", - "HttpRouteResource": { + "VolumeResource": { "location": "West US", "properties": { "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" diff --git a/typespec/Applications.Core/gateways.tsp b/typespec/Applications.Core/gateways.tsp index b1968976a3..3140b3f022 100644 --- a/typespec/Applications.Core/gateways.tsp +++ b/typespec/Applications.Core/gateways.tsp @@ -102,7 +102,7 @@ model GatewayRoute { @doc("The path to match the incoming request path on. Ex - /myservice.") path?: string; - @doc("The HttpRoute to route to. Ex - myserviceroute.id.") + @doc("The URL or id of the service to route to. Ex - 'http://myservice'.") destination?: string; @doc("Optionally update the prefix when sending the request to the service. Ex - replacePrefix: '/' and path: '/myservice' will transform '/myservice/myroute' to '/myroute'") diff --git a/typespec/Applications.Core/httproutes.tsp b/typespec/Applications.Core/httproutes.tsp deleted file mode 100644 index 35fdaa2945..0000000000 --- a/typespec/Applications.Core/httproutes.tsp +++ /dev/null @@ -1,97 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import "@typespec/rest"; -import "@typespec/versioning"; -import "@typespec/openapi"; -import "@azure-tools/typespec-autorest"; -import "@azure-tools/typespec-azure-core"; -import "@azure-tools/typespec-azure-resource-manager"; -import "@azure-tools/typespec-providerhub"; - -import "../radius/v1/ucprootscope.tsp"; -import "../radius/v1/resources.tsp"; -import "./common.tsp"; -import "../radius/v1/trackedresource.tsp"; - -using TypeSpec.Http; -using TypeSpec.Rest; -using TypeSpec.Versioning; -using Autorest; -using Azure.Core; -using Azure.ResourceManager; -using OpenAPI; - -namespace Applications.Core; - -@doc("Radius HTTPRoute Resource.") -model HttpRouteResource is TrackedResourceRequired{ - @doc("HTTPRoute name") - @key("httpRouteName") - @path - @segment("httpRoutes") - name: ResourceNameString; -} - -@doc("HTTPRoute properties") -model HttpRouteProperties { - ...ApplicationScopedResource; - - @doc("The internal hostname accepting traffic for the HTTP Route. Readonly.") - hostname?: string; - - @doc("The port number for the HTTP Route. Defaults to 80. Readonly.") - port?: int32; - - @doc("The scheme used for traffic. Readonly.") - @visibility("read") - scheme?: string; - - @doc("A stable URL that that can be used to route traffic to a resource. Readonly.") - @visibility("read") - url?: string; -} - -@armResourceOperations -interface HttpRoutes { - get is ArmResourceRead< - HttpRouteResource, - UCPBaseParameters - >; - - createOrUpdate is ArmResourceCreateOrReplaceAsync< - HttpRouteResource, - UCPBaseParameters - >; - - update is ArmResourcePatchAsync< - HttpRouteResource, - HttpRouteProperties, - UCPBaseParameters - >; - - delete is ArmResourceDeleteAsync< - HttpRouteResource, - UCPBaseParameters - >; - - listByScope is ArmResourceListByParent< - HttpRouteResource, - UCPBaseParameters, - "Scope", - "Scope" - >; -} diff --git a/typespec/Applications.Core/main.tsp b/typespec/Applications.Core/main.tsp index 65fcd6adcd..22ffeb685f 100644 --- a/typespec/Applications.Core/main.tsp +++ b/typespec/Applications.Core/main.tsp @@ -21,7 +21,6 @@ import "./environments.tsp"; import "./applications.tsp"; import "./containers.tsp"; import "./gateways.tsp"; -import "./httproutes.tsp"; import "./secretstores.tsp"; import "./volumes.tsp"; import "./extenders.tsp";