Documentation
¶
Index ¶
- func AreFilteredPodsHealthy(c client.Client, namespace string, labels fields.Set) (bool, error)
- func ConnectionHostname(t Transfer) string
- func ConnectionPort(t Transfer) int32
- func CreateClient(t Transfer) error
- func CreateServer(t Transfer) error
- func DeleteClient(t Transfer) error
- func DeleteServer(t Transfer) error
- func IsPodHealthy(c client.Client, pod client.ObjectKey) (bool, error)
- type PVC
- type PVCPair
- type PVCPairList
- func (p PVCPairList) GetDestinationNamespaces() (namespaces []string)
- func (p PVCPairList) GetSourceNamespaces() (namespaces []string)
- func (p PVCPairList) GetSourcePVC(nsName types.NamespacedName) *PVCPair
- func (p PVCPairList) GroupBySourceNamespaces() map[string][]PVCPair
- func (p PVCPairList) InDestinationNamespace(ns string) []PVCPair
- func (p PVCPairList) InSourceNamespace(ns string) []PVCPair
- type ResourceMetadata
- type Transfer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AreFilteredPodsHealthy ¶
AreFilteredPodsHealthy is a utility function that can be used by various implementations to check if the server pods deployed with some label selectors are healthy. If atleast 1 replica will be healthy the function will return true
func ConnectionHostname ¶
func ConnectionPort ¶
func CreateClient ¶
func CreateServer ¶
func DeleteClient ¶
func DeleteServer ¶
Types ¶
type PVC ¶
type PVC interface { // Claim returns the v1.PersistentVolumeClaim reference this PVC is associated with Claim() *v1.PersistentVolumeClaim // LabelSafeName returns a name for the PVC that can be used as a label value // it may be validated differently by different transfers LabelSafeName() string }
PVC knows how to return v1.PersistentVolumeClaim and an additional validated name which can be used by different transfers as per their own requirements
type PVCPair ¶
type PVCPair interface { // Source returns PVC representing source PersistentVolumeClaim Source() PVC // Destination returns PVC representing destination PersistentVolumeClaim Destination() PVC }
PVCPair knows how to return source and destination PVC objects for a state transfer
func NewPVCPair ¶
func NewPVCPair(src *v1.PersistentVolumeClaim, dest *v1.PersistentVolumeClaim) PVCPair
NewPVCPair when given references to a source and a destination PersistentVolumeClaim, returns a PVCPair to be used in transfers
type PVCPairList ¶
type PVCPairList []PVCPair
PVCPairList defines a managed list of PVCPair
func NewBlockOrVMDiskPVCPairList ¶ added in v0.1.0
func NewBlockOrVMDiskPVCPairList(pvcs ...PVCPair) (PVCPairList, error)
NewFilesystemPVCPairList when given a list of PVCPair, returns a managed list
func NewFilesystemPVCPairList ¶ added in v0.1.0
func NewFilesystemPVCPairList(pvcs ...PVCPair) (PVCPairList, error)
NewFilesystemPVCPairList when given a list of PVCPair, returns a managed list
func (PVCPairList) GetDestinationNamespaces ¶
func (p PVCPairList) GetDestinationNamespaces() (namespaces []string)
GetDestinationNamespaces returns all destination namespaces present in the list of pvcs
func (PVCPairList) GetSourceNamespaces ¶
func (p PVCPairList) GetSourceNamespaces() (namespaces []string)
GetSourceNamespaces returns all source namespaces present in the list of pvcs
func (PVCPairList) GetSourcePVC ¶
func (p PVCPairList) GetSourcePVC(nsName types.NamespacedName) *PVCPair
GetSourcePVC returns matching PVC from the managed list
func (PVCPairList) GroupBySourceNamespaces ¶
func (p PVCPairList) GroupBySourceNamespaces() map[string][]PVCPair
GroupBySourceNamespaces returns lists of PVCs indexed by their source namespaces
func (PVCPairList) InDestinationNamespace ¶
func (p PVCPairList) InDestinationNamespace(ns string) []PVCPair
InDestinationNamespace given a destination namespace, returns a list of pvcs that will be migrated to it
func (PVCPairList) InSourceNamespace ¶
func (p PVCPairList) InSourceNamespace(ns string) []PVCPair
InSourceNamespace given a source namspace, returns a list of pvcs belonging to that namespace
type ResourceMetadata ¶
type ResourceMetadata struct { Annotations map[string]string Labels map[string]string OwnerReferences []metav1.OwnerReference }
ResourceMetadata defines any metadata used to create intermediary resources for state transfer
type Transfer ¶
type Transfer interface { // Source returns a source client Source() client.Client // Destination returns a destination client Destination() client.Client // Endpoint returns the endpoint used by the transfer Endpoint() endpoint.Endpoint // Transport returns the transport used by the transfer Transport() transport.Transport // CreateServer creates a transfer server either on source or the destination CreateServer(client.Client) error // CreateClient creates a transfer client either on source or the destination CreateClient(client.Client) error IsServerHealthy(c client.Client) (bool, error) // PVCs returns the list of PVCs the transfer will migrate PVCs() PVCPairList }
Transfer knows how to transfer PV data from a source to a destination