cmd

package
v0.20.0-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 68 Imported by: 1

Documentation

Index

Constants

View Source
const LoftChartRepo = "https://charts.loft.sh"

Variables

View Source
var AllowedDistros = []string{"k8s", "k3s", "k0s", "eks"}
View Source
var CreatedByVClusterAnnotation = "vcluster.loft.sh/created"

Functions

func BuildRoot

func BuildRoot(log log.Logger) (*cobra.Command, error)

BuildRoot creates a new root command from the

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func GetHelmBinaryPath added in v0.12.0

func GetHelmBinaryPath(ctx context.Context, log log.BaseLogger) (string, error)

GetHelmBinaryPath checks for helm binary and downloads if it's not present.

func GetVClusterNamespace added in v0.16.0

func GetVClusterNamespace(ctx context.Context, context, name, namespace string, log log.Logger) (string, error)

func NewConnectCmd

func NewConnectCmd(globalFlags *flags.GlobalFlags) *cobra.Command

NewConnectCmd creates a new command

func NewCreateCmd

func NewCreateCmd(globalFlags *flags.GlobalFlags) *cobra.Command

NewCreateCmd creates a new command

func NewDeleteCmd

func NewDeleteCmd(globalFlags *flags.GlobalFlags) *cobra.Command

NewDeleteCmd creates a new command

func NewDisconnectCmd added in v0.10.0

func NewDisconnectCmd(globalFlags *flags.GlobalFlags) *cobra.Command

NewDisconnectCmd creates a new command

func NewImportCmd added in v0.16.0

func NewImportCmd(globalFlags *flags.GlobalFlags) (*cobra.Command, error)

func NewInfoCmd added in v0.19.0

func NewInfoCmd() *cobra.Command

NewInfoCmd creates a new info command

func NewListCmd added in v0.2.0

func NewListCmd(globalFlags *flags.GlobalFlags) *cobra.Command

NewListCmd creates a new command

func NewLoginCmd added in v0.16.0

func NewLoginCmd(globalFlags *flags.GlobalFlags) (*cobra.Command, error)

func NewLogoutCmd added in v0.16.0

func NewLogoutCmd(globalFlags *flags.GlobalFlags) (*cobra.Command, error)

func NewPauseCmd added in v0.6.0

func NewPauseCmd(globalFlags *flags.GlobalFlags) *cobra.Command

NewPauseCmd creates a new command

func NewResumeCmd added in v0.6.0

func NewResumeCmd(globalFlags *flags.GlobalFlags) *cobra.Command

NewResumeCmd creates a new command

func NewRootCmd

func NewRootCmd(log log.Logger) *cobra.Command

NewRootCmd returns a new root command

func NewUICmd added in v0.16.0

func NewUICmd(globalFlags *flags.GlobalFlags) (*cobra.Command, error)

func NewUpgradeCmd added in v0.2.0

func NewUpgradeCmd() *cobra.Command

NewUpgradeCmd creates a new upgrade command

Types

type ConnectCmd

type ConnectCmd struct {
	*flags.GlobalFlags

	Log log.Logger

	ServiceAccountClusterRole string
	PodName                   string
	Address                   string
	KubeConfigContextName     string
	Server                    string
	KubeConfig                string
	ServiceAccount            string
	LocalPort                 int
	ServiceAccountExpiration  int
	Print                     bool
	UpdateCurrent             bool
	BackgroundProxy           bool

	Insecure bool
	// contains filtered or unexported fields
}

ConnectCmd holds the cmd flags

func (*ConnectCmd) Connect added in v0.3.2

func (cmd *ConnectCmd) Connect(ctx context.Context, vClusterName string, command []string) error

func (*ConnectCmd) Run

func (cmd *ConnectCmd) Run(ctx context.Context, args []string) error

Run executes the functionality

type CreateCmd

type CreateCmd struct {
	*flags.GlobalFlags

	Options
	// contains filtered or unexported fields
}

CreateCmd holds the login cmd flags

func (*CreateCmd) Run

func (cmd *CreateCmd) Run(ctx context.Context, args []string) error

Run executes the functionality

func (*CreateCmd) ToChartOptions added in v0.6.0

func (cmd *CreateCmd) ToChartOptions(kubernetesVersion *version.Info, log log.Logger) (*config.ExtraValuesOptions, error)

type DeleteCmd

type DeleteCmd struct {
	*flags.GlobalFlags

	Wait                bool
	KeepPVC             bool
	DeleteNamespace     bool
	DeleteConfigMap     bool
	AutoDeleteNamespace bool
	IgnoreNotFound      bool
	// contains filtered or unexported fields
}

DeleteCmd holds the delete cmd flags

func (*DeleteCmd) Run

func (cmd *DeleteCmd) Run(cobraCmd *cobra.Command, args []string) error

Run executes the functionality

type DisconnectCmd added in v0.10.0

type DisconnectCmd struct {
	*flags.GlobalFlags
	// contains filtered or unexported fields
}

DisconnectCmd holds the disconnect cmd flags

func (*DisconnectCmd) Run added in v0.10.0

func (cmd *DisconnectCmd) Run() error

Run executes the functionality

type HelmChart

type HelmChart struct {
	Bundle    string      `json:"bundle,omitempty"    mapstructure:"bundle,omitempty"`
	Name      string      `json:"name,omitempty"      mapstructure:"name"`
	Repo      string      `json:"repo,omitempty"      mapstructure:"repo"`
	Version   string      `json:"version,omitempty"   mapstructure:"version"`
	Namespace string      `json:"namespace,omitempty" mapstructure:"namespace"`
	Values    string      `json:"values,omitempty"    mapstructure:"values"`
	Release   HelmRelease `json:"release,omitempty"   mapstructure:"release"`
}

type HelmRelease

type HelmRelease struct {
	Name      string `json:"name,omitempty"      mapstructure:"name"`
	Namespace string `json:"namespace,omitempty" mapstructure:"namespace"`
}

type ImportCmd added in v0.16.0

type ImportCmd struct {
	*flags.GlobalFlags
	Log            log.Logger
	ClusterName    string
	Project        string
	ImportName     string
	DisableUpgrade bool
}

func (*ImportCmd) Run added in v0.16.0

func (cmd *ImportCmd) Run(ctx context.Context, args []string, proClient client.Client) error

Run executes the functionality

type Init

type Init struct {
	Manifests string      `json:"manifests" mapstructure:"manifests"`
	Helm      []HelmChart `json:"helm"      mapstructure:"helm"`
}

type ListCmd added in v0.2.0

type ListCmd struct {
	*flags.GlobalFlags
	// contains filtered or unexported fields
}

ListCmd holds the login cmd flags

func (*ListCmd) Run added in v0.2.0

func (cmd *ListCmd) Run(cobraCmd *cobra.Command, _ []string) error

Run executes the functionality

type Options

type Options struct {
	KubeConfigContextName string
	ChartVersion          string
	ChartName             string
	ChartRepo             string
	LocalChartDir         string
	Distro                string
	Values                []string
	SetValues             []string

	KubernetesVersion string

	CreateNamespace bool
	UpdateCurrent   bool
	Expose          bool
	ExposeLocal     bool

	Connect bool
	Upgrade bool
}

Options holds the create cmd options

type PauseCmd added in v0.6.0

type PauseCmd struct {
	*flags.GlobalFlags
	Log log.Logger
	// contains filtered or unexported fields
}

PauseCmd holds the cmd flags

func (*PauseCmd) Run added in v0.6.0

func (cmd *PauseCmd) Run(ctx context.Context, args []string) error

Run executes the functionality

type ResumeCmd added in v0.6.0

type ResumeCmd struct {
	*flags.GlobalFlags
	Log log.Logger

	Project string
	// contains filtered or unexported fields
}

ResumeCmd holds the cmd flags

func (*ResumeCmd) Run added in v0.6.0

func (cmd *ResumeCmd) Run(ctx context.Context, args []string) error

Run executes the functionality

type UpgradeCmd added in v0.2.0

type UpgradeCmd struct {
	Version string
	// contains filtered or unexported fields
}

UpgradeCmd is a struct that defines a command call for "upgrade"

func (*UpgradeCmd) Run added in v0.2.0

func (cmd *UpgradeCmd) Run(*cobra.Command, []string) error

Run executes the command logic

type VCluster added in v0.4.2

type VCluster struct {
	Created    time.Time
	Name       string
	Namespace  string
	Version    string
	Status     string
	AgeSeconds int
	Connected  bool
}

VCluster holds information about a cluster

type Values

type Values struct {
	Init Init `json:"init" mapstructure:"init"`
}

Directories

Path Synopsis
app
pro

Jump to

Keyboard shortcuts

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