Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pkg/cli/recipepack/recipepack.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,10 @@ func GetCoreTypesRecipeInfo() []CoreTypesRecipeInfo {
ResourceType: "Radius.Data/postgreSqlDatabases",
Source: "ghcr.io/radius-project/kube-recipes/postgresqldatabases:" + resolveRecipeTag("Radius.Data/postgreSqlDatabases", isEdge),
},
{
ResourceType: "Radius.Data/redisCaches",
Source: "ghcr.io/radius-project/kube-recipes/rediscaches:" + resolveRecipeTag("Radius.Data/redisCaches", isEdge),
},
{
ResourceType: "Radius.Messaging/rabbitMQ",
Source: "ghcr.io/radius-project/kube-recipes/rabbitmq:" + resolveRecipeTag("Radius.Messaging/rabbitMQ", isEdge),
Expand Down
1 change: 1 addition & 0 deletions pkg/cli/recipepack/recipepack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ func Test_GetDefaultRecipePackDefinition(t *testing.T) {
"Radius.Security/secrets",
"Radius.Data/mySqlDatabases",
"Radius.Data/postgreSqlDatabases",
"Radius.Data/redisCaches",
"Radius.Messaging/rabbitMQ",
}
require.Len(t, definitions, len(expectedResourceTypes))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*
Copyright 2026 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 resource_test

import (
"fmt"
"testing"

"github.com/radius-project/radius/test/rp"
"github.com/radius-project/radius/test/step"
"github.com/radius-project/radius/test/validation"
)

// Test_RedisCache deploys a Radius.Data/redisCaches resource using the default
// preview-environment recipe pack and validates the running Kubernetes resources
// provisioned by the Redis recipe.
func Test_RedisCache(t *testing.T) {
template := "testdata/corerp-resources-rediscache.bicep"
name := "corerp-resources-redis"
cacheName := "redis-cache"

test := rp.NewRPTest(t, name, []rp.TestStep{
{
RPResources: &validation.RPResourceSet{
Resources: []validation.RPResource{
{
Name: name,
Type: validation.CoreApplicationsResource,
},
{
Name: cacheName,
Type: validation.DataRedisCachesResource,
App: name,
},
},
},
K8sObjects: &validation.K8sObjectSet{
Namespaces: map[string][]validation.K8sObject{
name: {
validation.NewK8sPodForResource(name, cacheName),
validation.NewK8sDeploymentForResource(name, cacheName),
validation.NewK8sServiceForResource(name, cacheName),
},
},
},
},
})

preSetup, previewEnvID := rp.NewPreviewEnvPreSetup(name, test.Options.Workspace.Scope, name)
test.PreSetup = preSetup
test.Steps[0].Executor = step.NewDeployExecutor(template, fmt.Sprintf("environment=%s", previewEnvID))

test.Test(t)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
extension radius

@description('Specifies the location for resources.')
param location string = 'global'

@description('Specifies the environment for resources.')
param environment string

resource app 'Radius.Core/applications@2025-08-01-preview' = {
name: 'corerp-resources-redis'
location: location
properties: {
environment: environment
}
}

resource redis 'Radius.Data/redisCaches@2025-08-01-preview' = {
name: 'redis-cache'
location: location
properties: {
environment: environment
application: app.id
size: 'S'
}
}
1 change: 1 addition & 0 deletions test/validation/shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const (
// Radius.Data resource types (new provider).
DataMySQLDatabasesResource = "radius.data/mySqlDatabases"
DataPostgreSQLDatabasesResource = "radius.data/postgreSqlDatabases"
DataRedisCachesResource = "radius.data/redisCaches"

// Radius.Messaging resource types (new provider).
MessagingRabbitMQResource = "radius.messaging/rabbitMQ"
Expand Down
Loading