diff --git a/eng/design-notes/recipes/2025-08-recipe-packs.md b/eng/design-notes/recipes/2025-08-recipe-packs.md index d59e6df360..769ad821c2 100644 --- a/eng/design-notes/recipes/2025-08-recipe-packs.md +++ b/eng/design-notes/recipes/2025-08-recipe-packs.md @@ -102,8 +102,8 @@ version: 1.0.0 description: "Recipe Pack for deploying to ACI in production." recipes: - resourceType: "Radius.Compute/containers@2025-05-01-preview" - recipeKind: "bicep" - recipeLocation: "oci://ghcr.io/my-org/recipes/core/aci-container:1.2.0" + kind: "bicep" + location: "oci://ghcr.io/my-org/recipes/core/aci-container:1.2.0" parameters: cpu: "1.0" memoryInGB: "2.0" @@ -112,13 +112,13 @@ recipes: # Optional: allow platform-specific options like containerGroupProfile for ACI allowPlatformOptions: true - resourceType: "Radius.Compute/gateways@2025-05-01-preview" - recipeKind: "bicep" - recipeLocation: "oci://ghcr.io/my-org/recipes/core/aci-gateway:1.1.0" + kind: "bicep" + location: "oci://ghcr.io/my-org/recipes/core/aci-gateway:1.1.0" parameters: sku: "Standard_v2" - resourceType: "Radius.Security/secrets@2025-05-01-preview" - recipeKind: "bicep" - recipeLocation: "oci://ghcr.io/my-org/recipes/azure/keyvault-secretstore:1.0.0" + kind: "bicep" + location: "oci://ghcr.io/my-org/recipes/azure/keyvault-secretstore:1.0.0" parameters: skuName: "premium" ``` @@ -197,13 +197,13 @@ recipes: Record; @doc("Recipe definition for a specific resource type") model RecipeDefinition { @doc("The type of recipe (e.g., terraform, bicep)") -recipeKind: RecipeKind; +kind: RecipeKind; @doc("Connect to the location using HTTP (not HTTPS). This should be used when the location is known not to support HTTPS, for example in a locally hosted registry for Bicep recipes. Defaults to false (use HTTPS/TLS)") plainHttp?: boolean; @doc("URL or path to the recipe source") -recipeLocation: string; +location: string; @doc("recipe digest in the format algorithm:digest_value") recipeDigest?: string; @@ -278,8 +278,8 @@ resource computeRecipePack 'Radius.Core/recipePacks@2026-01-01-preview' = { properties: { recipes: { 'Radius.Compute/containers': { - recipeKind: 'terraform' - recipeLocation: 'https://github.com/project-radius/resource-types-contrib.git//recipes/compute/containers/kubernetes?ref=v0.48' + kind: 'terraform' + location: 'https://github.com/project-radius/resource-types-contrib.git//recipes/compute/containers/kubernetes?ref=v0.48' recipeDigest: 'sha256:4g5h6i7j8k9l0m1n2o3p4q5r6s7t8u9v0w1x2y3z4a5b6c7d8e9f0g1h2i3j4k5' parameters: { allowPlatformOptions: true @@ -287,12 +287,12 @@ resource computeRecipePack 'Radius.Core/recipePacks@2026-01-01-preview' = { } } 'Radius.Security/secrets': { - recipeKind: 'terraform' - recipeLocation: 'https://github.com/project-radius/resource-types-contrib.git//recipes/security/secrets/kubernetes?ref=v0.48' + kind: 'terraform' + location: 'https://github.com/project-radius/resource-types-contrib.git//recipes/security/secrets/kubernetes?ref=v0.48' } 'Radius.Storage/volumes': { - recipeKind: 'terraform' - recipeLocation: 'https://github.com/project-radius/resource-types-contrib.git//recipes/storage/volumes/kubernetes?ref=v0.48' + kind: 'terraform' + location: 'https://github.com/project-radius/resource-types-contrib.git//recipes/storage/volumes/kubernetes?ref=v0.48' } } } @@ -325,16 +325,16 @@ curl -X PUT \ "description": "Test recipe pack with sample recipes", "recipes": { "Applications.Datastores/sqlDatabases": { - "recipeKind": "terraform", - "recipeLocation": "https://github.com/example/recipes/sql-database", + "kind": "terraform", + "location": "https://github.com/example/recipes/sql-database", "parameters": { "size": "small", "backup": false } }, "Applications.Datastores/redisCaches": { - "recipeKind": "bicep", - "recipeLocation": "https://github.com/example/recipes/redis-cache.bicep", + "kind": "bicep", + "location": "https://github.com/example/recipes/redis-cache.bicep", "parameters": { "tier": "basic" } @@ -359,16 +359,16 @@ CREATE response: "parameters": { "tier": "basic" }, - "recipeKind": "bicep", - "recipeLocation": "https://github.com/example/recipes/redis-cache.bicep" + "kind": "bicep", + "location": "https://github.com/example/recipes/redis-cache.bicep" }, "Applications.Datastores/sqlDatabases": { "parameters": { "backup": false, "size": "small" }, - "recipeKind": "terraform", - "recipeLocation": "https://github.com/example/recipes/sql-database" + "kind": "terraform", + "location": "https://github.com/example/recipes/sql-database" } } }, @@ -408,16 +408,16 @@ READ response: "parameters": { "tier": "basic" }, - "recipeKind": "bicep", - "recipeLocation": "https://github.com/example/recipes/redis-cache.bicep" + "kind": "bicep", + "location": "https://github.com/example/recipes/redis-cache.bicep" }, "Applications.Datastores/sqlDatabases": { "parameters": { "backup": false, "size": "small" }, - "recipeKind": "terraform", - "recipeLocation": "https://github.com/example/recipes/sql-database" + "kind": "terraform", + "location": "https://github.com/example/recipes/sql-database" } } }, @@ -524,19 +524,19 @@ resource computeRecipePack 'Radius.Core/recipePacks@2025-05-01-preview' = { properties: { recipes: { 'Radius.Compute/containers': { - recipeKind: 'terraform' - recipeLocation: 'https://github.com/project-radius/resource-types-contrib.git//recipes/compute/containers/kubernetes?ref=v0.48' + kind: 'terraform' + location: 'https://github.com/project-radius/resource-types-contrib.git//recipes/compute/containers/kubernetes?ref=v0.48' parameters: { allowPlatformOptions: true } } 'Radius.Security/secrets': { - recipeKind: 'terraform' - recipeLocation: 'https://github.com/project-radius/resource-types-contrib.git//recipes/security/secrets/kubernetes?ref=v0.48' + kind: 'terraform' + location: 'https://github.com/project-radius/resource-types-contrib.git//recipes/security/secrets/kubernetes?ref=v0.48' } 'Radius.Storage/volumes': { - recipeKind: 'terraform' - recipeLocation: 'https://github.com/project-radius/resource-types-contrib.git//recipes/storage/volumes/kubernetes?ref=v0.48' + kind: 'terraform' + location: 'https://github.com/project-radius/resource-types-contrib.git//recipes/storage/volumes/kubernetes?ref=v0.48' } } } diff --git a/hack/bicep-types-radius/generated/radius/radius.core/2025-08-01-preview/types.json b/hack/bicep-types-radius/generated/radius/radius.core/2025-08-01-preview/types.json index 796354f14f..e314a4c545 100644 --- a/hack/bicep-types-radius/generated/radius/radius.core/2025-08-01-preview/types.json +++ b/hack/bicep-types-radius/generated/radius/radius.core/2025-08-01-preview/types.json @@ -1278,7 +1278,7 @@ "$type": "ObjectType", "name": "RecipeDefinition", "properties": { - "recipeKind": { + "kind": { "type": { "$ref": "#/107" }, @@ -1292,7 +1292,7 @@ "flags": 0, "description": "Connect to the location using HTTP (not HTTPS). This should be used when the location is known not to support HTTPS, for example in a locally hosted registry for Bicep recipes. Defaults to false (use HTTPS/TLS)" }, - "recipeLocation": { + "location": { "type": { "$ref": "#/0" }, diff --git a/pkg/cli/cmd/env/show/preview/show.go b/pkg/cli/cmd/env/show/preview/show.go index 160cd26a6a..2f8b1818a4 100644 --- a/pkg/cli/cmd/env/show/preview/show.go +++ b/pkg/cli/cmd/env/show/preview/show.go @@ -68,10 +68,10 @@ rad env show my-env --group my-env } type EnvRecipes struct { - RecipePack string - ResourceType string - RecipeKind string - RecipeLocation string + RecipePack string + ResourceType string + Kind string + Location string } // Runner is the runner implementation for the `rad env show` preview command. @@ -189,10 +189,10 @@ func (r *Runner) Run(ctx context.Context) error { for resourceType, recipe := range pack.RecipePackResource.Properties.Recipes { envRecipes = append(envRecipes, EnvRecipes{ - RecipePack: ID.Name(), - ResourceType: resourceType, - RecipeKind: string(*recipe.RecipeKind), - RecipeLocation: *recipe.RecipeLocation, + RecipePack: ID.Name(), + ResourceType: resourceType, + Kind: string(*recipe.Kind), + Location: *recipe.Location, }) } } diff --git a/pkg/cli/cmd/env/show/preview/show_test.go b/pkg/cli/cmd/env/show/preview/show_test.go index 66df4adb05..1b2bd2caef 100644 --- a/pkg/cli/cmd/env/show/preview/show_test.go +++ b/pkg/cli/cmd/env/show/preview/show_test.go @@ -165,16 +165,16 @@ func Test_Run(t *testing.T) { Format: "table", Obj: []EnvRecipes{ { - RecipePack: "test-recipe-pack", - ResourceType: "test-recipe1", - RecipeKind: string(corerpv20250801.RecipeKindTerraform), - RecipeLocation: "https://example.com/recipe1?ref=v0.1", + RecipePack: "test-recipe-pack", + ResourceType: "test-recipe1", + Kind: string(corerpv20250801.RecipeKindTerraform), + Location: "https://example.com/recipe1?ref=v0.1", }, { - RecipePack: "test-recipe-pack", - ResourceType: "test-recipe2", - RecipeKind: string(corerpv20250801.RecipeKindTerraform), - RecipeLocation: "https://example.com/recipe2?ref=v0.1", + RecipePack: "test-recipe-pack", + ResourceType: "test-recipe2", + Kind: string(corerpv20250801.RecipeKindTerraform), + Location: "https://example.com/recipe2?ref=v0.1", }, }, Options: objectformats.GetRecipesForEnvironmentTableFormat(), @@ -243,23 +243,23 @@ func Test_Run_RecipeSortOrder(t *testing.T) { if recipePackName == "pack-a" { recipes = map[string]*corerpv20250801.RecipeDefinition{ "Applications.Datastores/sqlDatabases": { - RecipeLocation: new("ghcr.io/radius-project/recipes/sql"), - RecipeKind: to.Ptr(corerpv20250801.RecipeKindTerraform), + Location: new("ghcr.io/radius-project/recipes/sql"), + Kind: to.Ptr(corerpv20250801.RecipeKindTerraform), }, "Applications.Datastores/redisCaches": { - RecipeLocation: new("ghcr.io/radius-project/recipes/redis"), - RecipeKind: to.Ptr(corerpv20250801.RecipeKindTerraform), + Location: new("ghcr.io/radius-project/recipes/redis"), + Kind: to.Ptr(corerpv20250801.RecipeKindTerraform), }, } } else { recipes = map[string]*corerpv20250801.RecipeDefinition{ "Applications.Messaging/rabbitMQQueues": { - RecipeLocation: new("ghcr.io/radius-project/recipes/rabbitmq"), - RecipeKind: to.Ptr(corerpv20250801.RecipeKindBicep), + Location: new("ghcr.io/radius-project/recipes/rabbitmq"), + Kind: to.Ptr(corerpv20250801.RecipeKindBicep), }, "Applications.Dapr/stateStores": { - RecipeLocation: new("ghcr.io/radius-project/recipes/dapr-state"), - RecipeKind: to.Ptr(corerpv20250801.RecipeKindBicep), + Location: new("ghcr.io/radius-project/recipes/dapr-state"), + Kind: to.Ptr(corerpv20250801.RecipeKindBicep), }, } } @@ -294,10 +294,10 @@ func Test_Run_RecipeSortOrder(t *testing.T) { // Verify the recipes are sorted by RecipePack first, then by ResourceType expectedRecipes := []EnvRecipes{ - {RecipePack: "pack-a", ResourceType: "Applications.Datastores/redisCaches", RecipeKind: "terraform", RecipeLocation: "ghcr.io/radius-project/recipes/redis"}, - {RecipePack: "pack-a", ResourceType: "Applications.Datastores/sqlDatabases", RecipeKind: "terraform", RecipeLocation: "ghcr.io/radius-project/recipes/sql"}, - {RecipePack: "pack-b", ResourceType: "Applications.Dapr/stateStores", RecipeKind: "bicep", RecipeLocation: "ghcr.io/radius-project/recipes/dapr-state"}, - {RecipePack: "pack-b", ResourceType: "Applications.Messaging/rabbitMQQueues", RecipeKind: "bicep", RecipeLocation: "ghcr.io/radius-project/recipes/rabbitmq"}, + {RecipePack: "pack-a", ResourceType: "Applications.Datastores/redisCaches", Kind: "terraform", Location: "ghcr.io/radius-project/recipes/redis"}, + {RecipePack: "pack-a", ResourceType: "Applications.Datastores/sqlDatabases", Kind: "terraform", Location: "ghcr.io/radius-project/recipes/sql"}, + {RecipePack: "pack-b", ResourceType: "Applications.Dapr/stateStores", Kind: "bicep", Location: "ghcr.io/radius-project/recipes/dapr-state"}, + {RecipePack: "pack-b", ResourceType: "Applications.Messaging/rabbitMQQueues", Kind: "bicep", Location: "ghcr.io/radius-project/recipes/rabbitmq"}, } // The third output should be the recipes table diff --git a/pkg/cli/cmd/recipepack/show/display.go b/pkg/cli/cmd/recipepack/show/display.go index 5f6d949d64..f8b7c132d7 100644 --- a/pkg/cli/cmd/recipepack/show/display.go +++ b/pkg/cli/cmd/recipepack/show/display.go @@ -47,13 +47,13 @@ func (r *Runner) display(recipePack v20250801preview.RecipePackResource) error { } kind := "unknown" - if definition.RecipeKind != nil { - kind = string(*definition.RecipeKind) + if definition.Kind != nil { + kind = string(*definition.Kind) } location := "" - if definition.RecipeLocation != nil { - location = *definition.RecipeLocation + if definition.Location != nil { + location = *definition.Location } r.Output.LogInfo("%s", resourceType) diff --git a/pkg/cli/cmd/recipepack/show/show_test.go b/pkg/cli/cmd/recipepack/show/show_test.go index 224b4ebfc4..b653c61d6d 100644 --- a/pkg/cli/cmd/recipepack/show/show_test.go +++ b/pkg/cli/cmd/recipepack/show/show_test.go @@ -88,8 +88,8 @@ func Test_Run(t *testing.T) { Properties: &corerpv20250801preview.RecipePackProperties{ Recipes: map[string]*corerpv20250801preview.RecipeDefinition{ "Radius.Core/example": { - RecipeKind: to.Ptr(corerpv20250801preview.RecipeKindTerraform), - RecipeLocation: new("https://github.com/radius-project/example"), + Kind: to.Ptr(corerpv20250801preview.RecipeKindTerraform), + Location: new("https://github.com/radius-project/example"), Parameters: map[string]any{ "foo": "bar", }, diff --git a/pkg/cli/objectformats/objectformats.go b/pkg/cli/objectformats/objectformats.go index 16ae8233a1..2953ba8ca1 100644 --- a/pkg/cli/objectformats/objectformats.go +++ b/pkg/cli/objectformats/objectformats.go @@ -70,12 +70,12 @@ func GetRecipeFormat() output.FormatterOptions { JSONPath: "{ .ResourceType }", }, { - Heading: "RECIPE KIND", - JSONPath: "{ .RecipeKind }", + Heading: "KIND", + JSONPath: "{ .Kind }", }, { - Heading: "RECIPE LOCATION", - JSONPath: "{ .RecipeLocation }", + Heading: "LOCATION", + JSONPath: "{ .Location }", }, }, } @@ -90,11 +90,11 @@ func GetRecipeFormatWithoutHeadings() output.FormatterOptions { }, { Heading: "", - JSONPath: "{ .RecipeKind }", + JSONPath: "{ .Kind }", }, { Heading: "", - JSONPath: "{ .RecipeLocation }", + JSONPath: "{ .Location }", }, }, } @@ -140,12 +140,12 @@ func GetRecipesForEnvironmentTableFormat() output.FormatterOptions { JSONPath: "{ .ResourceType }", }, { - Heading: "RECIPE KIND", - JSONPath: "{ .RecipeKind }", + Heading: "KIND", + JSONPath: "{ .Kind }", }, { - Heading: "RECIPE LOCATION", - JSONPath: "{ .RecipeLocation }", + Heading: "LOCATION", + JSONPath: "{ .Location }", }, }, } diff --git a/pkg/cli/recipepack/recipepack.go b/pkg/cli/recipepack/recipepack.go index 862dbb3a6d..5ce9f16b1d 100644 --- a/pkg/cli/recipepack/recipepack.go +++ b/pkg/cli/recipepack/recipepack.go @@ -54,8 +54,8 @@ func NewDefaultRecipePackResource() corerpv20250801.RecipePackResource { recipes := make(map[string]*corerpv20250801.RecipeDefinition) for _, def := range GetCoreTypesRecipeInfo() { recipes[def.ResourceType] = &corerpv20250801.RecipeDefinition{ - RecipeKind: &bicepKind, - RecipeLocation: to.Ptr(def.RecipeLocation), + Kind: &bicepKind, + Location: to.Ptr(def.Location), } } return corerpv20250801.RecipePackResource{ @@ -110,8 +110,8 @@ func GetOrCreateDefaultRecipePack(ctx context.Context, client *corerpv20250801.R type CoreTypesRecipeInfo struct { // ResourceType is the full resource type (e.g., "Radius.Compute/containers"). ResourceType string - // RecipeLocation is the OCI registry location for the recipe. - RecipeLocation string + // Location is the OCI registry location for the recipe. + Location string } // GetCoreTypesRecipeInfo returns recipe information for all core types. @@ -124,20 +124,20 @@ func GetCoreTypesRecipeInfo() []CoreTypesRecipeInfo { } return []CoreTypesRecipeInfo{ { - ResourceType: "Radius.Compute/containers", - RecipeLocation: "ghcr.io/radius-project/kube-recipes/containers:" + tag, + ResourceType: "Radius.Compute/containers", + Location: "ghcr.io/radius-project/kube-recipes/containers:" + tag, }, { - ResourceType: "Radius.Compute/persistentVolumes", - RecipeLocation: "ghcr.io/radius-project/kube-recipes/persistentvolumes:" + tag, + ResourceType: "Radius.Compute/persistentVolumes", + Location: "ghcr.io/radius-project/kube-recipes/persistentvolumes:" + tag, }, { - ResourceType: "Radius.Compute/routes", - RecipeLocation: "ghcr.io/radius-project/kube-recipes/routes:" + tag, + ResourceType: "Radius.Compute/routes", + Location: "ghcr.io/radius-project/kube-recipes/routes:" + tag, }, { - ResourceType: "Radius.Security/secrets", - RecipeLocation: "ghcr.io/radius-project/kube-recipes/secrets:" + tag, + ResourceType: "Radius.Security/secrets", + Location: "ghcr.io/radius-project/kube-recipes/secrets:" + tag, }, { ResourceType: "Radius.Data/mySqlDatabases", diff --git a/pkg/cli/recipepack/recipepack_test.go b/pkg/cli/recipepack/recipepack_test.go index 403d5ccf32..59660d3d75 100644 --- a/pkg/cli/recipepack/recipepack_test.go +++ b/pkg/cli/recipepack/recipepack_test.go @@ -42,7 +42,7 @@ func Test_GetDefaultRecipePackDefinition(t *testing.T) { actualResourceTypes := make([]string, len(definitions)) for i, def := range definitions { actualResourceTypes[i] = def.ResourceType - require.NotEmpty(t, def.RecipeLocation, "RecipeLocation should not be empty for %s", def.ResourceType) + require.NotEmpty(t, def.Location, "Location should not be empty for %s", def.ResourceType) } require.ElementsMatch(t, expectedResourceTypes, actualResourceTypes) } @@ -53,8 +53,8 @@ func Test_GetDefaultRecipePackDefinition_UsesLatestTagForEdgeChannel(t *testing. definitions := GetCoreTypesRecipeInfo() for _, def := range definitions { - require.True(t, strings.HasSuffix(def.RecipeLocation, ":latest"), - "Expected :latest tag for edge channel, got %s", def.RecipeLocation) + require.True(t, strings.HasSuffix(def.Location, ":latest"), + "Expected :latest tag for edge channel, got %s", def.Location) } } @@ -76,9 +76,9 @@ func Test_NewDefaultRecipePackResource(t *testing.T) { for _, def := range definitions { recipe, exists := resource.Properties.Recipes[def.ResourceType] require.True(t, exists, "Expected recipe for resource type %s to exist", def.ResourceType) - require.NotNil(t, recipe.RecipeKind) - require.Equal(t, corerpv20250801.RecipeKindBicep, *recipe.RecipeKind) - require.NotNil(t, recipe.RecipeLocation) - require.Equal(t, def.RecipeLocation, *recipe.RecipeLocation) + require.NotNil(t, recipe.Kind) + require.Equal(t, corerpv20250801.RecipeKindBicep, *recipe.Kind) + require.NotNil(t, recipe.Location) + require.Equal(t, def.Location, *recipe.Location) } } diff --git a/pkg/cli/test_client_factory/radius_core.go b/pkg/cli/test_client_factory/radius_core.go index 43c86098f4..f35e3d3a61 100644 --- a/pkg/cli/test_client_factory/radius_core.go +++ b/pkg/cli/test_client_factory/radius_core.go @@ -69,12 +69,12 @@ func WithRecipePackServerNoError() corerpfake.RecipePacksServer { Properties: &v20250801preview.RecipePackProperties{ Recipes: map[string]*v20250801preview.RecipeDefinition{ "test-recipe1": { - RecipeLocation: new("https://example.com/recipe1?ref=v0.1"), - RecipeKind: to.Ptr(v20250801preview.RecipeKindTerraform), + Location: new("https://example.com/recipe1?ref=v0.1"), + Kind: to.Ptr(v20250801preview.RecipeKindTerraform), }, "test-recipe2": { - RecipeLocation: new("https://example.com/recipe2?ref=v0.1"), - RecipeKind: to.Ptr(v20250801preview.RecipeKindTerraform), + Location: new("https://example.com/recipe2?ref=v0.1"), + Kind: to.Ptr(v20250801preview.RecipeKindTerraform), }, }, }, @@ -300,8 +300,8 @@ func WithRecipePackServerCoreTypes() corerpfake.RecipePacksServer { Properties: &v20250801preview.RecipePackProperties{ Recipes: map[string]*v20250801preview.RecipeDefinition{ resourceType: { - RecipeLocation: to.Ptr("ghcr.io/test/" + recipePackName + ":latest"), - RecipeKind: &bicepKind, + Location: to.Ptr("ghcr.io/test/" + recipePackName + ":latest"), + Kind: &bicepKind, }, }, }, @@ -335,8 +335,8 @@ func WithRecipePackServerUniqueTypes() corerpfake.RecipePacksServer { Properties: &v20250801preview.RecipePackProperties{ Recipes: map[string]*v20250801preview.RecipeDefinition{ "Test.Resource/" + recipePackName: { - RecipeLocation: to.Ptr("ghcr.io/test/" + recipePackName + ":latest"), - RecipeKind: &bicepKind, + Location: to.Ptr("ghcr.io/test/" + recipePackName + ":latest"), + Kind: &bicepKind, }, }, }, @@ -393,8 +393,8 @@ func WithRecipePackServerConflictingTypes() corerpfake.RecipePacksServer { Properties: &v20250801preview.RecipePackProperties{ Recipes: map[string]*v20250801preview.RecipeDefinition{ "Radius.Compute/containers": { - RecipeLocation: to.Ptr("ghcr.io/test/" + recipePackName + ":latest"), - RecipeKind: &bicepKind, + Location: to.Ptr("ghcr.io/test/" + recipePackName + ":latest"), + Kind: &bicepKind, }, }, }, diff --git a/pkg/cli/test_client_factory/radius_core_test.go b/pkg/cli/test_client_factory/radius_core_test.go new file mode 100644 index 0000000000..87de66a456 --- /dev/null +++ b/pkg/cli/test_client_factory/radius_core_test.go @@ -0,0 +1,93 @@ +/* +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 test_client_factory + +import ( + "context" + "testing" + + armpolicy "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/radius-project/radius/pkg/corerp/api/v20250801preview" + corerpfake "github.com/radius-project/radius/pkg/corerp/api/v20250801preview/fake" + aztoken "github.com/radius-project/radius/pkg/azure/tokencredentials" + "github.com/stretchr/testify/require" +) + +func newTestClient(t *testing.T, rpSrv corerpfake.RecipePacksServer) *v20250801preview.RecipePacksClient { + t.Helper() + opts := &armpolicy.ClientOptions{ + ClientOptions: policy.ClientOptions{ + Transport: corerpfake.NewServerFactoryTransport(&corerpfake.ServerFactory{ + RecipePacksServer: rpSrv, + }), + }, + } + client, err := v20250801preview.NewRecipePacksClient("/planes/radius/local/resourceGroups/test-rg", &aztoken.AnonymousCredential{}, opts) + require.NoError(t, err) + return client +} + +func TestWithRecipePackServerNoError_Get(t *testing.T) { + client := newTestClient(t, WithRecipePackServerNoError()) + + resp, err := client.Get(context.Background(), "my-pack", nil) + require.NoError(t, err) + require.Equal(t, "my-pack", *resp.Name) + require.Len(t, resp.Properties.Recipes, 2) + require.Equal(t, v20250801preview.RecipeKindTerraform, *resp.Properties.Recipes["test-recipe1"].Kind) + require.Equal(t, "https://example.com/recipe1?ref=v0.1", *resp.Properties.Recipes["test-recipe1"].Location) + require.Equal(t, v20250801preview.RecipeKindTerraform, *resp.Properties.Recipes["test-recipe2"].Kind) + require.Equal(t, "https://example.com/recipe2?ref=v0.1", *resp.Properties.Recipes["test-recipe2"].Location) +} + +func TestWithRecipePackServerCoreTypes_Get(t *testing.T) { + client := newTestClient(t, WithRecipePackServerCoreTypes()) + + resp, err := client.Get(context.Background(), "containers", nil) + require.NoError(t, err) + require.Equal(t, "containers", *resp.Name) + + recipe := resp.Properties.Recipes["Radius.Compute/containers"] + require.NotNil(t, recipe) + require.Equal(t, v20250801preview.RecipeKindBicep, *recipe.Kind) + require.Equal(t, "ghcr.io/test/containers:latest", *recipe.Location) +} + +func TestWithRecipePackServerUniqueTypes_Get(t *testing.T) { + client := newTestClient(t, WithRecipePackServerUniqueTypes()) + + resp, err := client.Get(context.Background(), "mypack", nil) + require.NoError(t, err) + + recipe := resp.Properties.Recipes["Test.Resource/mypack"] + require.NotNil(t, recipe) + require.Equal(t, v20250801preview.RecipeKindBicep, *recipe.Kind) + require.Equal(t, "ghcr.io/test/mypack:latest", *recipe.Location) +} + +func TestWithRecipePackServerConflictingTypes_Get(t *testing.T) { + client := newTestClient(t, WithRecipePackServerConflictingTypes()) + + resp, err := client.Get(context.Background(), "pack-a", nil) + require.NoError(t, err) + + recipe := resp.Properties.Recipes["Radius.Compute/containers"] + require.NotNil(t, recipe) + require.Equal(t, v20250801preview.RecipeKindBicep, *recipe.Kind) + require.Equal(t, "ghcr.io/test/pack-a:latest", *recipe.Location) +} diff --git a/pkg/corerp/api/v20250801preview/recipepack_conversion.go b/pkg/corerp/api/v20250801preview/recipepack_conversion.go index a740e48111..2b3ca9ff3e 100644 --- a/pkg/corerp/api/v20250801preview/recipepack_conversion.go +++ b/pkg/corerp/api/v20250801preview/recipepack_conversion.go @@ -95,8 +95,8 @@ func toRecipesDataModel(recipes map[string]*RecipeDefinition) map[string]*datamo for key, recipe := range recipes { if recipe != nil { result[key] = &datamodel.RecipeDefinition{ - RecipeKind: toRecipeKindDataModel(recipe.RecipeKind), - RecipeLocation: to.String(recipe.RecipeLocation), + Kind: toRecipeKindDataModel(recipe.Kind), + Location: to.String(recipe.Location), Parameters: recipe.Parameters, PlainHTTP: to.Bool(recipe.PlainHTTP), } @@ -114,10 +114,10 @@ func fromRecipesDataModel(recipes map[string]*datamodel.RecipeDefinition) map[st for key, recipe := range recipes { if recipe != nil { result[key] = &RecipeDefinition{ - RecipeKind: fromRecipeKindDataModel(recipe.RecipeKind), - RecipeLocation: new(recipe.RecipeLocation), - Parameters: recipe.Parameters, - PlainHTTP: new(recipe.PlainHTTP), + Kind: fromRecipeKindDataModel(recipe.Kind), + Location: new(recipe.Location), + Parameters: recipe.Parameters, + PlainHTTP: new(recipe.PlainHTTP), } } } diff --git a/pkg/corerp/api/v20250801preview/testdata/recipepackresource.json b/pkg/corerp/api/v20250801preview/testdata/recipepackresource.json index ec91d1f7b9..2d32584a04 100644 --- a/pkg/corerp/api/v20250801preview/testdata/recipepackresource.json +++ b/pkg/corerp/api/v20250801preview/testdata/recipepackresource.json @@ -15,8 +15,8 @@ ], "recipes": { "Applications.Core/containers": { - "recipeKind": "Bicep", - "recipeLocation": "br:ghcr.io/radius-project/recipes/kubernetes-container:latest", + "kind": "Bicep", + "location": "br:ghcr.io/radius-project/recipes/kubernetes-container:latest", "parameters": { "port": 8080, "replicas": 3 @@ -24,8 +24,8 @@ "plainHTTP": false }, "Applications.Dapr/stateStores": { - "recipeKind": "Terraform", - "recipeLocation": "oci://ghcr.io/radius-project/recipes/terraform/redis:latest", + "kind": "Terraform", + "location": "oci://ghcr.io/radius-project/recipes/terraform/redis:latest", "parameters": { "size": "small" }, diff --git a/pkg/corerp/api/v20250801preview/testdata/recipepackresourcedatamodel.json b/pkg/corerp/api/v20250801preview/testdata/recipepackresourcedatamodel.json index 30526b1ad2..502972e236 100644 --- a/pkg/corerp/api/v20250801preview/testdata/recipepackresourcedatamodel.json +++ b/pkg/corerp/api/v20250801preview/testdata/recipepackresourcedatamodel.json @@ -27,8 +27,8 @@ ], "recipes": { "Applications.Core/containers": { - "recipeKind": "Bicep", - "recipeLocation": "br:ghcr.io/radius-project/recipes/kubernetes-container:latest", + "kind": "Bicep", + "location": "br:ghcr.io/radius-project/recipes/kubernetes-container:latest", "parameters": { "port": 8080, "replicas": 3 @@ -36,8 +36,8 @@ "plainHTTP": false }, "Applications.Dapr/stateStores": { - "recipeKind": "Terraform", - "recipeLocation": "oci://ghcr.io/radius-project/recipes/terraform/redis:latest", + "kind": "Terraform", + "location": "oci://ghcr.io/radius-project/recipes/terraform/redis:latest", "parameters": { "size": "small" }, diff --git a/pkg/corerp/api/v20250801preview/zz_generated_models.go b/pkg/corerp/api/v20250801preview/zz_generated_models.go index 59ac28007a..71b7514fae 100644 --- a/pkg/corerp/api/v20250801preview/zz_generated_models.go +++ b/pkg/corerp/api/v20250801preview/zz_generated_models.go @@ -511,10 +511,10 @@ type ProvidersKubernetes struct { // RecipeDefinition - Recipe definition for a specific resource type type RecipeDefinition struct { // REQUIRED; The type of recipe (e.g., Terraform, Bicep) - RecipeKind *RecipeKind + Kind *RecipeKind // REQUIRED; URL path to the recipe - RecipeLocation *string + Location *string // Parameters to pass to the recipe Parameters map[string]any diff --git a/pkg/corerp/api/v20250801preview/zz_generated_models_serde.go b/pkg/corerp/api/v20250801preview/zz_generated_models_serde.go index 56c61146d2..363fc8dc69 100644 --- a/pkg/corerp/api/v20250801preview/zz_generated_models_serde.go +++ b/pkg/corerp/api/v20250801preview/zz_generated_models_serde.go @@ -1265,10 +1265,10 @@ func (p *ProvidersKubernetes) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RecipeDefinition. func (r RecipeDefinition) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "kind", r.Kind) + populate(objectMap, "location", r.Location) populate(objectMap, "parameters", r.Parameters) populate(objectMap, "plainHttp", r.PlainHTTP) - populate(objectMap, "recipeKind", r.RecipeKind) - populate(objectMap, "recipeLocation", r.RecipeLocation) return json.Marshal(objectMap) } @@ -1281,18 +1281,18 @@ func (r *RecipeDefinition) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "kind": + err = unpopulate(val, "Kind", &r.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &r.Location) + delete(rawMsg, key) case "parameters": err = unpopulate(val, "Parameters", &r.Parameters) delete(rawMsg, key) case "plainHttp": err = unpopulate(val, "PlainHTTP", &r.PlainHTTP) delete(rawMsg, key) - case "recipeKind": - err = unpopulate(val, "RecipeKind", &r.RecipeKind) - delete(rawMsg, key) - case "recipeLocation": - err = unpopulate(val, "RecipeLocation", &r.RecipeLocation) - delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) diff --git a/pkg/corerp/datamodel/converter/recipepack_converter_test.go b/pkg/corerp/datamodel/converter/recipepack_converter_test.go index 3bf535cde4..9bdb9c0c0b 100644 --- a/pkg/corerp/datamodel/converter/recipepack_converter_test.go +++ b/pkg/corerp/datamodel/converter/recipepack_converter_test.go @@ -58,16 +58,16 @@ func TestRecipePackDataModelToVersioned(t *testing.T) { Properties: datamodel.RecipePackProperties{ Recipes: map[string]*datamodel.RecipeDefinition{ "Applications.Core/containers": { - RecipeKind: "bicep", - RecipeLocation: "br:myregistry.azurecr.io/recipes/container:1.0", + Kind: "bicep", + Location: "br:myregistry.azurecr.io/recipes/container:1.0", Parameters: map[string]any{ "param1": "value1", }, PlainHTTP: false, }, "Applications.Datastores/sqlDatabases": { - RecipeKind: "terraform", - RecipeLocation: "https://github.com/radius-project/recipes.git//terraform/modules/sql", + Kind: "terraform", + Location: "https://github.com/radius-project/recipes.git//terraform/modules/sql", PlainHTTP: false, }, }, @@ -162,16 +162,16 @@ func TestRecipePackDataModelFromVersioned(t *testing.T) { "properties": { "recipes": { "Applications.Core/containers": { - "recipeKind": "bicep", - "recipeLocation": "br:myregistry.azurecr.io/recipes/container:1.0", + "kind": "bicep", + "location": "br:myregistry.azurecr.io/recipes/container:1.0", "parameters": { "param1": "value1" }, - "plainHTTP": false + "plainHttp": false }, "Applications.Datastores/sqlDatabases": { - "recipeKind": "terraform", - "recipeLocation": "https://github.com/radius-project/recipes.git//terraform/modules/sql" + "kind": "terraform", + "location": "https://github.com/radius-project/recipes.git//terraform/modules/sql" } }, "referencedBy": [ @@ -203,16 +203,16 @@ func TestRecipePackDataModelFromVersioned(t *testing.T) { Properties: datamodel.RecipePackProperties{ Recipes: map[string]*datamodel.RecipeDefinition{ "Applications.Core/containers": { - RecipeKind: "bicep", - RecipeLocation: "br:myregistry.azurecr.io/recipes/container:1.0", + Kind: "bicep", + Location: "br:myregistry.azurecr.io/recipes/container:1.0", Parameters: map[string]any{ "param1": "value1", }, PlainHTTP: false, }, "Applications.Datastores/sqlDatabases": { - RecipeKind: "terraform", - RecipeLocation: "https://github.com/radius-project/recipes.git//terraform/modules/sql", + Kind: "terraform", + Location: "https://github.com/radius-project/recipes.git//terraform/modules/sql", PlainHTTP: false, }, }, @@ -260,8 +260,8 @@ func TestRecipePackDataModelFromVersioned(t *testing.T) { "properties": { "recipes": { "Applications.Core/containers": { - "recipeKind": "bicep", - "recipeLocation": "br:myregistry.azurecr.io/recipes/container:1.0" + "kind": "bicep", + "location": "br:myregistry.azurecr.io/recipes/container:1.0" } } } @@ -284,8 +284,8 @@ func TestRecipePackDataModelFromVersioned(t *testing.T) { Properties: datamodel.RecipePackProperties{ Recipes: map[string]*datamodel.RecipeDefinition{ "Applications.Core/containers": { - RecipeKind: "bicep", - RecipeLocation: "br:myregistry.azurecr.io/recipes/container:1.0", + Kind: "bicep", + Location: "br:myregistry.azurecr.io/recipes/container:1.0", PlainHTTP: false, // Should default to false when not specified }, }, @@ -302,8 +302,8 @@ func TestRecipePackDataModelFromVersioned(t *testing.T) { "properties": { "recipes": { "Applications.Datastores/sqlDatabases": { - "recipeKind": "terraform", - "recipeLocation": "http://insecure-registry.example.com/recipes/sql", + "kind": "terraform", + "location": "http://insecure-registry.example.com/recipes/sql", "plainHttp": true } } @@ -327,8 +327,8 @@ func TestRecipePackDataModelFromVersioned(t *testing.T) { Properties: datamodel.RecipePackProperties{ Recipes: map[string]*datamodel.RecipeDefinition{ "Applications.Datastores/sqlDatabases": { - RecipeKind: "terraform", - RecipeLocation: "http://insecure-registry.example.com/recipes/sql", + Kind: "terraform", + Location: "http://insecure-registry.example.com/recipes/sql", PlainHTTP: true, // Explicitly set to true }, }, @@ -386,8 +386,8 @@ func TestRecipePackDataModelFromVersioned(t *testing.T) { for key, expectedRecipe := range tc.expected.Properties.Recipes { actualRecipe, exists := result.Properties.Recipes[key] require.True(t, exists, "Recipe %s should exist", key) - require.Equal(t, expectedRecipe.RecipeKind, actualRecipe.RecipeKind) - require.Equal(t, expectedRecipe.RecipeLocation, actualRecipe.RecipeLocation) + require.Equal(t, expectedRecipe.Kind, actualRecipe.Kind) + require.Equal(t, expectedRecipe.Location, actualRecipe.Location) // Debug output for plainHTTP t.Logf("Recipe %s - Expected PlainHTTP: %v, Actual PlainHTTP: %v", key, expectedRecipe.PlainHTTP, actualRecipe.PlainHTTP) @@ -426,8 +426,8 @@ func TestRecipePackRoundTripConversion(t *testing.T) { Properties: datamodel.RecipePackProperties{ Recipes: map[string]*datamodel.RecipeDefinition{ "Applications.Core/containers": { - RecipeKind: "bicep", - RecipeLocation: "br:test.azurecr.io/recipes/container:latest", + Kind: "bicep", + Location: "br:test.azurecr.io/recipes/container:latest", Parameters: map[string]any{ "cpu": "0.5", "memory": "1Gi", @@ -468,8 +468,8 @@ func TestRecipePackRoundTripConversion(t *testing.T) { for key, originalRecipe := range originalDataModel.Properties.Recipes { resultRecipe, exists := resultDataModel.Properties.Recipes[key] require.True(t, exists, "Recipe %s should exist after round-trip", key) - require.Equal(t, originalRecipe.RecipeKind, resultRecipe.RecipeKind) - require.Equal(t, originalRecipe.RecipeLocation, resultRecipe.RecipeLocation) + require.Equal(t, originalRecipe.Kind, resultRecipe.Kind) + require.Equal(t, originalRecipe.Location, resultRecipe.Location) require.Equal(t, originalRecipe.PlainHTTP, resultRecipe.PlainHTTP) require.Equal(t, originalRecipe.Parameters, resultRecipe.Parameters) } diff --git a/pkg/corerp/datamodel/recipepack.go b/pkg/corerp/datamodel/recipepack.go index 7ab6c4c89a..e326fff9b7 100644 --- a/pkg/corerp/datamodel/recipepack.go +++ b/pkg/corerp/datamodel/recipepack.go @@ -49,11 +49,11 @@ type RecipePackProperties struct { // RecipeDefinition represents a recipe definition in the datamodel. type RecipeDefinition struct { - // RecipeKind is the type of recipe (e.g., terraform, bicep). - RecipeKind string `json:"recipeKind"` + // Kind is the type of recipe (e.g., terraform, bicep). + Kind string `json:"kind"` - // RecipeLocation is the URL or path to the recipe source. - RecipeLocation string `json:"recipeLocation"` + // Location is the URL or path to the recipe source. + Location string `json:"location"` // Parameters to pass to the recipe. Parameters map[string]any `json:"parameters,omitempty"` diff --git a/pkg/corerp/frontend/controller/environments/v20250801preview/createorupdateenvironment_test.go b/pkg/corerp/frontend/controller/environments/v20250801preview/createorupdateenvironment_test.go index 47dd13f543..efa0cdbbd1 100644 --- a/pkg/corerp/frontend/controller/environments/v20250801preview/createorupdateenvironment_test.go +++ b/pkg/corerp/frontend/controller/environments/v20250801preview/createorupdateenvironment_test.go @@ -378,8 +378,8 @@ func TestCreateOrUpdateEnvironment_RecipePackValidation(t *testing.T) { Properties: datamodel.RecipePackProperties{ Recipes: map[string]*datamodel.RecipeDefinition{ "Applications.Core/containers": { - RecipeKind: "bicep", - RecipeLocation: "br:myregistry.azurecr.io/recipes/container:1.0", + Kind: "bicep", + Location: "br:myregistry.azurecr.io/recipes/container:1.0", }, }, }, @@ -388,8 +388,8 @@ func TestCreateOrUpdateEnvironment_RecipePackValidation(t *testing.T) { Properties: datamodel.RecipePackProperties{ Recipes: map[string]*datamodel.RecipeDefinition{ "Applications.Dapr/stateStores": { - RecipeKind: "terraform", - RecipeLocation: "git::https://github.com/recipes/dapr-state", + Kind: "terraform", + Location: "git::https://github.com/recipes/dapr-state", }, }, }, @@ -413,8 +413,8 @@ func TestCreateOrUpdateEnvironment_RecipePackValidation(t *testing.T) { Properties: datamodel.RecipePackProperties{ Recipes: map[string]*datamodel.RecipeDefinition{ "Applications.Core/containers": { - RecipeKind: "bicep", - RecipeLocation: "br:myregistry.azurecr.io/recipes/container:1.0", + Kind: "bicep", + Location: "br:myregistry.azurecr.io/recipes/container:1.0", }, }, }, @@ -423,8 +423,8 @@ func TestCreateOrUpdateEnvironment_RecipePackValidation(t *testing.T) { Properties: datamodel.RecipePackProperties{ Recipes: map[string]*datamodel.RecipeDefinition{ "Applications.Core/containers": { - RecipeKind: "terraform", - RecipeLocation: "git::https://github.com/recipes/container", + Kind: "terraform", + Location: "git::https://github.com/recipes/container", }, }, }, @@ -456,8 +456,8 @@ func TestCreateOrUpdateEnvironment_RecipePackValidation(t *testing.T) { Properties: datamodel.RecipePackProperties{ Recipes: map[string]*datamodel.RecipeDefinition{ "Applications.Core/containers": { - RecipeKind: "bicep", - RecipeLocation: "br:myregistry.azurecr.io/recipes/container:1.0", + Kind: "bicep", + Location: "br:myregistry.azurecr.io/recipes/container:1.0", }, }, }, diff --git a/pkg/corerp/frontend/controller/recipepacks/createorupdaterecipepack_test.go b/pkg/corerp/frontend/controller/recipepacks/createorupdaterecipepack_test.go index f34b1073e4..5b3507ddf2 100644 --- a/pkg/corerp/frontend/controller/recipepacks/createorupdaterecipepack_test.go +++ b/pkg/corerp/frontend/controller/recipepacks/createorupdaterecipepack_test.go @@ -158,16 +158,16 @@ func getTestModels() (*v20250801preview.RecipePackResource, *datamodel.RecipePac Properties: &v20250801preview.RecipePackProperties{ Recipes: map[string]*v20250801preview.RecipeDefinition{ "Applications.Core/extenders": { - RecipeKind: to.Ptr(v20250801preview.RecipeKindBicep), - RecipeLocation: new("ghcr.io/radius-project/recipes/local-dev/extender-postgresql:0.50.0"), + Kind: to.Ptr(v20250801preview.RecipeKindBicep), + Location: new("ghcr.io/radius-project/recipes/local-dev/extender-postgresql:0.50.0"), }, "Radius.Resources/postgreSQL": { - RecipeKind: to.Ptr(v20250801preview.RecipeKindBicep), - RecipeLocation: new("ghcr.io/radius-project/recipes/local-dev/extender-postgresql:0.50.0"), + Kind: to.Ptr(v20250801preview.RecipeKindBicep), + Location: new("ghcr.io/radius-project/recipes/local-dev/extender-postgresql:0.50.0"), }, "Applications.Datastores/redisCaches": { - RecipeKind: to.Ptr(v20250801preview.RecipeKindBicep), - RecipeLocation: new("https://github.com/example/recipes/redis-cache.bicep"), + Kind: to.Ptr(v20250801preview.RecipeKindBicep), + Location: new("https://github.com/example/recipes/redis-cache.bicep"), Parameters: map[string]any{ "tier": "basic", }, @@ -188,16 +188,16 @@ func getTestModels() (*v20250801preview.RecipePackResource, *datamodel.RecipePac Properties: datamodel.RecipePackProperties{ Recipes: map[string]*datamodel.RecipeDefinition{ "Applications.Core/extenders": { - RecipeKind: "bicep", - RecipeLocation: "ghcr.io/radius-project/recipes/local-dev/extender-postgresql:0.50.0", + Kind: "bicep", + Location: "ghcr.io/radius-project/recipes/local-dev/extender-postgresql:0.50.0", }, "Radius.Resources/postgreSQL": { - RecipeKind: "bicep", - RecipeLocation: "ghcr.io/radius-project/recipes/local-dev/extender-postgresql:0.50.0", + Kind: "bicep", + Location: "ghcr.io/radius-project/recipes/local-dev/extender-postgresql:0.50.0", }, "Applications.Datastores/redisCaches": { - RecipeKind: "bicep", - RecipeLocation: "https://github.com/example/recipes/redis-cache.bicep", + Kind: "bicep", + Location: "https://github.com/example/recipes/redis-cache.bicep", Parameters: map[string]any{ "tier": "basic", }, @@ -215,18 +215,18 @@ func getTestModels() (*v20250801preview.RecipePackResource, *datamodel.RecipePac ProvisioningState: to.Ptr(v20250801preview.ProvisioningStateSucceeded), Recipes: map[string]*v20250801preview.RecipeDefinition{ "Applications.Core/extenders": { - RecipeKind: to.Ptr(v20250801preview.RecipeKindBicep), - RecipeLocation: new("ghcr.io/radius-project/recipes/local-dev/extender-postgresql:0.50.0"), + Kind: to.Ptr(v20250801preview.RecipeKindBicep), + Location: new("ghcr.io/radius-project/recipes/local-dev/extender-postgresql:0.50.0"), PlainHTTP: new(false), }, "Radius.Resources/postgreSQL": { - RecipeKind: to.Ptr(v20250801preview.RecipeKindBicep), - RecipeLocation: new("ghcr.io/radius-project/recipes/local-dev/extender-postgresql:0.50.0"), + Kind: to.Ptr(v20250801preview.RecipeKindBicep), + Location: new("ghcr.io/radius-project/recipes/local-dev/extender-postgresql:0.50.0"), PlainHTTP: new(false), }, "Applications.Datastores/redisCaches": { - RecipeKind: to.Ptr(v20250801preview.RecipeKindBicep), - RecipeLocation: new("https://github.com/example/recipes/redis-cache.bicep"), + Kind: to.Ptr(v20250801preview.RecipeKindBicep), + Location: new("https://github.com/example/recipes/redis-cache.bicep"), Parameters: map[string]any{ "tier": "basic", }, diff --git a/pkg/corerp/frontend/controller/recipepacks/testdata/recipepack_datamodel.json b/pkg/corerp/frontend/controller/recipepacks/testdata/recipepack_datamodel.json index 05a1a4d708..959bafebe8 100644 --- a/pkg/corerp/frontend/controller/recipepacks/testdata/recipepack_datamodel.json +++ b/pkg/corerp/frontend/controller/recipepacks/testdata/recipepack_datamodel.json @@ -14,16 +14,16 @@ "properties": { "recipes": { "Applications.Core/extenders": { - "recipeKind": "bicep", - "recipeLocation": "ghcr.io/radius-project/recipes/local-dev/extender-postgresql:0.50.0" + "kind": "bicep", + "location": "ghcr.io/radius-project/recipes/local-dev/extender-postgresql:0.50.0" }, "Radius.Resources/postgreSQL": { - "recipeKind": "bicep", - "recipeLocation": "ghcr.io/radius-project/recipes/local-dev/extender-postgresql:0.50.0" + "kind": "bicep", + "location": "ghcr.io/radius-project/recipes/local-dev/extender-postgresql:0.50.0" }, "Applications.Datastores/redisCaches": { - "recipeKind": "bicep", - "recipeLocation": "https://github.com/example/recipes/redis-cache.bicep", + "kind": "bicep", + "location": "https://github.com/example/recipes/redis-cache.bicep", "parameters": { "tier": "basic" } diff --git a/pkg/recipes/configloader/environment.go b/pkg/recipes/configloader/environment.go index c59549893a..0fb898059e 100644 --- a/pkg/recipes/configloader/environment.go +++ b/pkg/recipes/configloader/environment.go @@ -367,10 +367,10 @@ func getRecipeDefinitionFromEnvironmentV20250801(ctx context.Context, environmen // We will remove this field from EnvironmentDefinition once we deprecate Applications.Core. definition := &recipes.EnvironmentDefinition{ Name: "default", - Driver: recipeDefinition.RecipeKind, + Driver: recipeDefinition.Kind, ResourceType: resource.Type(), Parameters: parameters, - TemplatePath: recipeDefinition.RecipeLocation, + TemplatePath: recipeDefinition.Location, PlainHTTP: recipeDefinition.PlainHTTP, } return definition, nil @@ -405,8 +405,8 @@ func fetchRecipeDefinition(ctx context.Context, recipePackIDs []string, armOptio plainHTTP = *definition.PlainHTTP } return &recipes.RecipeDefinition{ - RecipeKind: string(*definition.RecipeKind), - RecipeLocation: string(*definition.RecipeLocation), + Kind: string(*definition.Kind), + Location: string(*definition.Location), Parameters: definition.Parameters, PlainHTTP: plainHTTP, }, nil diff --git a/pkg/recipes/configloader/environment_v20250801_bridge_test.go b/pkg/recipes/configloader/environment_v20250801_bridge_test.go index 6dcd1e810f..64b492d2bc 100644 --- a/pkg/recipes/configloader/environment_v20250801_bridge_test.go +++ b/pkg/recipes/configloader/environment_v20250801_bridge_test.go @@ -261,6 +261,53 @@ func TestGetConfigurationV20250801_BicepAllEntriesSkipped_LeavesAuthNil(t *testi require.Empty(t, cfg.RecipeConfig.Bicep.Authentication, "expected no auth map when no usable entries") } +func TestFetchRecipeDefinition_Success(t *testing.T) { + recipePackName := "kubernetes-pack" + recipePackID := "/planes/radius/local/resourceGroups/rg/providers/Radius.Core/recipePacks/" + recipePackName + resourceType := "Radius.Compute/containers" + expectedLocation := "ghcr.io/test/containers:latest" + bicepKind := v20250801.RecipeKindBicep + + rpSrv := fake.RecipePacksServer{ + Get: func(ctx context.Context, name string, opts *v20250801.RecipePacksClientGetOptions) (resp azfake.Responder[v20250801.RecipePacksClientGetResponse], errResp azfake.ErrorResponder) { + require.Equal(t, recipePackName, name) + resp.SetResponse(http.StatusOK, v20250801.RecipePacksClientGetResponse{ + RecipePackResource: v20250801.RecipePackResource{ + Name: to.Ptr(recipePackName), + Properties: &v20250801.RecipePackProperties{ + Recipes: map[string]*v20250801.RecipeDefinition{ + resourceType: { + Kind: &bicepKind, + Location: to.Ptr(expectedLocation), + Parameters: map[string]any{ + "tier": "basic", + }, + }, + }, + }, + }, + }, nil) + return + }, + } + + armOpts := &armpolicy.ClientOptions{ + ClientOptions: policy.ClientOptions{ + Transport: fake.NewServerFactoryTransport(&fake.ServerFactory{ + RecipePacksServer: rpSrv, + }), + }, + } + + def, err := fetchRecipeDefinition(context.Background(), []string{recipePackID}, armOpts, resourceType) + require.NoError(t, err) + require.NotNil(t, def) + require.Equal(t, string(bicepKind), def.Kind) + require.Equal(t, expectedLocation, def.Location) + require.Equal(t, map[string]any{"tier": "basic"}, def.Parameters) + require.False(t, def.PlainHTTP) +} + func TestGetConfigurationV20250801_TerraformFetchError_IsWrapped(t *testing.T) { tfSrv := fake.TerraformConfigsServer{ Get: func(ctx context.Context, name string, opts *v20250801.TerraformConfigsClientGetOptions) (resp azfake.Responder[v20250801.TerraformConfigsClientGetResponse], errResp azfake.ErrorResponder) { diff --git a/pkg/recipes/types.go b/pkg/recipes/types.go index 61d512487b..74730f9056 100644 --- a/pkg/recipes/types.go +++ b/pkg/recipes/types.go @@ -152,10 +152,10 @@ type RecipePackResource struct { // RecipeDefinition represents a recipe definition for a specific resource type in a recipe pack. type RecipeDefinition struct { - // RecipeKind represents the type of recipe (e.g., terraform, bicep) - RecipeKind string - // RecipeLocation represents URL or path to the recipe source - RecipeLocation string + // Kind represents the type of recipe (e.g., terraform, bicep) + Kind string + // Location represents URL or path to the recipe source + Location string // Parameters represents parameters to pass to the recipe Parameters map[string]any // PlainHTTP connects to the location using HTTP (not-HTTPS) diff --git a/swagger/specification/radius/resource-manager/Radius.Core/preview/2025-08-01-preview/examples/RecipePacks_CreateOrUpdate.json b/swagger/specification/radius/resource-manager/Radius.Core/preview/2025-08-01-preview/examples/RecipePacks_CreateOrUpdate.json index c803d5088b..04fe84fd0c 100644 --- a/swagger/specification/radius/resource-manager/Radius.Core/preview/2025-08-01-preview/examples/RecipePacks_CreateOrUpdate.json +++ b/swagger/specification/radius/resource-manager/Radius.Core/preview/2025-08-01-preview/examples/RecipePacks_CreateOrUpdate.json @@ -10,16 +10,16 @@ "properties": { "recipes": { "Applications.Core/containers": { - "recipeKind": "bicep", - "recipeLocation": "ghcr.io/radius-project/recipes/azure-container-apps:latest", + "kind": "bicep", + "location": "ghcr.io/radius-project/recipes/azure-container-apps:latest", "parameters": { "cpu": "1.0", "memory": "2Gi" } }, "Applications.Dapr/stateStores": { - "recipeKind": "bicep", - "recipeLocation": "br:myregistry.azurecr.io/bicep/recipes/cosmosdb:v1.0", + "kind": "bicep", + "location": "br:myregistry.azurecr.io/bicep/recipes/cosmosdb:v1.0", "parameters": { "databaseName": "radius-db", "throughput": 400 @@ -43,16 +43,16 @@ ], "recipes": { "Applications.Core/containers": { - "recipeKind": "bicep", - "recipeLocation": "ghcr.io/radius-project/recipes/azure-container-apps:latest", + "kind": "bicep", + "location": "ghcr.io/radius-project/recipes/azure-container-apps:latest", "parameters": { "cpu": "1.0", "memory": "2Gi" } }, "Applications.Dapr/stateStores": { - "recipeKind": "bicep", - "recipeLocation": "br:myregistry.azurecr.io/bicep/recipes/cosmosdb:v1.0", + "kind": "bicep", + "location": "br:myregistry.azurecr.io/bicep/recipes/cosmosdb:v1.0", "parameters": { "databaseName": "radius-db", "throughput": 400 diff --git a/swagger/specification/radius/resource-manager/Radius.Core/preview/2025-08-01-preview/examples/RecipePacks_Get.json b/swagger/specification/radius/resource-manager/Radius.Core/preview/2025-08-01-preview/examples/RecipePacks_Get.json index e5c6b50be1..89580801d4 100644 --- a/swagger/specification/radius/resource-manager/Radius.Core/preview/2025-08-01-preview/examples/RecipePacks_Get.json +++ b/swagger/specification/radius/resource-manager/Radius.Core/preview/2025-08-01-preview/examples/RecipePacks_Get.json @@ -20,16 +20,16 @@ ], "recipes": { "Applications.Core/containers": { - "recipeKind": "bicep", - "recipeLocation": "ghcr.io/radius-project/recipes/azure-container-apps:latest", + "kind": "bicep", + "location": "ghcr.io/radius-project/recipes/azure-container-apps:latest", "parameters": { "cpu": "1.0", "memory": "2Gi" } }, "Applications.Dapr/stateStores": { - "recipeKind": "bicep", - "recipeLocation": "br:myregistry.azurecr.io/bicep/recipes/cosmosdb:v1.0", + "kind": "bicep", + "location": "br:myregistry.azurecr.io/bicep/recipes/cosmosdb:v1.0", "parameters": { "databaseName": "radius-db", "throughput": 400 diff --git a/swagger/specification/radius/resource-manager/Radius.Core/preview/2025-08-01-preview/examples/RecipePacks_ListByScope.json b/swagger/specification/radius/resource-manager/Radius.Core/preview/2025-08-01-preview/examples/RecipePacks_ListByScope.json index 5f0e6e532c..36bbae58ae 100644 --- a/swagger/specification/radius/resource-manager/Radius.Core/preview/2025-08-01-preview/examples/RecipePacks_ListByScope.json +++ b/swagger/specification/radius/resource-manager/Radius.Core/preview/2025-08-01-preview/examples/RecipePacks_ListByScope.json @@ -21,8 +21,8 @@ ], "recipes": { "Applications.Core/containers": { - "recipeKind": "bicep", - "recipeLocation": "ghcr.io/myregistry/bicep/recipes/myrecipe:v1.0" + "kind": "bicep", + "location": "ghcr.io/myregistry/bicep/recipes/myrecipe:v1.0" } } } @@ -37,8 +37,8 @@ "referencedBy": [], "recipes": { "Applications.Core/containers": { - "recipeKind": "bicep", - "recipeLocation": "ghcr.io/myregistry/bicep/recipes/myrecipe:v1.0" + "kind": "bicep", + "location": "ghcr.io/myregistry/bicep/recipes/myrecipe:v1.0" } } } diff --git a/swagger/specification/radius/resource-manager/Radius.Core/preview/2025-08-01-preview/openapi.json b/swagger/specification/radius/resource-manager/Radius.Core/preview/2025-08-01-preview/openapi.json index 4fcd687754..2d884f48bd 100644 --- a/swagger/specification/radius/resource-manager/Radius.Core/preview/2025-08-01-preview/openapi.json +++ b/swagger/specification/radius/resource-manager/Radius.Core/preview/2025-08-01-preview/openapi.json @@ -1989,7 +1989,7 @@ "type": "object", "description": "Recipe definition for a specific resource type", "properties": { - "recipeKind": { + "kind": { "$ref": "#/definitions/RecipeKind", "description": "The type of recipe (e.g., Terraform, Bicep)" }, @@ -1997,7 +1997,7 @@ "type": "boolean", "description": "Connect to the location using HTTP (not HTTPS). This should be used when the location is known not to support HTTPS, for example in a locally hosted registry for Bicep recipes. Defaults to false (use HTTPS/TLS)" }, - "recipeLocation": { + "location": { "type": "string", "description": "URL path to the recipe" }, @@ -2008,8 +2008,8 @@ } }, "required": [ - "recipeKind", - "recipeLocation" + "kind", + "location" ] }, "RecipeKind": { diff --git a/test/functional-portable/cli/noncloud/testdata/corerp-recipe-pack-test.bicep b/test/functional-portable/cli/noncloud/testdata/corerp-recipe-pack-test.bicep index e76bb33075..a68ef38b96 100644 --- a/test/functional-portable/cli/noncloud/testdata/corerp-recipe-pack-test.bicep +++ b/test/functional-portable/cli/noncloud/testdata/corerp-recipe-pack-test.bicep @@ -4,19 +4,19 @@ resource computeRecipePack 'Radius.Core/recipePacks@2025-08-01-preview' = { properties: { recipes: { 'Radius.Compute/containers': { - recipeKind: 'terraform' - recipeLocation: 'https://github.com/project-radius/resource-types-contrib.git//recipes/compute/containers/kubernetes?ref=v0.48' + kind: 'terraform' + location: 'https://github.com/project-radius/resource-types-contrib.git//recipes/compute/containers/kubernetes?ref=v0.48' parameters: { allowPlatformOptions: true } } 'Radius.Security/secrets': { - recipeKind: 'terraform' - recipeLocation: 'https://github.com/project-radius/resource-types-contrib.git//recipes/security/secrets/kubernetes?ref=v0.48' + kind: 'terraform' + location: 'https://github.com/project-radius/resource-types-contrib.git//recipes/security/secrets/kubernetes?ref=v0.48' } 'Radius.Storage/volumes': { - recipeKind: 'terraform' - recipeLocation: 'https://github.com/project-radius/resource-types-contrib.git//recipes/storage/volumes/kubernetes?ref=v0.48' + kind: 'terraform' + location: 'https://github.com/project-radius/resource-types-contrib.git//recipes/storage/volumes/kubernetes?ref=v0.48' } } } diff --git a/test/functional-portable/dynamicrp/noncloud/resources/testdata/recipepacks-test-no-provider.bicep b/test/functional-portable/dynamicrp/noncloud/resources/testdata/recipepacks-test-no-provider.bicep index 9dcd18ad76..6ebcae4949 100644 --- a/test/functional-portable/dynamicrp/noncloud/resources/testdata/recipepacks-test-no-provider.bicep +++ b/test/functional-portable/dynamicrp/noncloud/resources/testdata/recipepacks-test-no-provider.bicep @@ -14,8 +14,8 @@ resource recipepack 'Radius.Core/recipePacks@2025-08-01-preview' = { properties: { recipes: { 'Test.Resources/userTypeAlpha': { - recipeKind: 'bicep' - recipeLocation: '${registry}/test/testrecipes/test-bicep-recipes/dynamicrp_recipe:${version}' + kind: 'bicep' + location: '${registry}/test/testrecipes/test-bicep-recipes/dynamicrp_recipe:${version}' parameters: { port: port } diff --git a/test/functional-portable/dynamicrp/noncloud/resources/testdata/recipepacks-test.bicep b/test/functional-portable/dynamicrp/noncloud/resources/testdata/recipepacks-test.bicep index 891d8e9001..2b77af0272 100644 --- a/test/functional-portable/dynamicrp/noncloud/resources/testdata/recipepacks-test.bicep +++ b/test/functional-portable/dynamicrp/noncloud/resources/testdata/recipepacks-test.bicep @@ -18,16 +18,16 @@ resource recipepack 'Radius.Core/recipePacks@2025-08-01-preview' = { properties: { recipes: { 'Test.Resources/userTypeAlpha': { - recipeKind: 'bicep' - recipeLocation: '${registry}/test/testrecipes/test-bicep-recipes/dynamicrp_recipe:${version}' + kind: 'bicep' + location: '${registry}/test/testrecipes/test-bicep-recipes/dynamicrp_recipe:${version}' parameters: { port: port } } 'Test.Resources/postgres': { - recipeKind: 'bicep' + kind: 'bicep' // update the sha sum after making changes to the recipe - recipeLocation: '${registry}/test/testrecipes/test-bicep-recipes/dynamicrp_postgress_recipe@sha256:40d079856c2b7cf4df146c0726b31b8bea6a82ef1eb7fa9bc9e00498367f2a4d' + location: '${registry}/test/testrecipes/test-bicep-recipes/dynamicrp_postgress_recipe@sha256:40d079856c2b7cf4df146c0726b31b8bea6a82ef1eb7fa9bc9e00498367f2a4d' } } } diff --git a/test/functional-portable/dynamicrp/noncloud/resources/testdata/terraformconfig-redis-test.bicep b/test/functional-portable/dynamicrp/noncloud/resources/testdata/terraformconfig-redis-test.bicep index 22c4795807..a4c06f348c 100644 --- a/test/functional-portable/dynamicrp/noncloud/resources/testdata/terraformconfig-redis-test.bicep +++ b/test/functional-portable/dynamicrp/noncloud/resources/testdata/terraformconfig-redis-test.bicep @@ -30,8 +30,8 @@ resource recipepack 'Radius.Core/recipePacks@2025-08-01-preview' = { properties: { recipes: { 'Applications.Core/extenders': { - recipeKind: 'terraform' - recipeLocation: '${moduleServer}/kubernetes-redis.zip//modules' + kind: 'terraform' + location: '${moduleServer}/kubernetes-redis.zip//modules' } } } diff --git a/test/functional-portable/dynamicrp/noncloud/resources/testdata/tfbicep-combined-test.bicep b/test/functional-portable/dynamicrp/noncloud/resources/testdata/tfbicep-combined-test.bicep index 58e6408f97..5fc948ede7 100644 --- a/test/functional-portable/dynamicrp/noncloud/resources/testdata/tfbicep-combined-test.bicep +++ b/test/functional-portable/dynamicrp/noncloud/resources/testdata/tfbicep-combined-test.bicep @@ -73,8 +73,8 @@ resource recipepack 'Radius.Core/recipePacks@2025-08-01-preview' = { properties: { recipes: { 'Applications.Core/extenders': { - recipeKind: 'terraform' - recipeLocation: '${moduleServer}/kubernetes-redis.zip//modules' + kind: 'terraform' + location: '${moduleServer}/kubernetes-redis.zip//modules' } } } diff --git a/typespec/Radius.Core/examples/2025-08-01-preview/RecipePacks_CreateOrUpdate.json b/typespec/Radius.Core/examples/2025-08-01-preview/RecipePacks_CreateOrUpdate.json index c803d5088b..04fe84fd0c 100644 --- a/typespec/Radius.Core/examples/2025-08-01-preview/RecipePacks_CreateOrUpdate.json +++ b/typespec/Radius.Core/examples/2025-08-01-preview/RecipePacks_CreateOrUpdate.json @@ -10,16 +10,16 @@ "properties": { "recipes": { "Applications.Core/containers": { - "recipeKind": "bicep", - "recipeLocation": "ghcr.io/radius-project/recipes/azure-container-apps:latest", + "kind": "bicep", + "location": "ghcr.io/radius-project/recipes/azure-container-apps:latest", "parameters": { "cpu": "1.0", "memory": "2Gi" } }, "Applications.Dapr/stateStores": { - "recipeKind": "bicep", - "recipeLocation": "br:myregistry.azurecr.io/bicep/recipes/cosmosdb:v1.0", + "kind": "bicep", + "location": "br:myregistry.azurecr.io/bicep/recipes/cosmosdb:v1.0", "parameters": { "databaseName": "radius-db", "throughput": 400 @@ -43,16 +43,16 @@ ], "recipes": { "Applications.Core/containers": { - "recipeKind": "bicep", - "recipeLocation": "ghcr.io/radius-project/recipes/azure-container-apps:latest", + "kind": "bicep", + "location": "ghcr.io/radius-project/recipes/azure-container-apps:latest", "parameters": { "cpu": "1.0", "memory": "2Gi" } }, "Applications.Dapr/stateStores": { - "recipeKind": "bicep", - "recipeLocation": "br:myregistry.azurecr.io/bicep/recipes/cosmosdb:v1.0", + "kind": "bicep", + "location": "br:myregistry.azurecr.io/bicep/recipes/cosmosdb:v1.0", "parameters": { "databaseName": "radius-db", "throughput": 400 diff --git a/typespec/Radius.Core/examples/2025-08-01-preview/RecipePacks_Get.json b/typespec/Radius.Core/examples/2025-08-01-preview/RecipePacks_Get.json index e5c6b50be1..89580801d4 100644 --- a/typespec/Radius.Core/examples/2025-08-01-preview/RecipePacks_Get.json +++ b/typespec/Radius.Core/examples/2025-08-01-preview/RecipePacks_Get.json @@ -20,16 +20,16 @@ ], "recipes": { "Applications.Core/containers": { - "recipeKind": "bicep", - "recipeLocation": "ghcr.io/radius-project/recipes/azure-container-apps:latest", + "kind": "bicep", + "location": "ghcr.io/radius-project/recipes/azure-container-apps:latest", "parameters": { "cpu": "1.0", "memory": "2Gi" } }, "Applications.Dapr/stateStores": { - "recipeKind": "bicep", - "recipeLocation": "br:myregistry.azurecr.io/bicep/recipes/cosmosdb:v1.0", + "kind": "bicep", + "location": "br:myregistry.azurecr.io/bicep/recipes/cosmosdb:v1.0", "parameters": { "databaseName": "radius-db", "throughput": 400 diff --git a/typespec/Radius.Core/examples/2025-08-01-preview/RecipePacks_List.json b/typespec/Radius.Core/examples/2025-08-01-preview/RecipePacks_List.json index e38bbd79b1..9656c379ab 100644 --- a/typespec/Radius.Core/examples/2025-08-01-preview/RecipePacks_List.json +++ b/typespec/Radius.Core/examples/2025-08-01-preview/RecipePacks_List.json @@ -20,8 +20,8 @@ ], "recipes": { "Applications.Core/containers": { - "recipeKind": "bicep", - "recipeLocation": "ghcr.io/radius-project/recipes/azure-container-apps:latest" + "kind": "bicep", + "location": "ghcr.io/radius-project/recipes/azure-container-apps:latest" } } } @@ -36,8 +36,8 @@ "referencedBy": [], "recipes": { "Applications.Core/containers": { - "recipeKind": "bicep", - "recipeLocation": "ghcr.io/myregistry/bicep/recipes/myrecipe:v1.0" + "kind": "bicep", + "location": "ghcr.io/myregistry/bicep/recipes/myrecipe:v1.0" } } } diff --git a/typespec/Radius.Core/examples/2025-08-01-preview/RecipePacks_ListByScope.json b/typespec/Radius.Core/examples/2025-08-01-preview/RecipePacks_ListByScope.json index 5f0e6e532c..36bbae58ae 100644 --- a/typespec/Radius.Core/examples/2025-08-01-preview/RecipePacks_ListByScope.json +++ b/typespec/Radius.Core/examples/2025-08-01-preview/RecipePacks_ListByScope.json @@ -21,8 +21,8 @@ ], "recipes": { "Applications.Core/containers": { - "recipeKind": "bicep", - "recipeLocation": "ghcr.io/myregistry/bicep/recipes/myrecipe:v1.0" + "kind": "bicep", + "location": "ghcr.io/myregistry/bicep/recipes/myrecipe:v1.0" } } } @@ -37,8 +37,8 @@ "referencedBy": [], "recipes": { "Applications.Core/containers": { - "recipeKind": "bicep", - "recipeLocation": "ghcr.io/myregistry/bicep/recipes/myrecipe:v1.0" + "kind": "bicep", + "location": "ghcr.io/myregistry/bicep/recipes/myrecipe:v1.0" } } } diff --git a/typespec/Radius.Core/recipePacks.tsp b/typespec/Radius.Core/recipePacks.tsp index 2b9b494024..5e3c788d7f 100644 --- a/typespec/Radius.Core/recipePacks.tsp +++ b/typespec/Radius.Core/recipePacks.tsp @@ -58,13 +58,13 @@ model RecipePackProperties { @doc("Recipe definition for a specific resource type") model RecipeDefinition { @doc("The type of recipe (e.g., Terraform, Bicep)") - recipeKind: RecipeKind; + kind: RecipeKind; @doc("Connect to the location using HTTP (not HTTPS). This should be used when the location is known not to support HTTPS, for example in a locally hosted registry for Bicep recipes. Defaults to false (use HTTPS/TLS)") plainHttp?: boolean; @doc("URL path to the recipe") - recipeLocation: string; + location: string; @doc("Parameters to pass to the recipe") parameters?: Record;