Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating the api versions for clients #5018

Merged
merged 1 commit into from
Jan 25, 2023
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
9 changes: 9 additions & 0 deletions pkg/azure/clientv2/apiversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,13 @@ var (
RoleAssignmentClientAPIVersion = "2022-04-01"
DeploymentsClientAPIVersion = "2020-10-01"
DeploymentOperationsClientAPIVersion = "2020-10-01"

// https://github.com/Azure/azure-rest-api-specs/blob/main/specification/sql/resource-manager/readme.md
SQLManagementClientAPIVersion = "2021-11-01"

// https://github.com/Azure/azure-rest-api-specs/blob/main/specification/redis/resource-manager/readme.md
RedisManagementClientAPIVersion = "2022-06-01"

// https://github.com/Azure/azure-rest-api-specs/blob/main/specification/cosmos-db/resource-manager/readme.md
DocumentDBManagementClientAPIVersion = "2022-08-15"
Comment on lines +16 to +23
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got the most recent stable API versions of these clients to hard-code them per the discussion here: #4864 (comment). Do you think this looks right @rynowak?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

)
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ import (
"os"
"testing"

"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
v1 "github.com/project-radius/radius/pkg/armrpc/api/v1"
"github.com/project-radius/radius/pkg/azure/azresources"
"github.com/project-radius/radius/pkg/azure/clients"
"github.com/project-radius/radius/pkg/azure/clientv2"
"github.com/project-radius/radius/pkg/corerp/datamodel"
"github.com/project-radius/radius/pkg/corerp/handlers"
"github.com/project-radius/radius/pkg/corerp/model"
"github.com/project-radius/radius/pkg/corerp/renderers"
"github.com/project-radius/radius/pkg/corerp/renderers/container"
radiustesting "github.com/project-radius/radius/pkg/corerp/testing"
dm "github.com/project-radius/radius/pkg/linkrp/datamodel"
linkrp_dm "github.com/project-radius/radius/pkg/linkrp/datamodel"
Comment on lines -24 to 25
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

double import

linkrp_r "github.com/project-radius/radius/pkg/linkrp/renderers"
linkrp_renderers "github.com/project-radius/radius/pkg/linkrp/renderers"
"github.com/project-radius/radius/pkg/linkrp/renderers/mongodatabases"
"github.com/project-radius/radius/pkg/resourcekinds"
"github.com/project-radius/radius/pkg/resourcemodel"
Expand All @@ -34,8 +34,6 @@ import (
"github.com/project-radius/radius/pkg/ucp/store"
"github.com/project-radius/radius/pkg/ucp/ucplog"

"github.com/Azure/azure-sdk-for-go/profiles/latest/cosmos-db/mgmt/documentdb"
"github.com/Azure/go-autorest/autorest/to"
"github.com/go-logr/logr"
"github.com/golang/mock/gomock"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -181,7 +179,7 @@ func buildMongoDBLinkWithRecipe() linkrp_dm.MongoDatabase {
Application: "/subscriptions/test-sub/resourceGroups/test-group/providers/Applications.Core/applications/testApplication",
Environment: "/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Core/environments/env0",
},
Mode: dm.LinkModeRecipe,
Mode: linkrp_dm.LinkModeRecipe,
},
LinkMetadata: linkrp_dm.LinkMetadata{
RecipeData: linkrp_dm.RecipeData{
Expand All @@ -195,7 +193,7 @@ func buildMongoDBLinkWithRecipe() linkrp_dm.MongoDatabase {
},
TemplatePath: "testpublicrecipe.azurecr.io/bicep/modules/mongodatabases:v1",
},
APIVersion: clients.GetAPIVersionFromUserAgent(documentdb.UserAgent()),
APIVersion: clientv2.DocumentDBManagementClientAPIVersion,
Resources: []string{"/subscriptions/test-sub/resourceGroups/test-group/providers/Microsoft.DocumentDB/databaseAccounts/test-account",
"/subscriptions/test-sub/resourceGroups/test-group/providers/Microsoft.DocumentDB/databaseAccounts/test-account/mongodbDatabases/test-database"},
},
Expand All @@ -207,7 +205,7 @@ func buildMongoDBResourceDataWithRecipeAndSecrets() ResourceData {
testResource := buildMongoDBLinkWithRecipe()

secretValues := map[string]rp.SecretValueReference{}
secretValues[linkrp_r.ConnectionStringValue] = rp.SecretValueReference{
secretValues[linkrp_renderers.ConnectionStringValue] = rp.SecretValueReference{
LocalID: outputresource.LocalIDAzureCosmosAccount,
Action: "listConnectionStrings",
ValueSelector: "/connectionStrings/0/connectionString",
Expand All @@ -218,7 +216,7 @@ func buildMongoDBResourceDataWithRecipeAndSecrets() ResourceData {
}

computedValues := map[string]any{
linkrp_r.DatabaseNameValue: "db",
linkrp_renderers.DatabaseNameValue: "db",
}

testResource.ComputedValues = computedValues
Expand All @@ -241,10 +239,10 @@ func buildMongoDBResourceDataWithRecipeAndSecrets() ResourceData {
ResourceType: &accountResourceType,
Data: resourcemodel.ARMIdentity{
ID: "/subscriptions/test-sub/resourceGroups/test-group/providers/Microsoft.DocumentDB/databaseAccounts/test-account",
APIVersion: clients.GetAPIVersionFromUserAgent(documentdb.UserAgent()),
APIVersion: clientv2.DocumentDBManagementClientAPIVersion,
},
},
RadiusManaged: to.BoolPtr(true),
RadiusManaged: to.Ptr(true),
},
{
LocalID: outputresource.LocalIDAzureCosmosDBMongo,
Expand All @@ -254,7 +252,7 @@ func buildMongoDBResourceDataWithRecipeAndSecrets() ResourceData {
ResourceType: &dbResourceType,
Data: resourcemodel.ARMIdentity{
ID: "/subscriptions/test-sub/resourceGroups/test-group/providers/Microsoft.DocumentDB/databaseAccounts/test-account/mongodbDatabases/test-database",
APIVersion: clients.GetAPIVersionFromUserAgent(documentdb.UserAgent()),
APIVersion: clientv2.DocumentDBManagementClientAPIVersion,
},
},
Resource: map[string]any{
Expand All @@ -264,7 +262,7 @@ func buildMongoDBResourceDataWithRecipeAndSecrets() ResourceData {
},
},
},
RadiusManaged: to.BoolPtr(true),
RadiusManaged: to.Ptr(true),
Dependencies: []outputresource.Dependency{{LocalID: outputresource.LocalIDAzureCosmosAccount}},
},
}
Expand Down Expand Up @@ -386,7 +384,7 @@ func Test_Render(t *testing.T) {
BasicResourceProperties: rp.BasicResourceProperties{
Environment: "/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Core/environments/env0",
},
Mode: dm.LinkModeValues,
Mode: linkrp_dm.LinkModeValues,
},
}
mr := store.Object{
Expand Down Expand Up @@ -1092,10 +1090,10 @@ func Test_fetchSecrets(t *testing.T) {
t.Run("Get secrets from recipe data when resource has associated recipe", func(t *testing.T) {
mongoResource := buildMongoDBResourceDataWithRecipeAndSecrets()
secret := "mongodb://testUser:[email protected]:10255/db?ssl=true"
mocks.secretsValueClient.EXPECT().FetchSecret(ctx, gomock.Any(), mongoResource.SecretValues[linkrp_r.ConnectionStringValue].Action, mongoResource.SecretValues[linkrp_r.ConnectionStringValue].ValueSelector).Times(1).Return(secret, nil)
mocks.secretsValueClient.EXPECT().FetchSecret(ctx, gomock.Any(), mongoResource.SecretValues[linkrp_renderers.ConnectionStringValue].Action, mongoResource.SecretValues[linkrp_renderers.ConnectionStringValue].ValueSelector).Times(1).Return(secret, nil)
secretValues, err := dp.FetchSecrets(ctx, mongoResource)
require.NoError(t, err)
require.Equal(t, 1, len(secretValues))
require.Equal(t, secret, secretValues[linkrp_r.ConnectionStringValue])
require.Equal(t, secret, secretValues[linkrp_renderers.ConnectionStringValue])
})
}
34 changes: 17 additions & 17 deletions pkg/linkrp/frontend/deployment/deploymentprocessor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,10 @@ import (
"testing"
"time"

"github.com/Azure/azure-sdk-for-go/profiles/latest/cosmos-db/mgmt/documentdb"
"github.com/go-logr/logr"
"github.com/golang/mock/gomock"
v1 "github.com/project-radius/radius/pkg/armrpc/api/v1"
"github.com/project-radius/radius/pkg/azure/azresources"
"github.com/project-radius/radius/pkg/azure/clients"
corerpDatamodel "github.com/project-radius/radius/pkg/corerp/datamodel"
"github.com/project-radius/radius/pkg/azure/clientv2"
corerp_dm "github.com/project-radius/radius/pkg/corerp/datamodel"
"github.com/project-radius/radius/pkg/linkrp"
"github.com/project-radius/radius/pkg/linkrp/datamodel"
"github.com/project-radius/radius/pkg/linkrp/handlers"
Expand All @@ -34,6 +31,9 @@ import (
"github.com/project-radius/radius/pkg/ucp/resources"
"github.com/project-radius/radius/pkg/ucp/store"
"github.com/project-radius/radius/pkg/ucp/ucplog"

"github.com/go-logr/logr"
"github.com/golang/mock/gomock"
"github.com/stretchr/testify/require"
)

Expand Down Expand Up @@ -126,7 +126,7 @@ func buildOutputResourcesMongo(mode string) []outputresource.OutputResource {
ResourceType: &accountResourceType,
Data: resourcemodel.ARMIdentity{
ID: cosmosAccountID,
APIVersion: clients.GetAPIVersionFromUserAgent(documentdb.UserAgent()),
APIVersion: clientv2.DocumentDBManagementClientAPIVersion,
},
},
RadiusManaged: &radiusManaged,
Expand All @@ -139,7 +139,7 @@ func buildOutputResourcesMongo(mode string) []outputresource.OutputResource {
ResourceType: &dbResourceType,
Data: resourcemodel.ARMIdentity{
ID: cosmosMongoID,
APIVersion: clients.GetAPIVersionFromUserAgent(documentdb.UserAgent()),
APIVersion: clientv2.DocumentDBManagementClientAPIVersion,
},
},
Resource: map[string]any{
Expand Down Expand Up @@ -207,7 +207,7 @@ func buildRendererOutputMongo(mode string) (rendererOutput renderers.RendererOut
"name": "account-mongo-db",
},
},
APIVersion: clients.GetAPIVersionFromUserAgent(documentdb.UserAgent()),
APIVersion: clientv2.DocumentDBManagementClientAPIVersion,
Provider: resourcemodel.ProviderAzure,
}
}
Expand Down Expand Up @@ -253,13 +253,13 @@ func buildApplicationResource(namespace string) *store.Object {
namespace = "radius-test"
}

app := corerpDatamodel.Application{
app := corerp_dm.Application{
BaseResource: v1.BaseResource{
TrackedResource: v1.TrackedResource{
ID: applicationID,
},
},
Properties: corerpDatamodel.ApplicationProperties{
Properties: corerp_dm.ApplicationProperties{
BasicResourceProperties: rp.BasicResourceProperties{
Status: rp.ResourceStatus{
Compute: &rp.EnvironmentCompute{
Expand All @@ -281,14 +281,14 @@ func buildApplicationResource(namespace string) *store.Object {
}
}

func buildEnvironmentResource(recipeName string, providers *corerpDatamodel.Providers) *store.Object {
environment := corerpDatamodel.Environment{
func buildEnvironmentResource(recipeName string, providers *corerp_dm.Providers) *store.Object {
environment := corerp_dm.Environment{
BaseResource: v1.BaseResource{
TrackedResource: v1.TrackedResource{
ID: "/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Core/environments/env0",
},
},
Properties: corerpDatamodel.EnvironmentProperties{
Properties: corerp_dm.EnvironmentProperties{
Compute: rp.EnvironmentCompute{
KubernetesCompute: rp.KubernetesComputeProperties{
Namespace: "radius-test",
Expand All @@ -297,7 +297,7 @@ func buildEnvironmentResource(recipeName string, providers *corerpDatamodel.Prov
},
}
if recipeName != "" {
environment.Properties.Recipes = map[string]corerpDatamodel.EnvironmentRecipeProperties{
environment.Properties.Recipes = map[string]corerp_dm.EnvironmentRecipeProperties{
recipeName: {
LinkType: "Applications.Link/MongoDatabases",
TemplatePath: "br:sampleregistry.azureacr.io/radius/recipes/cosmosdb",
Expand Down Expand Up @@ -430,7 +430,7 @@ func Test_Render(t *testing.T) {
testRendererOutput := buildRendererOutputMongo(modeRecipe)
mocks.renderer.EXPECT().Render(gomock.Any(), gomock.Any(), gomock.Any()).Times(1).Return(testRendererOutput, nil)
mocks.dbProvider.EXPECT().GetStorageClient(gomock.Any(), gomock.Any()).Times(2).Return(mocks.db, nil)
er := buildEnvironmentResource(recipeName, &corerpDatamodel.Providers{Azure: corerpDatamodel.ProvidersAzure{Scope: "/subscriptions/testSub/resourceGroups/testGroup"}})
er := buildEnvironmentResource(recipeName, &corerp_dm.Providers{Azure: corerp_dm.ProvidersAzure{Scope: "/subscriptions/testSub/resourceGroups/testGroup"}})
mocks.db.EXPECT().Get(gomock.Any(), gomock.Any()).Times(1).Return(er, nil)
mocks.db.EXPECT().Get(gomock.Any(), gomock.Any()).Times(1).Return(buildApplicationResource(""), nil)

Expand Down Expand Up @@ -1072,7 +1072,7 @@ func Test_GetEnvironmentMetadata(t *testing.T) {
dp := deploymentProcessor{mocks.model, mocks.dbProvider, mocks.secretsValueClient, nil}
t.Run("successfully get recipe metadata", func(t *testing.T) {
mocks.dbProvider.EXPECT().GetStorageClient(gomock.Any(), gomock.Any()).Times(1).Return(mocks.db, nil)
er := buildEnvironmentResource(recipeName, &corerpDatamodel.Providers{Azure: corerpDatamodel.ProvidersAzure{Scope: "/subscriptions/testSub/resourceGroups/testGroup"}})
er := buildEnvironmentResource(recipeName, &corerp_dm.Providers{Azure: corerp_dm.ProvidersAzure{Scope: "/subscriptions/testSub/resourceGroups/testGroup"}})
env := er.Metadata.ID
mocks.db.EXPECT().Get(gomock.Any(), gomock.Any()).Times(1).Return(er, nil)

Expand All @@ -1085,7 +1085,7 @@ func Test_GetEnvironmentMetadata(t *testing.T) {

t.Run("fail to get recipe metadata", func(t *testing.T) {
mocks.dbProvider.EXPECT().GetStorageClient(gomock.Any(), gomock.Any()).Times(1).Return(mocks.db, nil)
er := buildEnvironmentResource("cosmos-test", &corerpDatamodel.Providers{Azure: corerpDatamodel.ProvidersAzure{Scope: "/subscriptions/testSub/resourceGroups/testGroup"}})
er := buildEnvironmentResource("cosmos-test", &corerp_dm.Providers{Azure: corerp_dm.ProvidersAzure{Scope: "/subscriptions/testSub/resourceGroups/testGroup"}})
env := er.Metadata.ID
mocks.db.EXPECT().Get(gomock.Any(), gomock.Any()).Times(1).Return(er, nil)

Expand Down
3 changes: 1 addition & 2 deletions pkg/linkrp/renderers/daprinvokehttproutes/renderer.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ package daprinvokehttproutes
import (
"context"

"github.com/Azure/go-autorest/autorest/to"
v1 "github.com/project-radius/radius/pkg/armrpc/api/v1"
"github.com/project-radius/radius/pkg/linkrp/datamodel"
"github.com/project-radius/radius/pkg/linkrp/renderers"
Expand All @@ -33,7 +32,7 @@ func (r Renderer) Render(ctx context.Context, dm v1.ResourceDataModel, options r
return renderers.RendererOutput{
ComputedValues: map[string]renderers.ComputedValueReference{
"appId": {
Value: to.String(&properties.AppId),
Value: properties.AppId,
Comment on lines -36 to +35
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason why we got the address of the AppId and then got the value of the address?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably just for fun. This was probably a copy-paste issue

},
},
SecretValues: map[string]rp.SecretValueReference{},
Expand Down
9 changes: 4 additions & 5 deletions pkg/linkrp/renderers/mongodatabases/renderer.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ import (
"context"
"fmt"

"github.com/Azure/azure-sdk-for-go/profiles/latest/cosmos-db/mgmt/documentdb"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
v1 "github.com/project-radius/radius/pkg/armrpc/api/v1"
"github.com/project-radius/radius/pkg/azure/azresources"
"github.com/project-radius/radius/pkg/azure/clients"
"github.com/project-radius/radius/pkg/azure/clientv2"
"github.com/project-radius/radius/pkg/linkrp"
"github.com/project-radius/radius/pkg/linkrp/datamodel"
"github.com/project-radius/radius/pkg/linkrp/renderers"
Expand Down Expand Up @@ -79,7 +78,7 @@ func RenderAzureRecipe(resource *datamodel.MongoDatabase, options renderers.Rend
recipeData := datamodel.RecipeData{
Provider: resourcemodel.ProviderAzure,
RecipeProperties: options.RecipeProperties,
APIVersion: clients.GetAPIVersionFromUserAgent(documentdb.UserAgent()),
APIVersion: clientv2.DocumentDBManagementClientAPIVersion,
}

secretValues := buildSecretValueReferenceForAzure(resource.Properties)
Expand Down Expand Up @@ -153,7 +152,7 @@ func RenderAzureResource(properties datamodel.MongoDatabaseProperties) (renderer
},
RadiusManaged: to.Ptr(false),
}
cosmosAccountResource.Identity = resourcemodel.NewARMIdentity(&cosmosAccountResource.ResourceType, cosmosMongoAccountID.String(), clients.GetAPIVersionFromUserAgent(documentdb.UserAgent()))
cosmosAccountResource.Identity = resourcemodel.NewARMIdentity(&cosmosAccountResource.ResourceType, cosmosMongoAccountID.String(), clientv2.DocumentDBManagementClientAPIVersion)

databaseResource := outputresource.OutputResource{
LocalID: outputresource.LocalIDAzureCosmosDBMongo,
Expand All @@ -168,7 +167,7 @@ func RenderAzureResource(properties datamodel.MongoDatabaseProperties) (renderer
},
},
}
databaseResource.Identity = resourcemodel.NewARMIdentity(&databaseResource.ResourceType, cosmosMongoDBID.String(), clients.GetAPIVersionFromUserAgent(documentdb.UserAgent()))
databaseResource.Identity = resourcemodel.NewARMIdentity(&databaseResource.ResourceType, cosmosMongoDBID.String(), clientv2.DocumentDBManagementClientAPIVersion)

return renderers.RendererOutput{
Resources: []outputresource.OutputResource{cosmosAccountResource, databaseResource},
Expand Down
20 changes: 10 additions & 10 deletions pkg/linkrp/renderers/mongodatabases/renderer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ import (
"context"
"testing"

"github.com/Azure/azure-sdk-for-go/profiles/latest/cosmos-db/mgmt/documentdb"
"github.com/Azure/go-autorest/autorest/to"
v1 "github.com/project-radius/radius/pkg/armrpc/api/v1"
"github.com/project-radius/radius/pkg/azure/azresources"
"github.com/project-radius/radius/pkg/azure/clients"
"github.com/project-radius/radius/pkg/azure/clientv2"
"github.com/project-radius/radius/pkg/linkrp"
"github.com/project-radius/radius/pkg/linkrp/datamodel"
"github.com/project-radius/radius/pkg/linkrp/renderers"
"github.com/project-radius/radius/pkg/resourcekinds"
"github.com/project-radius/radius/pkg/resourcemodel"
"github.com/project-radius/radius/pkg/rp"
"github.com/project-radius/radius/pkg/rp/outputresource"

"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/stretchr/testify/require"
)

Expand Down Expand Up @@ -66,24 +66,24 @@ func Test_Render_Success(t *testing.T) {
{
LocalID: outputresource.LocalIDAzureCosmosAccount,
ResourceType: accountResourceType,
RadiusManaged: to.BoolPtr(false),
RadiusManaged: to.Ptr(false),
Identity: resourcemodel.ResourceIdentity{
ResourceType: &accountResourceType,
Data: resourcemodel.ARMIdentity{
ID: "/subscriptions/test-sub/resourceGroups/test-group/providers/Microsoft.DocumentDB/databaseAccounts/test-account",
APIVersion: clients.GetAPIVersionFromUserAgent(documentdb.UserAgent()),
APIVersion: clientv2.DocumentDBManagementClientAPIVersion,
},
},
},
{
LocalID: outputresource.LocalIDAzureCosmosDBMongo,
ResourceType: dbResourceType,
RadiusManaged: to.BoolPtr(false),
RadiusManaged: to.Ptr(false),
Identity: resourcemodel.ResourceIdentity{
ResourceType: &dbResourceType,
Data: resourcemodel.ARMIdentity{
ID: "/subscriptions/test-sub/resourceGroups/test-group/providers/Microsoft.DocumentDB/databaseAccounts/test-account/mongodbDatabases/test-database",
APIVersion: clients.GetAPIVersionFromUserAgent(documentdb.UserAgent()),
APIVersion: clientv2.DocumentDBManagementClientAPIVersion,
},
},
Dependencies: []outputresource.Dependency{
Expand Down Expand Up @@ -374,7 +374,7 @@ func Test_Render_Recipe_Success(t *testing.T) {
Type: resourcekinds.AzureCosmosAccount,
Provider: resourcemodel.ProviderAzure,
},
RadiusManaged: to.BoolPtr(true),
RadiusManaged: to.Ptr(true),
ProviderResourceType: azresources.DocumentDBDatabaseAccounts,
},
{
Expand All @@ -383,7 +383,7 @@ func Test_Render_Recipe_Success(t *testing.T) {
Type: resourcekinds.AzureCosmosDBMongo,
Provider: resourcemodel.ProviderAzure,
},
RadiusManaged: to.BoolPtr(true),
RadiusManaged: to.Ptr(true),
ProviderResourceType: azresources.DocumentDBDatabaseAccounts + "/" + azresources.DocumentDBDatabaseAccountsMongoDBDatabases,
Dependencies: []outputresource.Dependency{{LocalID: outputresource.LocalIDAzureCosmosAccount}},
},
Expand All @@ -408,7 +408,7 @@ func Test_Render_Recipe_Success(t *testing.T) {
require.Equal(t, mongoDBResource.Properties.Recipe.Name, output.RecipeData.Name)
require.Equal(t, mongoDBResource.Properties.Recipe.Parameters, output.RecipeData.Parameters)
require.Equal(t, "testpublicrecipe.azurecr.io/bicep/modules/mongodatabases:v1", output.RecipeData.TemplatePath)
require.Equal(t, clients.GetAPIVersionFromUserAgent(documentdb.UserAgent()), output.RecipeData.APIVersion)
require.Equal(t, clientv2.DocumentDBManagementClientAPIVersion, output.RecipeData.APIVersion)

// Secrets
require.Equal(t, 1, len(output.SecretValues))
Expand Down
Loading