Documentation ¶
Index ¶
- func EnsureNamespaceExists(namespace *v1.Namespace, client corev1.NamespaceInterface) (bool, error)
- func GetPVSource(spec map[string]interface{}) (string, map[string]interface{})
- func GetVolumeID(pv map[string]interface{}) (string, error)
- func NamespaceAndName(objMeta metav1.Object) string
- func SetVolumeID(spec map[string]interface{}, volumeID string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureNamespaceExists ¶
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
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
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
NamespaceAndName returns a string in the format <namespace>/<name>
func SetVolumeID ¶ added in v0.4.0
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.