cmd

package
v0.11.1-beta.1 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2022 License: Apache-2.0 Imports: 52 Imported by: 1

Documentation

Index

Constants

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

Variables

View Source
var (
	AllowedDistros              = []string{"k3s", "k0s", "k8s", "eks"}
	CreatedByVClusterAnnotation = "vcluster.loft.sh/created"
)
View Source
var CriticalStatus = map[string]bool{
	"Error":                      true,
	"Unknown":                    true,
	"ImagePullBackOff":           true,
	"CrashLoopBackOff":           true,
	"RunContainerError":          true,
	"ErrImagePull":               true,
	"CreateContainerConfigError": true,
	"InvalidImageName":           true,
}

CriticalStatus container status

View Source
var (
	PausedReplicasAnnotation = "loft.sh/paused-replicas"
)
View Source
var SortPodsByNewest = func(pods []corev1.Pod, i, j int) bool {
	return pods[i].CreationTimestamp.Unix() > pods[j].CreationTimestamp.Unix()
}

Functions

func BuildRoot

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

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 GetKubeConfig added in v0.5.0

func GetKubeConfig(ctx context.Context, kubeClient *kubernetes.Clientset, vclusterName string, namespace string, log log.Logger) (*api.Config, error)

GetKubeConfig attempts to read the kubeconfig from the default Secret and falls back to reading from filesystem if the Secret is not read successfully. Reading from filesystem is implemented for the backward compatibility and can be eventually removed in the future.

This is retried until the kube config is successfully retrieve, or until 10 minute timeout is reached.

func HasPodProblem added in v0.10.0

func HasPodProblem(pod *corev1.Pod) bool

func NewBashCommand added in v0.3.3

func NewBashCommand() *cobra.Command

func NewCompletionCmd added in v0.3.3

func NewCompletionCmd() *cobra.Command

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 NewFishCommand added in v0.11.0

func NewFishCommand() *cobra.Command

func NewListCmd added in v0.2.0

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

NewListCmd creates a new command

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 NewUpgradeCmd added in v0.2.0

func NewUpgradeCmd() *cobra.Command

NewUpgradeCmd creates a new upgrade command

func NewZshCommand added in v0.3.3

func NewZshCommand() *cobra.Command

Types

type ConnectCmd

type ConnectCmd struct {
	*flags.GlobalFlags

	KubeConfigContextName string
	KubeConfig            string
	PodName               string
	UpdateCurrent         bool
	Print                 bool
	LocalPort             int
	Address               string

	ServiceAccount            string
	ServiceAccountClusterRole string
	ServiceAccountExpiration  int

	Server   string
	Insecure bool

	Log log.Logger
	// contains filtered or unexported fields
}

ConnectCmd holds the cmd flags

func (*ConnectCmd) Connect added in v0.3.2

func (cmd *ConnectCmd) Connect(vclusterName string, command []string) error

func (*ConnectCmd) Run

func (cmd *ConnectCmd) Run(args []string) error

Run executes the functionality

type CreateCmd

type CreateCmd struct {
	*flags.GlobalFlags
	create.CreateOptions
	// contains filtered or unexported fields
}

CreateCmd holds the login cmd flags

func (*CreateCmd) Run

func (cmd *CreateCmd) Run(args []string) error

Run executes the functionality

func (*CreateCmd) ToChartOptions added in v0.6.0

func (cmd *CreateCmd) ToChartOptions(kubernetesVersion *version.Info) (*helm.ChartOptions, error)

type DeleteCmd

type DeleteCmd struct {
	*flags.GlobalFlags

	KeepPVC             bool
	DeleteNamespace     bool
	AutoDeleteNamespace 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(cobraCmd *cobra.Command, args []string) error

Run executes the functionality

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, args []string) error

Run executes the functionality

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(args []string) error

Run executes the functionality

type ResumeCmd added in v0.6.0

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

ResumeCmd holds the cmd flags

func (*ResumeCmd) Run added in v0.6.0

func (cmd *ResumeCmd) Run(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(cobraCmd *cobra.Command, args []string) error

Run executes the command logic

type VCluster added in v0.4.2

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

VCluster holds information about a cluster

Directories

Path Synopsis
app

Jump to

Keyboard shortcuts

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