kube

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2017 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureNamespaceExists

func EnsureNamespaceExists(namespace *v1.Namespace, client corev1.NamespaceInterface) (bool, error)

EnsureNamespaceExists attempts to create the provided Kubernetes namespace. It returns two values: a bool indicating whether or not the namespace was created, and an error if the create failed for a reason other than that the namespace already exists. Note that in the case where the namespace already exists, this function will return (false, nil).

func GetPVSource added in v0.4.0

func GetPVSource(spec map[string]interface{}) (string, map[string]interface{})

GetPVSource looks for a supported PV source within the provided PV spec data. It returns the name of the PV source type and the unstructured source data if one is found, or zero values otherwise.

func GetVolumeID added in v0.4.0

func GetVolumeID(pv map[string]interface{}) (string, error)

GetVolumeID looks for a supported PV source within the provided PV unstructured data. It returns the appropriate volume ID field if found. If the PV source is supported but a volume ID cannot be found, an error is returned; if the PV source is not supported, zero values are returned.

func NamespaceAndName added in v0.4.0

func NamespaceAndName(metaAccessor metav1.ObjectMetaAccessor) string

NamespaceAndName returns a string in the format <namespace>/<name>

func SetVolumeID added in v0.4.0

func SetVolumeID(spec map[string]interface{}, volumeID string) error

SetVolumeID looks for a supported PV source within the provided PV spec data. If sets the appropriate ID field(s) within the source if found, and returns an error if a supported PV source is not found.

Types

This section is empty.

Jump to

Keyboard shortcuts

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