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

Add recipe support to extenders #5706

Merged
merged 16 commits into from
Jun 19, 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
6 changes: 6 additions & 0 deletions cadl/Applications.Link/extenders.cadl
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ model ExtenderProperties extends BasicResourceProperties {

@doc("The secrets value for the resource")
secrets?: ExtenderSecrets;

@doc("The recipe used to automatically deploy underlying infrastructure for the Extender")
recipe?: Recipe;

@doc("Specifies how the underlying service/resource is provisioned and managed.")
resourceProvisioning?: ResourceProvisioning;
}

#suppress "@azure-tools/cadl-azure-resource-manager/arm-resource-operation-outside-interface" "This is an interface template"
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,9 @@
* **application**: string: Fully qualified resource ID for the application that the link is consumed by
* **environment**: string (Required): Fully qualified resource ID for the environment that the link is linked to
* **provisioningState**: 'Accepted' | 'Canceled' | 'Deleting' | 'Failed' | 'Provisioning' | 'Succeeded' | 'Updating' (ReadOnly): Provisioning state of the link at the time the operation was called
* **secrets**: [ExtenderSecrets](#extendersecrets) (WriteOnly): The secret values for the given Extender resource
* **recipe**: [Recipe](#recipe): The recipe used to automatically deploy underlying infrastructure for a link
* **resourceProvisioning**: 'manual' | 'recipe': Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values.
* **secrets**: [ExtenderSecrets](#extendersecrets): The secret values for the given Extender resource
* **status**: [ResourceStatus](#resourcestatus) (ReadOnly): Status of a resource.
### Additional Properties
* **Additional Properties Type**: any
Expand Down
2 changes: 1 addition & 1 deletion hack/bicep-types-radius/generated/index.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"Resources":{"Applications.Core/environments@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":51},"Applications.Core/applications@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":75},"Applications.Core/httpRoutes@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":89},"Applications.Core/gateways@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":110},"Applications.Core/containers@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":175},"Applications.Core/volumes@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":212},"Applications.Core/secretStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":235},"Applications.Core/extenders@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":250},"Applications.Dapr/daprPubSubBrokers@2022-03-15-privatepreview":{"RelativePath":"applications/applications.dapr/2022-03-15-privatepreview/types.json","Index":41},"Applications.Dapr/daprSecretStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.dapr/2022-03-15-privatepreview/types.json","Index":59},"Applications.Dapr/daprStateStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.dapr/2022-03-15-privatepreview/types.json","Index":79},"Applications.Datastores/mongoDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":42},"Applications.Datastores/redisCaches@2022-03-15-privatepreview":{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":63},"Applications.Datastores/sqlDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":83},"Applications.Link/daprPubSubBrokers@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":40},"Applications.Link/daprSecretStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":57},"Applications.Link/daprStateStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":75},"Applications.Link/mongoDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":94},"Applications.Link/rabbitMQMessageQueues@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":112},"Applications.Link/redisCaches@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":131},"Applications.Link/sqlDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":150},"Applications.Link/extenders@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":165},"Applications.Messaging/rabbitMQQueues@2022-03-15-privatepreview":{"RelativePath":"applications/applications.messaging/2022-03-15-privatepreview/types.json","Index":40}},"Functions":{"applications.core/secretstores":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":256}]},"applications.core/extenders":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":258}]},"applications.datastores/mongodatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":85}]},"applications.datastores/rediscaches":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":87}]},"applications.link/mongodatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":167}]},"applications.link/rabbitmqmessagequeues":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":169}]},"applications.link/rediscaches":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":171}]},"applications.link/sqldatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":173}]},"applications.link/extenders":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":175}]},"applications.messaging/rabbitmqqueues":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.messaging/2022-03-15-privatepreview/types.json","Index":42}]}}}
{"Resources":{"Applications.Core/environments@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":51},"Applications.Core/applications@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":75},"Applications.Core/httpRoutes@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":89},"Applications.Core/gateways@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":110},"Applications.Core/containers@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":175},"Applications.Core/volumes@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":212},"Applications.Core/secretStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":235},"Applications.Core/extenders@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":250},"Applications.Dapr/daprPubSubBrokers@2022-03-15-privatepreview":{"RelativePath":"applications/applications.dapr/2022-03-15-privatepreview/types.json","Index":41},"Applications.Dapr/daprSecretStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.dapr/2022-03-15-privatepreview/types.json","Index":59},"Applications.Dapr/daprStateStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.dapr/2022-03-15-privatepreview/types.json","Index":79},"Applications.Datastores/mongoDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":42},"Applications.Datastores/redisCaches@2022-03-15-privatepreview":{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":63},"Applications.Datastores/sqlDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":83},"Applications.Link/daprPubSubBrokers@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":40},"Applications.Link/daprSecretStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":57},"Applications.Link/daprStateStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":75},"Applications.Link/mongoDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":94},"Applications.Link/rabbitMQMessageQueues@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":112},"Applications.Link/redisCaches@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":131},"Applications.Link/sqlDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":150},"Applications.Link/extenders@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":168},"Applications.Messaging/rabbitMQQueues@2022-03-15-privatepreview":{"RelativePath":"applications/applications.messaging/2022-03-15-privatepreview/types.json","Index":40}},"Functions":{"applications.core/secretstores":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":256}]},"applications.core/extenders":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":258}]},"applications.datastores/mongodatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":85}]},"applications.datastores/rediscaches":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":87}]},"applications.link/mongodatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":170}]},"applications.link/rabbitmqmessagequeues":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":172}]},"applications.link/rediscaches":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":174}]},"applications.link/sqldatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":176}]},"applications.link/extenders":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":178}]},"applications.messaging/rabbitmqqueues":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.messaging/2022-03-15-privatepreview/types.json","Index":42}]}}}
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,15 @@ func (src *ExtenderResource) ConvertTo() (v1.DataModelInterface, error) {
},
AdditionalProperties: src.Properties.AdditionalProperties,
Secrets: src.Properties.Secrets,
Recipe: toRecipeDataModel(src.Properties.Recipe),
},
}

var err error
converted.Properties.ResourceProvisioning, err = toResourceProvisiongDataModel(src.Properties.ResourceProvisioning)
if err != nil {
return nil, err
}
return converted, nil
}

Expand All @@ -72,7 +79,8 @@ func (dst *ExtenderResource) ConvertFrom(src v1.DataModelInterface) error {
Environment: to.Ptr(extender.Properties.Environment),
Application: to.Ptr(extender.Properties.Application),
AdditionalProperties: extender.Properties.AdditionalProperties,

Recipe: fromRecipeDataModel(extender.Properties.Recipe),
ResourceProvisioning: fromResourceProvisioningDataModel(extender.Properties.ResourceProvisioning),
// Secrets are omitted.
}
return nil
Expand Down
Loading