util

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Pre117RegionLabel         = Pre117TopologyLabelPrefix + "/" + RegionSuffix
	Pre117TopologyLabelPrefix = "failure-domain.beta.kubernetes.io"
	Pre117ZoneLabel           = Pre117TopologyLabelPrefix + "/" + ZoneSuffix
)
View Source
const (
	RegionLabel         = TopologyLabelPrefix + "/" + RegionSuffix
	TopologyLabelPrefix = "topology.kubernetes.io"
	ZoneLabel           = TopologyLabelPrefix + "/" + ZoneSuffix
)
View Source
const (
	RegionSuffix = "region"
	ZoneSuffix   = "zone"
)
View Source
const (
	NoResourcesFoundMessage = "No resources found."
)

Variables

This section is empty.

Functions

func PrintResult

func PrintResult(r Result, noHeaders bool) error

Types

type Node

type Node struct {
	Name   string
	Region string
	Zone   string
}

func NewNode

func NewNode(node corev1.Node) Node

type NodeList

type NodeList []Node

func ListNodes

func ListNodes(kubeClient kubernetes.Interface, o *TopologyOptions) (NodeList, error)

func (NodeList) Headers

func (l NodeList) Headers() string

func (NodeList) Items

func (l NodeList) Items() []string

func (NodeList) Length

func (l NodeList) Length() int

type Pod

type Pod struct {
	Name      string
	Namespace string
	Node      Node
}

func NewPod

func NewPod(pod corev1.Pod, node Node) Pod

type PodList

type PodList []Pod

func ListPods

func ListPods(kubeClient kubernetes.Interface, o *TopologyOptions) (PodList, error)

func (PodList) Headers

func (l PodList) Headers() string

func (PodList) Items

func (l PodList) Items() []string

func (PodList) Length

func (l PodList) Length() int

type Result

type Result interface {
	Headers() string
	Items() []string
	Length() int
}

type TopologyOptions

type TopologyOptions struct {
	Namespace string
	Region    string
	Zone      string
}

func NewTopologyOptions

func NewTopologyOptions(region, zone, namespace string) (*TopologyOptions, error)

func (*TopologyOptions) GetLabelSelector

func (o *TopologyOptions) GetLabelSelector(prefix string) string

Jump to

Keyboard shortcuts

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