Documentation
¶
Index ¶
- Constants
- func CheckIfRecipeExists(ctx context.Context, client clients.ApplicationsManagementClient, ...) (corerp.EnvironmentResource, ...)
- func CreateEnvProviders(providersList []any) (corerp.Providers, error)
- func DeleteResourcesInParallel(ctx context.Context, client clients.ApplicationsManagementClient, ...) error
- func GetNamespace(envResource corerp.EnvironmentResource) string
- func InitializeClientFactory(ctx context.Context, workspace *workspaces.Workspace) (*v20231001preview.ClientFactory, error)
- func InitializeRadiusCoreClientFactory(ctx context.Context, workspace *workspaces.Workspace) (*v20250801preview.ClientFactory, error)
- func ListPreviewApplicationsInEnvironment(ctx context.Context, client *corerpv20250801.ApplicationsClient, ...) ([]corerpv20250801.ApplicationResource, error)
- func PopulateRecipePackClients(ctx context.Context, workspace *workspaces.Workspace, ...) error
- func PreviewApplicationID(scope string, applicationName string) string
- func PreviewEnvironmentID(scope string, environmentName string) string
- func PreviewResourceID(scope string, resourceType string, name string) string
Constants ¶
const MsgDeletingResource = " Deleting %s..."
MsgDeletingResource is logged for each resource before its deletion is started.
const MsgSkippingResource = " Warning: skipping %s because its resource ID or type is missing. It must be deleted manually."
MsgSkippingResource is logged for each resource the cascade cannot delete, so the count shown in the confirmation prompt cannot quietly disagree with what was actually deleted.
Variables ¶
This section is empty.
Functions ¶
func CheckIfRecipeExists ¶
func CheckIfRecipeExists(ctx context.Context, client clients.ApplicationsManagementClient, environmentName string, recipeName string, resourceType string) (corerp.EnvironmentResource, map[string]map[string]corerp.RecipePropertiesClassification, error)
CheckIfRecipeExists checks if a given recipe exists in a given environment and returns the environment resource, recipe properties and an error if the recipe does not exist.
func CreateEnvProviders ¶
CreateEnvProviders iterates through a list of providers and creates a corerp.Providers object with the appropriate scopes for each provider type (Azure or AWS). If more than one provider of the same type is found, an error is returned.
If an invalid type is found, an error is returned.
func DeleteResourcesInParallel ¶ added in v0.61.0
func DeleteResourcesInParallel(ctx context.Context, client clients.ApplicationsManagementClient, out output.Interface, resources []generated.GenericResource, force bool) error
DeleteResourcesInParallel deletes the given resources concurrently, tolerating resources that have already been deleted. The ID of each resource is logged before its deletion is started, because output.Interface implementations are not guaranteed to be thread-safe and logging up front keeps the output deterministic.
A resource missing an ID or type cannot be addressed and is skipped with a warning rather than silently dropped, so the caller's reported count cannot disagree with what was deleted.
Deletions are limited to maxParallelDeletes at a time. On the first failure errgroup cancels the shared context, which abandons every other delete. Those deletes are left in mixed states: some were already accepted by the server and are still running there, some were canceled before the request was sent, and some queued behind the concurrency limit may never have started. The command reports a single error, so the outcome of the rest is unknown. Re-running the command is the way to converge, which is safe because deleting an already-deleted resource is treated as success.
func GetNamespace ¶
func GetNamespace(envResource corerp.EnvironmentResource) string
GetNamespace takes in an EnvironmentResource object and returns a string representing the namespace associated with the KubernetesCompute object, or an empty string if the Compute property is not a KubernetesCompute object.
func InitializeClientFactory ¶ added in v0.48.0
func InitializeClientFactory(ctx context.Context, workspace *workspaces.Workspace) (*v20231001preview.ClientFactory, error)
InitializeClientFactory initializes a new v20231001preview.ClientFactory using the provided workspace context. It connects to the workspace and creates a new client factory with anonymous credentials. If the connection fails, it returns an error.
func InitializeRadiusCoreClientFactory ¶ added in v0.54.0
func InitializeRadiusCoreClientFactory(ctx context.Context, workspace *workspaces.Workspace) (*v20250801preview.ClientFactory, error)
InitializeRadiusCoreClientFactory initializes a new v20250801preview.ClientFactory using the provided workspace context. It connects to the workspace and creates a new client factory with anonymous credentials. If the connection fails, it returns an error.
func ListPreviewApplicationsInEnvironment ¶ added in v0.61.0
func ListPreviewApplicationsInEnvironment(ctx context.Context, client *corerpv20250801.ApplicationsClient, workspace *workspaces.Workspace, environmentID string) ([]corerpv20250801.ApplicationResource, error)
ListPreviewApplicationsInEnvironment lists the Radius.Core applications in the workspace scope whose properties.environment references the given environment ID.
func PopulateRecipePackClients ¶ added in v0.58.0
func PopulateRecipePackClients( ctx context.Context, workspace *workspaces.Workspace, clientsByScope map[string]*v20250801preview.RecipePacksClient, packIDs []string, ) error
PopulateRecipePackClients adds a RecipePacksClient to clientsByScope for every scope referenced by packIDs that is not already in the map. Callers seed the map with workspace-scope and default-scope clients before calling this function.
func PreviewApplicationID ¶ added in v0.61.0
PreviewApplicationID builds a fully qualified Radius.Core application ID.
func PreviewEnvironmentID ¶ added in v0.61.0
PreviewEnvironmentID builds a fully qualified Radius.Core environment ID.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
app
|
|
|
bicep
|
|
|
env
|
|
|
namespace
Package namespace is a generated GoMock package.
|
Package namespace is a generated GoMock package. |
|
Package radinit is a generated GoMock package.
|
Package radinit is a generated GoMock package. |
|
recipepack
|
|
|
resource
|
|
|
resourceprovider
|
|
|
resourcetype
|
|
|
Package shutdown implements the `rad shutdown` command, which backs up all durable Radius state (PostgreSQL control-plane databases and Terraform state Secrets) for the current workspace to a state archive.
|
Package shutdown implements the `rad shutdown` command, which backs up all durable Radius state (PostgreSQL control-plane databases and Terraform state Secrets) for the current workspace to a state archive. |
|
Package startup implements the `rad startup` command, which restores durable Radius state (PostgreSQL control-plane databases and Terraform state Secrets) previously saved by `rad shutdown` into the current workspace's running control plane.
|
Package startup implements the `rad startup` command, which restores durable Radius state (PostgreSQL control-plane databases and Terraform state Secrets) previously saved by `rad shutdown` into the current workspace's running control plane. |
|
workspace
|
|
|
create/preview
Package preview implements the `rad workspace create --preview` command.
|
Package preview implements the `rad workspace create --preview` command. |