persistentvolume

package
v0.24.1 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AreAllReady

func AreAllReady(pvCount int) bool

AreAllReady returns a bool depending on cluster state

func WaitOnReady

func WaitOnReady(pvCount int, sleep, duration time.Duration) bool

WaitOnReady will block until all pvs are in ready state

Types

type List

type List struct {
	PersistentVolumes []PersistentVolume `json:"items"`
}

List is used to parse out PersistentVolume from a list

func Get

func Get() (*List, error)

Get returns the current pvs for a given kubeconfig

type Metadata

type Metadata struct {
	CreatedAt time.Time         `json:"creationTimestamp"`
	Labels    map[string]string `json:"labels"`
	Name      string            `json:"name"`
}

Metadata holds information like name, create time, and namespace

type NodeAffinity

type NodeAffinity struct {
	Required *NodeSelector `json:"required"`
}

NodeAffinity holds information like required nodeselector

type NodeSelector

type NodeSelector struct {
	//Required. A list of node selector terms. The terms are ORed.
	NodeSelectorTerms []NodeSelectorTerm `json:"nodeSelectorTerms"`
}

NodeSelector represents the union of the results of one or more label queries

type NodeSelectorRequirement

type NodeSelectorRequirement struct {
	Key    string   `json:"key"`
	Values []string `json:"values,omitempty"`
}

NodeSelectorRequirement is a selector that contains values, a key, and an operator

type NodeSelectorTerm

type NodeSelectorTerm struct {
	MatchExpressions []NodeSelectorRequirement `json:"matchExpressions,omitempty"`
	MatchFields      []NodeSelectorRequirement `json:"matchFields,omitempty"`
}

NodeSelectorTerm represents node selector requirements

type PersistentVolume

type PersistentVolume struct {
	Metadata Metadata `json:"metadata"`
	Spec     Spec     `json:"spec"`
	Status   Status   `json:"status"`
}

PersistentVolume is used to parse data from kubectl get pv

type Spec

type Spec struct {
	StorageClassName string       `json:"storageClassName"`
	NodeAffinity     NodeAffinity `json:"nodeAffinity"`
}

Spec holds information like storageClassName, nodeAffinity

type Status

type Status struct {
	Phase string `json:"phase"`
}

Status holds information like phase

Jump to

Keyboard shortcuts

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