Documentation ¶
Index ¶
- type Builder
- func (b *Builder) Build() (*storagev1.StorageClass, error)
- func (b *Builder) WithAnnotations(annotations map[string]string) *Builder
- func (b *Builder) WithGenerateName(name string) *Builder
- func (b *Builder) WithName(name string) *Builder
- func (b *Builder) WithParametersNew(parameters map[string]string) *Builder
- func (b *Builder) WithProvisioner(provisioner string) *Builder
- func (b *Builder) WithVolumeBindingMode(bindingMode storagev1.VolumeBindingMode) *Builder
- func (b *Builder) WithVolumeExpansion(expansionAllowed bool) *Builder
- type KubeClientBuildOption
- type Kubeclient
- func (k *Kubeclient) Create(sc *storagev1.StorageClass) (*storagev1.StorageClass, error)
- func (k *Kubeclient) Delete(name string, opts *metav1.DeleteOptions) error
- func (k *Kubeclient) Get(name string, opts metav1.GetOptions) (*storagev1.StorageClass, error)
- func (k *Kubeclient) List(opts metav1.ListOptions) (*storagev1.StorageClassList, error)
- type ListBuilder
- type Predicate
- type StorageClass
- type StorageClassList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder enables building an instance of StorageClass
func (*Builder) Build ¶
func (b *Builder) Build() (*storagev1.StorageClass, error)
Build returns the StorageClass API instance
func (*Builder) WithAnnotations ¶
WithAnnotations sets the Annotations field of storageclass with provided value.
func (*Builder) WithGenerateName ¶
WithGenerateName appends a random string after the name
func (*Builder) WithParametersNew ¶
WithParametersNew resets existing parameters if any with ones that are provided here
func (*Builder) WithProvisioner ¶
WithProvisioner sets the Provisioner field of storageclass with provided argument.
func (*Builder) WithVolumeBindingMode ¶
func (b *Builder) WithVolumeBindingMode(bindingMode storagev1.VolumeBindingMode) *Builder
WithVolumeBindingMode sets the volume binding mode of storageclass with provided argument. VolumeBindingMode indicates how PersistentVolumeClaims should be bound. VolumeBindingImmediate indicates that PersistentVolumeClaims should be immediately provisioned and bound. This is the default mode. VolumeBindingWaitForFirstConsumer indicates that PersistentVolumeClaims should not be provisioned and bound until the first Pod is created that references the PeristentVolumeClaim. The volume provisioning and binding will occur during Pod scheduing.
func (*Builder) WithVolumeExpansion ¶
WithVolumeExpansion sets the AllowedVolumeExpansion field of storageclass with provided argument.
type KubeClientBuildOption ¶
type KubeClientBuildOption func(*Kubeclient)
KubeClientBuildOption defines the abstraction to build a kubeclient instance
func WithClientSet ¶
func WithClientSet(c *kubernetes.Clientset) KubeClientBuildOption
WithClientSet sets the kubernetes client against the kubeclient instance
func WithKubeConfigPath ¶
func WithKubeConfigPath(path string) KubeClientBuildOption
WithKubeConfigPath sets the kubeConfig path against client instance
type Kubeclient ¶
type Kubeclient struct {
// contains filtered or unexported fields
}
Kubeclient enables kubernetes API operations on storageclass instance
func NewKubeClient ¶
func NewKubeClient(opts ...KubeClientBuildOption) *Kubeclient
NewKubeClient returns a new instance of kubeclient meant for storageclass
func (*Kubeclient) Create ¶
func (k *Kubeclient) Create(sc *storagev1.StorageClass) (*storagev1.StorageClass, error)
Create creates and returns a storageclass instance
func (*Kubeclient) Delete ¶
func (k *Kubeclient) Delete(name string, opts *metav1.DeleteOptions) error
Delete deletes the storageclass if present in kubernetes cluster
func (*Kubeclient) Get ¶
func (k *Kubeclient) Get(name string, opts metav1.GetOptions) (*storagev1.StorageClass, error)
Get return a storageclass instance present in kubernetes cluster
func (*Kubeclient) List ¶
func (k *Kubeclient) List(opts metav1.ListOptions) (*storagev1.StorageClassList, error)
List returns a list of storageclass instances present in kubernetes cluster
type ListBuilder ¶
type ListBuilder struct {
// contains filtered or unexported fields
}
ListBuilder enables building an instance of StorageClassList
func ListBuilderForAPIList ¶
func ListBuilderForAPIList(scl *storagev1.StorageClassList) *ListBuilder
ListBuilderForAPIList builds the ListBuilder object based on SC API list
func ListBuilderForObjects ¶
func ListBuilderForObjects(scl *StorageClassList) *ListBuilder
ListBuilderForObjects returns a instance of ListBuilder from SC instances
func NewListBuilder ¶
func NewListBuilder() *ListBuilder
NewListBuilder returns a instance of ListBuilder
func (*ListBuilder) APIList ¶
func (b *ListBuilder) APIList() (*storagev1.StorageClassList, error)
APIList builds core API PVC list using listbuilder
func (*ListBuilder) Len ¶
func (b *ListBuilder) Len() (int, error)
Len returns the number of items present in the PVCList of a builder
func (*ListBuilder) List ¶
func (b *ListBuilder) List() (*StorageClassList, error)
List returns the list of StorageClass instances that was built by this builder
func (*ListBuilder) WithFilter ¶
func (b *ListBuilder) WithFilter(pred ...Predicate) *ListBuilder
WithFilter add filters on which the StorageClass has to be filtered
type Predicate ¶
type Predicate func(*StorageClass) bool
Predicate defines an abstraction to determine conditional checks against the provided StorageClass instance
type StorageClass ¶
type StorageClass struct {
// contains filtered or unexported fields
}
StorageClass is a wrapper over API based storage class instance
func NewForAPIObject ¶
func NewForAPIObject(obj *storagev1.StorageClass) *StorageClass
NewForAPIObject returns a new instance of StorageClass
type StorageClassList ¶
type StorageClassList struct {
// contains filtered or unexported fields
}
StorageClassList holds the list of StorageClass instances
func (*StorageClassList) Len ¶
func (scl *StorageClassList) Len() int
Len returns the number of items present in the StorageClassList
func (*StorageClassList) ToAPIList ¶
func (scl *StorageClassList) ToAPIList() *storagev1.StorageClassList
ToAPIList converts StorageClassList to API StorageClassList