cmd

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// None of cluster addresses are blocked in target cluster.
	StatusUnblocked = BlackholeStatus("unblocked")

	// All cluster addresses are blocked in target cluster.
	StatusBlocked = BlackholeStatus("blocked")

	// Some of cluster addresses are blocked in target cluster.
	StatusPartlyBlocked = BlackholeStatus("partly-blocked")
)

Variables

This section is empty.

Functions

func Execute

func Execute()

Types

type BlackholeStatus

type BlackholeStatus string

type BlockedCluster

type BlockedCluster struct {
	Context            string
	NodeAddresses      []string
	APIServerAddresses []string
	RouteAddresses     []string
	// contains filtered or unexported fields
}

func NewBlockedCluster

func NewBlockedCluster(config *api.Config, context string) (*BlockedCluster, error)

func (*BlockedCluster) AllAddresses

func (c *BlockedCluster) AllAddresses() []string

AllAddresses return sorted list of uniqe cluster address that must be blocked on the target cluster.

func (*BlockedCluster) Inspect

func (c *BlockedCluster) Inspect() error

type ClusterStatus

type ClusterStatus struct {
	Valid bool
	Nodes map[string]BlackholeStatus
}

type Command

type Command struct {
	Cluster *BlockedCluster
	Targets []*TargetCluster
	// contains filtered or unexported fields
}

func NewCommand

func NewCommand(blockedContext string, targetContexts []string, kubeconfig string, showProgress bool) (*Command, error)

func (*Command) BlockCluster

func (c *Command) BlockCluster() error

func (*Command) ClusterStatus

func (c *Command) ClusterStatus() (map[string]*ClusterStatus, error)

func (*Command) UnblockCluster

func (c *Command) UnblockCluster() error

type Progress added in v0.2.0

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

func NewProgress added in v0.2.0

func NewProgress(descripiton string, tasks uint, out io.Writer) *Progress

NewProgress return a new progress indicator.

func (*Progress) Add added in v0.2.0

func (p *Progress) Add(completed uint)

Add completed tasks to progress.

func (*Progress) Clear added in v0.2.0

func (p *Progress) Clear()

Clear the progress output.

func (*Progress) SetDescription added in v0.2.0

func (p *Progress) SetDescription(desciption string)

SetDescription changes the description.

func (*Progress) SetTasks added in v0.2.0

func (p *Progress) SetTasks(tasks uint)

SetTasks changes the number of tasks.

type Result

type Result struct {
	Context string
	Node    string
	Routes  sets.Set[string]
	Err     error
}

type TargetCluster

type TargetCluster struct {
	Context   string
	NodeNames []string
	// contains filtered or unexported fields
}

func NewTargetCluster

func NewTargetCluster(config *api.Config, context string) (*TargetCluster, error)

func (*TargetCluster) Inspect

func (c *TargetCluster) Inspect() error

Jump to

Keyboard shortcuts

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