Documentation ¶
Index ¶
- type PersistentVolumeClaims
- func (v *PersistentVolumeClaims) Add(obj runtime.Object) error
- func (v *PersistentVolumeClaims) All() map[PvcKey]*PvcValue
- func (v *PersistentVolumeClaims) Delete(obj runtime.Object) error
- func (v *PersistentVolumeClaims) Filter(filter func(key PvcKey, value *PvcValue) bool) map[PvcKey]*PvcValue
- func (v *PersistentVolumeClaims) Modify(obj runtime.Object) error
- type PvcKey
- type PvcValue
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) 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
type PvcKey ¶ added in v2.3.7
func (PvcKey) CutPrincipalNameFromPvcNamespace ¶ added in v2.5.0
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 }