create

package
v0.59.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 18, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCommand

func NewCommand(factory framework.Factory) (*cobra.Command, framework.Runner)

NewCommand creates a new Cobra command and a Runner to handle the command's logic, and adds flags to the command for workspace, resource group, environment name, force and context.

func ValidateApplicationsCoreEnvironment added in v0.59.0

func ValidateApplicationsCoreEnvironment(ctx context.Context, ws *workspaces.Workspace, mgmtClient clients.ApplicationsManagementClient, envName string) (string, error)

ValidateApplicationsCoreEnvironment is the default EnvironmentValidator. It targets Applications.Core/environments via the management client.

func ValidateArgs

func ValidateArgs() cobra.PositionalArgs

ValidateArgs checks if the number of arguments passed to the command is between 1 and 2, and if the first argument is "kubernetes", and returns an error if either of these conditions are not met.

Types

type EnvironmentValidator added in v0.59.0

type EnvironmentValidator func(ctx context.Context, ws *workspaces.Workspace, mgmtClient clients.ApplicationsManagementClient, envName string) (envID string, err error)

EnvironmentValidator validates that the environment named envName exists in the scope of ws, and returns the fully-qualified environment resource ID to be persisted on the workspace. mgmtClient is the management client already created for the workspace scope; implementations are free to ignore it (e.g. preview implementations that talk to the Radius.Core resource provider directly).

type Runner

type Runner struct {
	ConfigHolder        *framework.ConfigHolder
	ConnectionFactory   connections.Factory
	Workspace           *workspaces.Workspace
	Force               bool
	ConfigFileInterface framework.ConfigFileInterface
	Output              output.Interface
	HelmInterface       helm.Interface
	KubernetesInterface kubernetes.Interface

	// EnvironmentValidator is invoked to validate that the requested environment exists
	// and to construct the environment resource ID stored on the workspace. When nil,
	// the legacy Applications.Core/environments validator is used.
	EnvironmentValidator EnvironmentValidator
}

Runner is the runner implementation for the `rad workspace create` command.

func NewRunner

func NewRunner(factory framework.Factory) *Runner

NewRunner creates a new instance of the `rad workspace create` runner.

func (*Runner) Run

func (r *Runner) Run(ctx context.Context) error

Run creates a workspace and sets it as the current workspace, returning an error if any occurs during the process."

func (*Runner) Validate

func (r *Runner) Validate(cmd *cobra.Command, args []string) error

Validate checks if the given workspace name is valid, if the given Kubernetes context is valid, if the Radius control plane is installed on the target platform, if the workspace already exists, if the user has specified the --force flag, if the given resource group and environment exist, and returns an error if any of these checks fail.

Directories

Path Synopsis
Package preview implements the `rad workspace create --preview` command.
Package preview implements the `rad workspace create --preview` command.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL