Documentation
¶
Overview ¶
Package cluster groups all KSail cluster lifecycle Cobra commands under a single namespace.
This package contains commands for managing local Kubernetes cluster lifecycles, including init, create, delete, start, stop, list, info, and connect operations.
Index ¶
- Variables
- func HandleConnectRunE(cmd *cobra.Command, cfgManager *ksailconfigmanager.ConfigManager, ...) error
- func HandleInitRunE(cmd *cobra.Command, cfgManager *ksailconfigmanager.ConfigManager, ...) error
- func HandleListRunE(cmd *cobra.Command, cfgManager *ksailconfigmanager.ConfigManager, ...) error
- func InitFieldSelectors() []ksailconfigmanager.FieldSelector[v1alpha1.Cluster]
- func NewClusterCmd(runtimeContainer *runtime.Runtime) *cobra.Command
- func NewConnectCmd(_ *runtime.Runtime) *cobra.Command
- func NewCreateCmd(runtimeContainer *runtime.Runtime) *cobra.Command
- func NewDeleteCmd(runtimeContainer *runtime.Runtime) *cobra.Command
- func NewInfoCmd(_ *runtime.Runtime) *cobra.Command
- func NewInitCmd(runtimeContainer *runtime.Runtime) *cobra.Command
- func NewListCmd(runtimeContainer *runtime.Runtime) *cobra.Command
- func NewStartCmd(runtimeContainer *runtime.Runtime) *cobra.Command
- func NewStopCmd(runtimeContainer *runtime.Runtime) *cobra.Command
- func SetArgoCDInstallerFactoryForTests(factory func(*v1alpha1.Cluster) (installer.Installer, error)) func()
- func SetCSIInstallerFactoryForTests(factory func(*v1alpha1.Cluster) (installer.Installer, error)) func()
- func SetCertManagerInstallerFactoryForTests(factory func(*v1alpha1.Cluster) (installer.Installer, error)) func()
- func SetClusterProvisionerFactoryForTests(factory clusterprovisioner.Factory) func()
- func SetDockerClientInvokerForTests(invoker func(*cobra.Command, func(client.APIClient) error) error) func()
- func SetEnsureArgoCDResourcesForTests(fn func(context.Context, string, *v1alpha1.Cluster) error) func()
- type InitDeps
- type ListDeps
Constants ¶
This section is empty.
Variables ¶
var ErrUnsupportedCNI = errors.New("unsupported CNI type")
ErrUnsupportedCNI is returned when an unsupported CNI type is encountered.
Functions ¶
func HandleConnectRunE ¶
func HandleConnectRunE( cmd *cobra.Command, cfgManager *ksailconfigmanager.ConfigManager, args []string, editorFlag string, ) error
HandleConnectRunE handles the connect command execution. Exported for testing purposes.
func HandleInitRunE ¶
func HandleInitRunE( cmd *cobra.Command, cfgManager *ksailconfigmanager.ConfigManager, deps InitDeps, ) error
HandleInitRunE handles the init command.
func HandleListRunE ¶
func HandleListRunE( cmd *cobra.Command, cfgManager *ksailconfigmanager.ConfigManager, deps ListDeps, ) error
HandleListRunE handles the list command. Exported for testing purposes.
func InitFieldSelectors ¶
func InitFieldSelectors() []ksailconfigmanager.FieldSelector[v1alpha1.Cluster]
InitFieldSelectors returns the field selectors used by the init command. Kept local (rather than separate file) to keep init-specific wiring cohesive.
func NewClusterCmd ¶
NewClusterCmd creates the parent cluster command and wires lifecycle subcommands beneath it.
func NewConnectCmd ¶
NewConnectCmd creates the connect command for clusters.
func NewCreateCmd ¶
NewCreateCmd wires the cluster create command using the shared runtime container.
func NewDeleteCmd ¶
NewDeleteCmd creates and returns the delete command.
func NewInfoCmd ¶
NewInfoCmd creates the cluster info command.
func NewInitCmd ¶
NewInitCmd creates and returns the init command.
func NewListCmd ¶
NewListCmd creates the list command for clusters.
func NewStartCmd ¶
NewStartCmd creates and returns the start command.
func NewStopCmd ¶
NewStopCmd creates and returns the stop command.
func SetArgoCDInstallerFactoryForTests ¶
func SetArgoCDInstallerFactoryForTests( factory func(*v1alpha1.Cluster) (installer.Installer, error), ) func()
SetArgoCDInstallerFactoryForTests overrides the Argo CD installer factory.
func SetCSIInstallerFactoryForTests ¶
func SetCSIInstallerFactoryForTests( factory func(*v1alpha1.Cluster) (installer.Installer, error), ) func()
SetCSIInstallerFactoryForTests overrides the CSI installer factory.
func SetCertManagerInstallerFactoryForTests ¶
func SetCertManagerInstallerFactoryForTests( factory func(*v1alpha1.Cluster) (installer.Installer, error), ) func()
SetCertManagerInstallerFactoryForTests overrides the cert-manager installer factory.
func SetClusterProvisionerFactoryForTests ¶
func SetClusterProvisionerFactoryForTests(factory clusterprovisioner.Factory) func()
SetClusterProvisionerFactoryForTests overrides the cluster provisioner factory for testing.
Types ¶
type ListDeps ¶
type ListDeps struct {
// DistributionFactoryCreator is an optional function that creates factories for distributions.
// If nil, real factories with empty configs are used.
// This is primarily for testing purposes.
DistributionFactoryCreator func(v1alpha1.Distribution) clusterprovisioner.Factory
}
ListDeps captures dependencies needed for the list command logic.