Documentation
¶
Index ¶
- Variables
- func BuildRoot(log log.Logger) (*cobra.Command, error)
- func CheckHelmVersion(output string) error
- func Execute()
- func GetHelmBinaryPath(ctx context.Context, log log.BaseLogger) (string, error)
- func GetKubeConfig(ctx context.Context, kubeClient *kubernetes.Clientset, vclusterName string, ...) (*api.Config, error)
- func GetProKubeConfig(options loftkubeconfig.ContextOptions) (*api.Config, error)
- func GetVClusterNamespace(ctx context.Context, context, name, namespace string, log log.Logger) (string, error)
- func HasPodProblem(pod *corev1.Pod) bool
- func NewConnectCmd(globalFlags *flags.GlobalFlags) *cobra.Command
- func NewCreateCmd(globalFlags *flags.GlobalFlags) *cobra.Command
- func NewDeleteCmd(globalFlags *flags.GlobalFlags) *cobra.Command
- func NewDisconnectCmd(globalFlags *flags.GlobalFlags) *cobra.Command
- func NewImportCmd(globalFlags *flags.GlobalFlags) (*cobra.Command, error)
- func NewListCmd(globalFlags *flags.GlobalFlags) *cobra.Command
- func NewLoginCmd(globalFlags *flags.GlobalFlags) (*cobra.Command, error)
- func NewLogoutCmd(globalFlags *flags.GlobalFlags) (*cobra.Command, error)
- func NewPauseCmd(globalFlags *flags.GlobalFlags) *cobra.Command
- func NewResumeCmd(globalFlags *flags.GlobalFlags) *cobra.Command
- func NewRootCmd(log log.Logger) *cobra.Command
- func NewUICmd(globalFlags *flags.GlobalFlags) (*cobra.Command, error)
- func NewUpgradeCmd() *cobra.Command
- type ConnectCmd
- type CreateCmd
- type DeleteCmd
- type DisconnectCmd
- type ImportCmd
- type ListCmd
- type PauseCmd
- type ResumeCmd
- type UpgradeCmd
- type VCluster
Constants ¶
This section is empty.
Variables ¶
var (
CreatedByVClusterAnnotation = "vcluster.loft.sh/created"
)
var CriticalStatus = map[string]bool{ "Error": true, "Unknown": true, "ImagePullBackOff": true, "CrashLoopBackOff": true, "RunContainerError": true, "ErrImagePull": true, "CreateContainerConfigError": true, "InvalidImageName": true, }
CriticalStatus container status
var SortPodsByNewest = func(pods []corev1.Pod, i, j int) bool {
return pods[i].CreationTimestamp.Unix() > pods[j].CreationTimestamp.Unix()
}
Functions ¶
func CheckHelmVersion ¶ added in v0.13.0
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
GetHelmBinaryPath checks for helm binary and downloads if it's not present.
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 GetProKubeConfig ¶ added in v0.16.0
func GetProKubeConfig(options loftkubeconfig.ContextOptions) (*api.Config, error)
GetProKubeConfig builds a pro kube config from options and client
func GetVClusterNamespace ¶ added in v0.16.0
func HasPodProblem ¶ added in v0.10.0
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 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 ¶
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
NewUpgradeCmd creates a new upgrade command
Types ¶
type ConnectCmd ¶
type ConnectCmd struct {
*flags.GlobalFlags
KubeConfigContextName string
KubeConfig string
PodName string
UpdateCurrent bool
Print bool
BackgroundProxy bool
LocalPort int
Address string
ServiceAccount string
ServiceAccountClusterRole string
ServiceAccountExpiration int
Server string
Insecure bool
Project string
Log log.Logger
// contains filtered or unexported fields
}
ConnectCmd holds the cmd flags
type CreateCmd ¶
type CreateCmd struct {
*flags.GlobalFlags
create.Options
// contains filtered or unexported fields
}
CreateCmd holds the login cmd flags
func (*CreateCmd) ToChartOptions ¶ added in v0.6.0
type DeleteCmd ¶
type DeleteCmd struct {
*flags.GlobalFlags
Project string
Wait bool
KeepPVC bool
DeleteNamespace bool
AutoDeleteNamespace bool
// contains filtered or unexported fields
}
DeleteCmd holds the delete cmd flags
type DisconnectCmd ¶ added in v0.10.0
type DisconnectCmd struct {
*flags.GlobalFlags
// contains filtered or unexported fields
}
DisconnectCmd holds the disconnect cmd flags
type ImportCmd ¶ added in v0.16.0
type ListCmd ¶ added in v0.2.0
type ListCmd struct {
*flags.GlobalFlags
// contains filtered or unexported fields
}
ListCmd holds the login cmd flags
type PauseCmd ¶ added in v0.6.0
type PauseCmd struct {
*flags.GlobalFlags
Project string
ForceDuration int64
Log log.Logger
// contains filtered or unexported fields
}
PauseCmd holds the cmd flags
type ResumeCmd ¶ added in v0.6.0
type ResumeCmd struct {
*flags.GlobalFlags
Project string
Log log.Logger
// contains filtered or unexported fields
}
ResumeCmd holds the cmd flags
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"