cmd

package
v0.10.0 Latest Latest
Warning

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

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

Documentation

Overview

Package cmd implements capioperator commands.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = fmt.Errorf("resource was not found")
)
View Source
var RootCmd = &cobra.Command{
	Use:          "capioperator",
	SilenceUsage: true,
	Short:        "capioperator controls the lifecycle of a Cluster API management cluster",
	Long: LongDesc(`
		Get started with Cluster API using capioperator to create a management cluster,
		install providers, and create templates for your workload cluster.`),
	PersistentPostRunE: func(cmd *cobra.Command, args []string) error {
		return nil
	},
}

RootCmd is capioperator root CLI command.

Functions

func CheckDeploymentAvailability added in v0.9.0

func CheckDeploymentAvailability(ctx context.Context, client ctrlclient.Client, labels map[string]string) (bool, error)

CheckDeploymentAvailability checks if the deployment with given labels is available.

func CreateKubeClient added in v0.8.0

func CreateKubeClient(kubeconfigPath, kubeconfigContext string) (ctrlclient.Client, error)

CreateKubeClient creates a kubernetes client from provided kubeconfig and kubecontext.

func EnsureNamespaceExists added in v0.9.0

func EnsureNamespaceExists(ctx context.Context, client ctrlclient.Client, namespace string) error

func Examples

func Examples(s string) string

Examples normalizes a command's examples to follow the conventions.

func Execute

func Execute()

Execute executes the root command.

func GetDeploymentByLabels added in v0.9.0

func GetDeploymentByLabels(ctx context.Context, client ctrlclient.Client, labels map[string]string) (*appsv1.Deployment, error)

GetDeploymentByLabels fetches deployment based on the provided labels.

func GetKubeconfigLocation added in v0.9.0

func GetKubeconfigLocation() string

GetKubeconfigLocation will read the environment variable $KUBECONFIG otherwise set it to ~/.kube/config.

func GetLatestRelease added in v0.10.0

func GetLatestRelease(ctx context.Context, repo repository.Repository) (string, error)

GetLatestRelease returns the latest patch release.

func LongDesc

func LongDesc(s string) string

LongDesc normalizes a command's long description to follow the conventions.

func NewGenericProvider added in v0.9.0

func NewGenericProvider(providerType clusterctlv1.ProviderType) operatorv1.GenericProvider

Types

type DeleteGroup added in v0.9.0

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

type Version added in v0.8.0

type Version struct {
	ClientVersion *version.Info `json:"capioperator"`
}

Version provides the version information of CAPI operator.

Jump to

Keyboard shortcuts

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