cordon

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DesiredCordon a flag indicate karmadactl.RunCordonOrUncordon cordon a cluster,
	// cordon prevent new resource scheduler to cordoned cluster.
	DesiredCordon = iota
	// DesiredUnCordon a flag indicate karmadactl.RunCordonOrUncordon uncordon a cluster.
	DesiredUnCordon
)

Variables

This section is empty.

Functions

func NewCmdCordon

func NewCmdCordon(f util.Factory, parentCommand string) *cobra.Command

NewCmdCordon defines the `cordon` command that mark cluster as unschedulable.

func NewCmdUncordon

func NewCmdUncordon(f util.Factory, parentCommand string) *cobra.Command

NewCmdUncordon defines the `uncordon` command that mark cluster as schedulable.

func RunCordonOrUncordon

func RunCordonOrUncordon(desired int, f util.Factory, opts CommandCordonOption) error

RunCordonOrUncordon exec marks the cluster unschedulable or schedulable according to desired. if true cordon cluster otherwise uncordon cluster.

Types

type CommandCordonOption

type CommandCordonOption struct {
	// ClusterName is the cluster's name that we are going to join with.
	ClusterName string

	// DryRun tells if run the command in dry-run mode, without making any server requests.
	DryRun bool
}

CommandCordonOption holds all command options for cordon and uncordon

func (*CommandCordonOption) Complete

func (o *CommandCordonOption) Complete(args []string) error

Complete ensures that options are valid and marshals them if necessary.

Jump to

Keyboard shortcuts

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