Skip to content

Commit c56df78

Browse files
CopilotReshrahim
andauthored
Standardize recipe parameter naming: rename Parameters to RecipeParameters in RecipeDefinition
Agent-Logs-Url: https://github.com/radius-project/radius/sessions/31e3b677-4d45-408c-9577-3b2566d6fdbd Co-authored-by: Reshrahim <61033581+Reshrahim@users.noreply.github.com>
1 parent e1975c5 commit c56df78

14 files changed

Lines changed: 48 additions & 48 deletions

File tree

‎eng/design-notes/recipes/2025-08-recipe-packs.md‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ recipes:
104104
- resourceType: "Radius.Compute/containers@2025-05-01-preview"
105105
recipeKind: "bicep"
106106
recipeLocation: "oci://ghcr.io/my-org/recipes/core/aci-container:1.2.0"
107-
parameters:
107+
recipeParameters:
108108
cpu: "1.0"
109109
memoryInGB: "2.0"
110110
environmentVariables:
@@ -114,12 +114,12 @@ recipes:
114114
- resourceType: "Radius.Compute/gateways@2025-05-01-preview"
115115
recipeKind: "bicep"
116116
recipeLocation: "oci://ghcr.io/my-org/recipes/core/aci-gateway:1.1.0"
117-
parameters:
117+
recipeParameters:
118118
sku: "Standard_v2"
119119
- resourceType: "Radius.Security/secrets@2025-05-01-preview"
120120
recipeKind: "bicep"
121121
recipeLocation: "oci://ghcr.io/my-org/recipes/azure/keyvault-secretstore:1.0.0"
122-
parameters:
122+
recipeParameters:
123123
skuName: "premium"
124124
```
125125
@@ -209,7 +209,7 @@ recipeLocation: string;
209209
recipeDigest?: string;
210210
211211
@doc("Parameters to pass to the recipe")
212-
parameters?: Record<unknown>;
212+
recipeParameters?: Record<unknown>;
213213
}
214214
215215
@doc("The type of recipe")
@@ -281,7 +281,7 @@ resource computeRecipePack 'Radius.Core/recipePacks@2026-01-01-preview' = {
281281
recipeKind: 'terraform'
282282
recipeLocation: 'https://github.com/project-radius/resource-types-contrib.git//recipes/compute/containers/kubernetes?ref=v0.48'
283283
recipeDigest: 'sha256:4g5h6i7j8k9l0m1n2o3p4q5r6s7t8u9v0w1x2y3z4a5b6c7d8e9f0g1h2i3j4k5'
284-
parameters: {
284+
recipeParameters: {
285285
allowPlatformOptions: true
286286
anIntegerParam: 1
287287
}
@@ -327,15 +327,15 @@ curl -X PUT \
327327
"Applications.Datastores/sqlDatabases": {
328328
"recipeKind": "terraform",
329329
"recipeLocation": "https://github.com/example/recipes/sql-database",
330-
"parameters": {
330+
"recipeParameters": {
331331
"size": "small",
332332
"backup": false
333333
}
334334
},
335335
"Applications.Datastores/redisCaches": {
336336
"recipeKind": "bicep",
337337
"recipeLocation": "https://github.com/example/recipes/redis-cache.bicep",
338-
"parameters": {
338+
"recipeParameters": {
339339
"tier": "basic"
340340
}
341341
}
@@ -356,14 +356,14 @@ CREATE response:
356356
"provisioningState": "Succeeded",
357357
"recipes": {
358358
"Applications.Datastores/redisCaches": {
359-
"parameters": {
359+
"recipeParameters": {
360360
"tier": "basic"
361361
},
362362
"recipeKind": "bicep",
363363
"recipeLocation": "https://github.com/example/recipes/redis-cache.bicep"
364364
},
365365
"Applications.Datastores/sqlDatabases": {
366-
"parameters": {
366+
"recipeParameters": {
367367
"backup": false,
368368
"size": "small"
369369
},
@@ -405,14 +405,14 @@ READ response:
405405
"provisioningState": "Succeeded",
406406
"recipes": {
407407
"Applications.Datastores/redisCaches": {
408-
"parameters": {
408+
"recipeParameters": {
409409
"tier": "basic"
410410
},
411411
"recipeKind": "bicep",
412412
"recipeLocation": "https://github.com/example/recipes/redis-cache.bicep"
413413
},
414414
"Applications.Datastores/sqlDatabases": {
415-
"parameters": {
415+
"recipeParameters": {
416416
"backup": false,
417417
"size": "small"
418418
},
@@ -526,7 +526,7 @@ resource computeRecipePack 'Radius.Core/recipePacks@2025-05-01-preview' = {
526526
'Radius.Compute/containers': {
527527
recipeKind: 'terraform'
528528
recipeLocation: 'https://github.com/project-radius/resource-types-contrib.git//recipes/compute/containers/kubernetes?ref=v0.48'
529-
parameters: {
529+
recipeParameters: {
530530
allowPlatformOptions: true
531531
}
532532
}

‎pkg/cli/cmd/recipepack/show/display.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ func (r *Runner) display(recipePack v20250801preview.RecipePackResource) error {
6060
r.Output.LogInfo(" Kind: %s", kind)
6161
r.Output.LogInfo(" Location: %s", location)
6262

63-
if len(definition.Parameters) > 0 {
64-
formatted, err := formatRecipeParameters(definition.Parameters)
63+
if len(definition.RecipeParameters) > 0 {
64+
formatted, err := formatRecipeParameters(definition.RecipeParameters)
6565
if err != nil {
6666
return fmt.Errorf("format recipe parameters: %w", err)
6767
}

‎pkg/cli/cmd/recipepack/show/show_test.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func Test_Run(t *testing.T) {
9090
"Radius.Core/example": {
9191
RecipeKind: to.Ptr(corerpv20250801preview.RecipeKindTerraform),
9292
RecipeLocation: new("https://github.com/radius-project/example"),
93-
Parameters: map[string]any{
93+
RecipeParameters: map[string]any{
9494
"foo": "bar",
9595
},
9696
},

‎pkg/corerp/api/v20250801preview/recipepack_conversion.go‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,10 @@ func toRecipesDataModel(recipes map[string]*RecipeDefinition) map[string]*datamo
9595
for key, recipe := range recipes {
9696
if recipe != nil {
9797
result[key] = &datamodel.RecipeDefinition{
98-
RecipeKind: toRecipeKindDataModel(recipe.RecipeKind),
99-
RecipeLocation: to.String(recipe.RecipeLocation),
100-
Parameters: recipe.Parameters,
101-
PlainHTTP: to.Bool(recipe.PlainHTTP),
98+
RecipeKind: toRecipeKindDataModel(recipe.RecipeKind),
99+
RecipeLocation: to.String(recipe.RecipeLocation),
100+
RecipeParameters: recipe.RecipeParameters,
101+
PlainHTTP: to.Bool(recipe.PlainHTTP),
102102
}
103103
}
104104
}
@@ -114,10 +114,10 @@ func fromRecipesDataModel(recipes map[string]*datamodel.RecipeDefinition) map[st
114114
for key, recipe := range recipes {
115115
if recipe != nil {
116116
result[key] = &RecipeDefinition{
117-
RecipeKind: fromRecipeKindDataModel(recipe.RecipeKind),
118-
RecipeLocation: new(recipe.RecipeLocation),
119-
Parameters: recipe.Parameters,
120-
PlainHTTP: new(recipe.PlainHTTP),
117+
RecipeKind: fromRecipeKindDataModel(recipe.RecipeKind),
118+
RecipeLocation: new(recipe.RecipeLocation),
119+
RecipeParameters: recipe.RecipeParameters,
120+
PlainHTTP: new(recipe.PlainHTTP),
121121
}
122122
}
123123
}

‎pkg/corerp/api/v20250801preview/testdata/recipepackresource.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"Applications.Core/containers": {
1818
"recipeKind": "Bicep",
1919
"recipeLocation": "br:ghcr.io/radius-project/recipes/kubernetes-container:latest",
20-
"parameters": {
20+
"recipeParameters": {
2121
"port": 8080,
2222
"replicas": 3
2323
},
@@ -26,7 +26,7 @@
2626
"Applications.Dapr/stateStores": {
2727
"recipeKind": "Terraform",
2828
"recipeLocation": "oci://ghcr.io/radius-project/recipes/terraform/redis:latest",
29-
"parameters": {
29+
"recipeParameters": {
3030
"size": "small"
3131
},
3232
"plainHTTP": true

‎pkg/corerp/api/v20250801preview/testdata/recipepackresourcedatamodel.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"Applications.Core/containers": {
3030
"recipeKind": "Bicep",
3131
"recipeLocation": "br:ghcr.io/radius-project/recipes/kubernetes-container:latest",
32-
"parameters": {
32+
"recipeParameters": {
3333
"port": 8080,
3434
"replicas": 3
3535
},
@@ -38,7 +38,7 @@
3838
"Applications.Dapr/stateStores": {
3939
"recipeKind": "Terraform",
4040
"recipeLocation": "oci://ghcr.io/radius-project/recipes/terraform/redis:latest",
41-
"parameters": {
41+
"recipeParameters": {
4242
"size": "small"
4343
},
4444
"plainHTTP": true

‎pkg/corerp/api/v20250801preview/zz_generated_models.go‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎pkg/corerp/api/v20250801preview/zz_generated_models_serde.go‎

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎pkg/corerp/datamodel/converter/recipepack_converter_test.go‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func TestRecipePackDataModelToVersioned(t *testing.T) {
6060
"Applications.Core/containers": {
6161
RecipeKind: "bicep",
6262
RecipeLocation: "br:myregistry.azurecr.io/recipes/container:1.0",
63-
Parameters: map[string]any{
63+
RecipeParameters: map[string]any{
6464
"param1": "value1",
6565
},
6666
PlainHTTP: false,
@@ -164,7 +164,7 @@ func TestRecipePackDataModelFromVersioned(t *testing.T) {
164164
"Applications.Core/containers": {
165165
"recipeKind": "bicep",
166166
"recipeLocation": "br:myregistry.azurecr.io/recipes/container:1.0",
167-
"parameters": {
167+
"recipeParameters": {
168168
"param1": "value1"
169169
},
170170
"plainHTTP": false
@@ -205,7 +205,7 @@ func TestRecipePackDataModelFromVersioned(t *testing.T) {
205205
"Applications.Core/containers": {
206206
RecipeKind: "bicep",
207207
RecipeLocation: "br:myregistry.azurecr.io/recipes/container:1.0",
208-
Parameters: map[string]any{
208+
RecipeParameters: map[string]any{
209209
"param1": "value1",
210210
},
211211
PlainHTTP: false,
@@ -394,8 +394,8 @@ func TestRecipePackDataModelFromVersioned(t *testing.T) {
394394
require.Equal(t, expectedRecipe.PlainHTTP, actualRecipe.PlainHTTP, "PlainHTTP for recipe %s should match. Expected: %v, Actual: %v", key, expectedRecipe.PlainHTTP, actualRecipe.PlainHTTP)
395395

396396
// Note: JSON unmarshaling can change the type of parameters, especially for numbers
397-
if expectedRecipe.Parameters != nil {
398-
require.Equal(t, expectedRecipe.Parameters, actualRecipe.Parameters)
397+
if expectedRecipe.RecipeParameters != nil {
398+
require.Equal(t, expectedRecipe.RecipeParameters, actualRecipe.RecipeParameters)
399399
}
400400
}
401401
}
@@ -428,7 +428,7 @@ func TestRecipePackRoundTripConversion(t *testing.T) {
428428
"Applications.Core/containers": {
429429
RecipeKind: "bicep",
430430
RecipeLocation: "br:test.azurecr.io/recipes/container:latest",
431-
Parameters: map[string]any{
431+
RecipeParameters: map[string]any{
432432
"cpu": "0.5",
433433
"memory": "1Gi",
434434
},
@@ -471,7 +471,7 @@ func TestRecipePackRoundTripConversion(t *testing.T) {
471471
require.Equal(t, originalRecipe.RecipeKind, resultRecipe.RecipeKind)
472472
require.Equal(t, originalRecipe.RecipeLocation, resultRecipe.RecipeLocation)
473473
require.Equal(t, originalRecipe.PlainHTTP, resultRecipe.PlainHTTP)
474-
require.Equal(t, originalRecipe.Parameters, resultRecipe.Parameters)
474+
require.Equal(t, originalRecipe.RecipeParameters, resultRecipe.RecipeParameters)
475475
}
476476
}
477477

‎pkg/corerp/datamodel/recipepack.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ type RecipeDefinition struct {
5555
// RecipeLocation is the URL or path to the recipe source.
5656
RecipeLocation string `json:"recipeLocation"`
5757

58-
// Parameters to pass to the recipe.
59-
Parameters map[string]any `json:"parameters,omitempty"`
58+
// RecipeParameters to pass to the recipe.
59+
RecipeParameters map[string]any `json:"recipeParameters,omitempty"`
6060

6161
// PlainHTTP connects to the location using HTTP (not-HTTPS).
6262
PlainHTTP bool `json:"plainHTTP,omitempty"`

0 commit comments

Comments
 (0)