radinit

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Overview

Package radinit is a generated GoMock package.

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

Constants

View Source
const (
	// QueryRegion is the region used for querying AWS before the user selects a region.
	QueryRegion = "us-east-1"
)
View Source
const (
	// RecipeRepositoryPrefix is the prefix for the repository path.
	RecipeRepositoryPrefix = "ghcr.io/radius-project/recipes/local-dev/"
)

Variables

This section is empty.

Functions

func NewCommand

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

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

func NewProgessModel(options initOptions) tea.Model

NewProgessModel creates a new model for the initialization progress dialog shown during 'rad init'.

func NewSummaryModel

func NewSummaryModel(options initOptions) tea.Model

NewSummaryModel creates a new model for the options summary shown during 'rad init'.

Types

type DevRecipe added in v0.27.0

type DevRecipe struct {
	// NormalizedName is the normalized name of the recipe.
	//
	// For example, "mongodatabases".
	NormalizedName string

	// ResourceType is the resource type of the recipe.
	//
	// For example, "Applications.Datastores/mongoDatabases".
	ResourceType string

	// RepoPath is the repository path of the recipe.
	//
	// For example, "ghcr.io/radius-project/recipes/local-dev/mongodatabases".
	RepoPath string
}

func AvailableDevRecipes added in v0.27.0

func AvailableDevRecipes() []DevRecipe

AvailableDevRecipes returns the list of available dev recipes.

If we want to add a new recipe, we need to add it here.

type DevRecipeClient

type DevRecipeClient interface {
	GetDevRecipes(ctx context.Context) (map[string]map[string]corerp.RecipePropertiesClassification, error)
}

func NewDevRecipeClient

func NewDevRecipeClient() DevRecipeClient

NewDevRecipeClient creates a new DevRecipeClient object and returns it.

type MockDevRecipeClient

type MockDevRecipeClient struct {
	// contains filtered or unexported fields
}

MockDevRecipeClient is a mock of DevRecipeClient interface.

func NewMockDevRecipeClient

func NewMockDevRecipeClient(ctrl *gomock.Controller) *MockDevRecipeClient

NewMockDevRecipeClient creates a new mock instance.

func (*MockDevRecipeClient) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockDevRecipeClient) GetDevRecipes

GetDevRecipes mocks base method.

type MockDevRecipeClientMockRecorder

type MockDevRecipeClientMockRecorder struct {
	// contains filtered or unexported fields
}

MockDevRecipeClientMockRecorder is the mock recorder for MockDevRecipeClient.

func (*MockDevRecipeClientMockRecorder) GetDevRecipes

func (mr *MockDevRecipeClientMockRecorder) GetDevRecipes(arg0 interface{}) *gomock.Call

GetDevRecipes indicates an expected call of GetDevRecipes.

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

	// DevRecipeClient is the interface for the dev recipe client.
	DevRecipeClient DevRecipeClient

	// 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

	// 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

func NewRunner(factory framework.Factory) *Runner

NewRunner creates a new Runner struct with the given factory's ConfigHolder, Output, ConnectionFactory, Prompter, ConfigFileInterface, KubernetesInterface, HelmInterface, DevRecipeClient, AWSClient, and AzureClient.

func (*Runner) CreateEnvironment added in v0.27.0

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

func (*Runner) Run

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

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

func (r *Runner) UpdateApplicationOptions(scaffold bool, name string)

UpdateApplicationOptions updates the application options with the provided values.

func (*Runner) UpdateCloudProviderOptions added in v0.27.0

func (r *Runner) UpdateCloudProviderOptions(azure *azure.Provider, aws *cli_aws.Provider)

UpdateCloudProviderOptions updates the cloud provider options with the provided values.

func (*Runner) UpdateClusterOptions added in v0.27.0

func (r *Runner) UpdateClusterOptions(install bool, ns, ctx, version string)

UpdateClusterOptions updates the cluster options with the provided values.

func (*Runner) UpdateEnvironmentOptions added in v0.27.0

func (r *Runner) UpdateEnvironmentOptions(create bool, name, ns string)

UpdateEnvironmentOptions updates the environment options with the provided values.

func (*Runner) UpdateRecipePackOptions added in v0.27.0

func (r *Runner) UpdateRecipePackOptions(devRecipes bool)

UpdateRecipePackOptions updates the recipe pack options with the provided values.

func (*Runner) Validate

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

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.

Jump to

Keyboard shortcuts

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