lifecycle

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCommandLineArgs added in v1.5.1

func AddCommandLineArgs(flagset *pflag.FlagSet, opts *Options)

func AddCommandLineMigrationArgs added in v1.5.1

func AddCommandLineMigrationArgs(flagset *pflag.FlagSet, migrationOpts *MigrationOpts)

func NewEvictCommand

func NewEvictCommand() *cobra.Command

func NewMigrateCommand added in v1.5.1

func NewMigrateCommand() *cobra.Command

func NewRestartCommand

func NewRestartCommand() *cobra.Command

func NewStartCommand

func NewStartCommand() *cobra.Command

func NewStopCommand

func NewStopCommand() *cobra.Command

Types

type Command

type Command string
const (
	Stop    Command = "stop"
	Start   Command = "start"
	Restart Command = "restart"
	Evict   Command = "evict"
	Migrate Command = "migrate"
)

type Lifecycle

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

TODO: Refactor this structure because `Lifecycle` is a common object and should not process custom flags for each subcommand like `Migrate`.

func NewLifecycle

func NewLifecycle(cmd Command) *Lifecycle

func (*Lifecycle) Run

func (l *Lifecycle) Run(cmd *cobra.Command, args []string) error

func (*Lifecycle) Usage

func (l *Lifecycle) Usage() string

func (*Lifecycle) ValidateNodeName added in v1.5.1

func (l *Lifecycle) ValidateNodeName(cmd *cobra.Command, vmName, targetNodeName string) error

type Manager

type Manager interface {
	Stop(ctx context.Context, name, namespace string) (msg string, err error)
	Start(ctx context.Context, name, namespace string) (msg string, err error)
	Restart(ctx context.Context, name, namespace string) (msg string, err error)
	Evict(ctx context.Context, name, namespace string) (msg string, err error)
	Migrate(ctx context.Context, name, namespace, targetNodeName string) (msg string, err error)
}

type MigrationOpts added in v1.5.1

type MigrationOpts struct {
	TargetNodeName string
}

type Options

type Options struct {
	Force        bool
	WaitComplete bool
	CreateOnly   bool
	Timeout      time.Duration
}

TODO: If none of the flags are set, the operation output appears as if the `CreateOnly` flag is `true`, although in reality, it is `false`. This flag should be refactored. Consider changing it to a `silence` flag, which could be useful in scripting.

func DefaultOptions

func DefaultOptions() Options

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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