Documentation
¶
Overview ¶
Package volume implements a volume lister that lists volumes that are provisioned by one of the MapR CSI provisioners. It implements functionality to filter volumes by the secret they use and to sort the volumes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // SortOptionsList is the list of valid sort options SortOptionsList = []string{ SortByName.String(), SortBySecretNamespace.String(), SortBySecretName.String(), SortByClaimNamespace.String(), SortByClaimName.String(), SortByVolumePath.String(), SortByVolumeHandle.String(), SortByExpiration.String(), SortByAge.String(), } // DefaultSortBy is the default sort order DefaultSortBy = []SortOption{ SortByName, } )
Functions ¶
Types ¶
type Lister ¶
type Lister struct {
// contains filtered or unexported fields
}
Lister is a volume lister that lists volumes that are provisioned by one of the MapR CSI provisioners and that use the specified secret.
func NewLister ¶
func NewLister(client kubernetes.Interface, secretName string, namespace string, opts ...ListerOption) *Lister
NewLister returns a new volume lister that lists volumes that are provisioned by one of the MapR CSI provisioners and that use the specified secret.
type ListerOption ¶
type ListerOption func(*Lister)
ListerOption is a function that can be used to configure the volume lister.
func WithSecretLister ¶
func WithSecretLister(secretLister secretLister) ListerOption
WithSecretLister sets the secret lister used by the Lister to collect secrets and tickets referenced by the volumes
func WithSortBy ¶
func WithSortBy(sortBy []SortOption) ListerOption
WithSortBy sets the sort order used by the Lister for output
type SortOption ¶
type SortOption string
SortOption is the type of a sort option, basically a wrapper around a string to provide type safety.
const ( SortByName SortOption = "name" SortBySecretNamespace SortOption = "secret.namespace" SortBySecretName SortOption = "secret.name" SortByClaimNamespace SortOption = "claim.namespace" SortByClaimName SortOption = "claim.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.