Documentation
¶
Overview ¶
Copyright 2023 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.
Index ¶
- func NewCommand(factory framework.Factory) (*cobra.Command, framework.Runner)
- func NewProgessModel(options initOptions) tea.Model
- func NewSummaryModel(options initOptions) tea.Model
- type Runner
- func (r *Runner) CreateEnvironment(ctx context.Context) error
- func (r *Runner) Run(ctx context.Context) error
- func (r *Runner) UpdateApplicationOptions(scaffold bool, name string)
- func (r *Runner) UpdateCloudProviderOptions(azure *azure.Provider, aws *cli_aws.Provider)
- func (r *Runner) UpdateClusterOptions(install bool, ns, ctx, version string)
- func (r *Runner) UpdateEnvironmentOptions(create bool, name, ns string)
- func (r *Runner) Validate(cmd *cobra.Command, args []string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCommand ¶
This function "NewCommand" creates a new Cobra command with flags and a runner, which can be used to initialize the Radius control-plane.
func NewProgessModel ¶
NewProgessModel creates a new model for the initialization progress dialog shown during 'rad init'.
func NewSummaryModel ¶
NewSummaryModel creates a new model for the options summary shown during 'rad init'.
Types ¶
type Runner ¶
type Runner struct {
// ConfigFileInterface is the interface for the config file.
ConfigFileInterface framework.ConfigFileInterface
// ConfigHolder is the interface for the config holder.
ConfigHolder *framework.ConfigHolder
// ConnectionFactory is the interface for the connection factory.
ConnectionFactory connections.Factory
// HelmInterface is the interface for the helm client.
HelmInterface helm.Interface
// KubernetesInterface is the interface for the kubernetes client.
KubernetesInterface kubernetes.Interface
// Output is the interface for console output.
Output output.Interface
// Prompter is the interface for the prompter.
Prompter prompt.Interface
// RadiusCoreClientFactory is the client factory for Radius.Core resources.
// If nil, it will be initialized during Run.
RadiusCoreClientFactory *corerpv20250801.ClientFactory
// DefaultScopeClientFactory is the client factory scoped to the default resource group.
// The default recipe pack is always created/queried in the default scope.
DefaultScopeClientFactory *corerpv20250801.ClientFactory
// Format is the output format.
Format string
// Workspace is the workspace to use. This will be populated by Validate.
Workspace *workspaces.Workspace
// Full determines whether or not we ask the user for all options.
Full bool
// Set is the list of additional Helm values to set.
Set []string
// SetFile is the list of additional Helm values from files.
SetFile []string
// Options provides the options to used for Radius initialization. This will be populated by Validate.
Options *initOptions
// contains filtered or unexported fields
}
Runner is the runner implementation for the `rad init` command.
func NewRunner ¶
NewRunner creates a new Runner struct with the given factory's ConfigHolder, Output, ConnectionFactory, Prompter, ConfigFileInterface, KubernetesInterface, HelmInterface, AWSClient, and AzureClient.
func (*Runner) CreateEnvironment ¶ added in v0.27.0
func (*Runner) Run ¶
Run creates a progress channel, installs the radius control plane, creates an environment, configures cloud providers, scaffolds an application, and updates the config file, all while displaying progress updates to the UI.
func (*Runner) UpdateApplicationOptions ¶ added in v0.27.0
UpdateApplicationOptions updates the application options with the provided values.
func (*Runner) UpdateCloudProviderOptions ¶ added in v0.27.0
UpdateCloudProviderOptions updates the cloud provider options with the provided values.
func (*Runner) UpdateClusterOptions ¶ added in v0.27.0
UpdateClusterOptions updates the cluster options with the provided values.
func (*Runner) UpdateEnvironmentOptions ¶ added in v0.27.0
UpdateEnvironmentOptions updates the environment options with the provided values.
func (*Runner) Validate ¶
Validate gathers input from the user, creates a workspace and options, and confirms the options with the user before returning the options and workspace. If the user does not confirm the options, the function will loop and gather input again. If an error occurs, the function will return an error.