Documentation ¶
Overview ¶
Package claim implements the persistent volume claim lister. It is responsible for listing all persistent volume claims in the cluster that are refering to MapR-backed persistent volumes.
The lister is implemented as a chain of filters and collectors. The filters are used to filter out volume claims, ie. to only keep those that are bound and backed by a MapR CSI provisioner. The collectors are used to collect additional information about the volume claims, ie. to collect the PV for each PVC and the MapR ticket for each PV. This data is then used to print the volume claims in a human-readable tabular format.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // SortOptionsList is the list of valid sort options SortOptionsList = []string{ SortByNamespace.String(), SortByName.String(), SortBySecretNamespace.String(), SortBySecretName.String(), SortByVolumeName.String(), SortByVolumePath.String(), SortByVolumeHandle.String(), SortByExpiration.String(), SortByAge.String(), } // DefaultSortBy is the default sort order DefaultSortBy = []SortOption{ SortByNamespace, SortByName, } )
Functions ¶
Types ¶
type Lister ¶
type Lister struct {
// contains filtered or unexported fields
}
Lister is the struct that is used to list volume claims refering to MapR-backed persistent volumes in the cluster.
func NewLister ¶
func NewLister(client kubernetes.Interface, namespace string, opts ...ListerOption) *Lister
NewLister creates a new volume claim lister. It requires a Kubernetes client and a namespace to operate on. It also accepts a list of options that can be used to configure the lister.
type ListerOption ¶
type ListerOption func(*Lister)
ListerOption is a function that can be used to configure the volume claim lister.
func WithSecretLister ¶
func WithSecretLister(secretLister secretLister) ListerOption
WithSecretLister configures the volume claim lister to use the given secret lister.
func WithSortBy ¶
func WithSortBy(sortBy []SortOption) ListerOption
WithSortBy configures the volume claim lister to sort the volume claims by the given sort options.
type SortOption ¶
type SortOption string
SortOption is the type of a sort option, basically a wrapper around a string to provide type safety.
const ( SortByNamespace SortOption = "namespace" SortByName SortOption = "name" SortBySecretNamespace SortOption = "secret.namespace" SortBySecretName SortOption = "secret.name" SortByVolumeName SortOption = "volume.name" SortByVolumePath SortOption = "volume.path" SortByVolumeHandle SortOption = "volume.handle" SortByExpiration SortOption = "expiration" SortByAge SortOption = "age" )
All valid sort options are defined here
func (SortOption) String ¶
func (s SortOption) String() string
String returns the string representation of the sort option.