cephfs

package
v2.23.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PersistentVolumeClaims

type PersistentVolumeClaims struct {
	// contains filtered or unexported fields
}

func NewPersistentVolumeClaims

func NewPersistentVolumeClaims(ctx context.Context, cephConfig *config.CephFs) (*PersistentVolumeClaims, error)

NewPersistentVolumeClaims creates a new continuously updated map of PersistentVolumeClaim objects ensure to provide a K8s API configuration in the given context given K8s API Client in the context is either reused or new client is created if none exists

func NewStaticPersistentVolumeClaims added in v2.5.0

func NewStaticPersistentVolumeClaims(pvcMap map[PvcKey]*PvcValue) *PersistentVolumeClaims

NewStaticPersistentVolumeClaims create a new instance of PersistentVolumeClaims without manipulating pvc map this can be used for testing or when a static pvc reference is enough

func (*PersistentVolumeClaims) Add

func (*PersistentVolumeClaims) All

func (v *PersistentVolumeClaims) All() map[PvcKey]*PvcValue

All returns a new copy of the pvc map for safe iteration

func (*PersistentVolumeClaims) Delete

func (v *PersistentVolumeClaims) Delete(obj runtime.Object) error

func (*PersistentVolumeClaims) Filter

func (v *PersistentVolumeClaims) Filter(filter func(key PvcKey, value *PvcValue) bool) map[PvcKey]*PvcValue

Filter will return a filtered copy of the pvc map for save iteration

func (*PersistentVolumeClaims) Modify

func (v *PersistentVolumeClaims) Modify(obj runtime.Object) error

type PvcKey added in v2.3.7

type PvcKey struct {
	Key       string
	Namespace string
}

func (PvcKey) CutPrincipalNameFromPvcNamespace added in v2.5.0

func (p PvcKey) CutPrincipalNameFromPvcNamespace(principal string) string

CutPrincipalNameFromPvcNamespace remove the principal prefix of pvc namespace this will remove the principal prefix e.g. "test-" from the pvc namespace

Example
principal := "test"

key := PvcKey{
	Key:       "test-key",
	Namespace: "test-namespace-test-dev",
}

fmt.Println(key.CutPrincipalNameFromPvcNamespace(principal))
Output:

namespace-test-dev-test-key

type PvcValue added in v2.3.7

type PvcValue struct {
	Error          error
	FullVolumePath string
	PVC            *coreV1.PersistentVolumeClaim

	// Note: PV can be nil, e.g. for unbound PVCs
	PV *coreV1.PersistentVolume
}

Jump to

Keyboard shortcuts

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