Documentation ¶
Index ¶
- func SetInstance(i Ops)
- type Client
- func (c *Client) CreateStorageClass(sc *storagev1.StorageClass) (*storagev1.StorageClass, error)
- func (c *Client) CreateVolumeAttachment(volumeAttachment *storagev1.VolumeAttachment) (*storagev1.VolumeAttachment, error)
- func (c *Client) DeleteStorageClass(name string) error
- func (c *Client) DeleteVolumeAttachment(name string) error
- func (c *Client) GetStorageClass(name string) (*storagev1.StorageClass, error)
- func (c *Client) GetStorageClassParams(sc *storagev1.StorageClass) (map[string]string, error)
- func (c *Client) GetStorageClasses(labelSelector map[string]string) (*storagev1.StorageClassList, error)
- func (c *Client) ListVolumeAttachments() (*storagev1.VolumeAttachmentList, error)
- func (c *Client) SetConfig(cfg *rest.Config)
- func (c *Client) UpdateVolumeAttachment(volumeAttachment *storagev1.VolumeAttachment) (*storagev1.VolumeAttachment, error)
- func (c *Client) UpdateVolumeAttachmentStatus(volumeAttachment *storagev1.VolumeAttachment) (*storagev1.VolumeAttachment, error)
- func (c *Client) ValidateStorageClass(name string) (*storagev1.StorageClass, error)
- type Ops
- type StorageClassOps
- type VolumeAttachmentOps
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetInstance ¶
func SetInstance(i Ops)
SetInstance replaces the instance with the provided one. Should be used only for testing purposes.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a wrapper for the kubernetes storage client.
func NewForConfig ¶
NewForConfig creates a new client for the given config.
func (*Client) CreateStorageClass ¶
func (c *Client) CreateStorageClass(sc *storagev1.StorageClass) (*storagev1.StorageClass, error)
CreateStorageClass creates the given storage class
func (*Client) CreateVolumeAttachment ¶
func (c *Client) CreateVolumeAttachment(volumeAttachment *storagev1.VolumeAttachment) (*storagev1.VolumeAttachment, error)
CreateVolumeAttachment creates a volume attachment
func (*Client) DeleteStorageClass ¶
DeleteStorageClass deletes the given storage class
func (*Client) DeleteVolumeAttachment ¶
DeleteVolumeAttachment deletes a given Volume Attachment by name
func (*Client) GetStorageClass ¶
func (c *Client) GetStorageClass(name string) (*storagev1.StorageClass, error)
GetStorageClass returns the storage class for the give namme
func (*Client) GetStorageClassParams ¶
GetStorageClassParams returns the parameters of the given sc in the native map format
func (*Client) GetStorageClasses ¶
func (c *Client) GetStorageClasses(labelSelector map[string]string) (*storagev1.StorageClassList, error)
GetStorageClasses returns all storageClasses that match given optional label selector
func (*Client) ListVolumeAttachments ¶
func (c *Client) ListVolumeAttachments() (*storagev1.VolumeAttachmentList, error)
ListVolumeAttachments lists all volume attachments
func (*Client) UpdateVolumeAttachment ¶
func (c *Client) UpdateVolumeAttachment(volumeAttachment *storagev1.VolumeAttachment) (*storagev1.VolumeAttachment, error)
UpdateVolumeAttachment updates a volume attachment
func (*Client) UpdateVolumeAttachmentStatus ¶
func (c *Client) UpdateVolumeAttachmentStatus(volumeAttachment *storagev1.VolumeAttachment) (*storagev1.VolumeAttachment, error)
UpdateVolumeAttachmentStatus updates a volume attachment status
func (*Client) ValidateStorageClass ¶
func (c *Client) ValidateStorageClass(name string) (*storagev1.StorageClass, error)
ValidateStorageClass validates the given storage class
type Ops ¶
type Ops interface { StorageClassOps VolumeAttachmentOps // SetConfig sets the config and resets the client SetConfig(config *rest.Config) }
Ops is an interface to perform kubernetes related operations on the core resources.
func NewInstanceFromConfigFile ¶
NewInstanceFromConfigFile returns new instance of client by using given config file
type StorageClassOps ¶
type StorageClassOps interface { // GetStorageClasses returns all storageClasses that match given optional label selector GetStorageClasses(labelSelector map[string]string) (*storagev1.StorageClassList, error) // GetStorageClass returns the storage class for the give namme GetStorageClass(name string) (*storagev1.StorageClass, error) // CreateStorageClass creates the given storage class CreateStorageClass(sc *storagev1.StorageClass) (*storagev1.StorageClass, error) // DeleteStorageClass deletes the given storage class DeleteStorageClass(name string) error // GetStorageClassParams returns the parameters of the given sc in the native map format GetStorageClassParams(sc *storagev1.StorageClass) (map[string]string, error) // ValidateStorageClass validates the given storage class // TODO: This is currently the same as GetStorageClass. If no one is using it, // we should remove this method ValidateStorageClass(name string) (*storagev1.StorageClass, error) }
StorageClassOps is an interface to perform k8s storage class operations
type VolumeAttachmentOps ¶
type VolumeAttachmentOps interface { // ListVolumeAttachments lists all volume attachments ListVolumeAttachments() (*storagev1.VolumeAttachmentList, error) // DeleteVolumeAttachment deletes a given Volume Attachment by name DeleteVolumeAttachment(name string) error // CreateVolumeAttachment creates a volume attachment CreateVolumeAttachment(*storagev1.VolumeAttachment) (*storagev1.VolumeAttachment, error) // UpdateVolumeAttachment updates a volume attachment UpdateVolumeAttachment(*storagev1.VolumeAttachment) (*storagev1.VolumeAttachment, error) // UpdateVolumeAttachmentStatus updates a volume attachment status UpdateVolumeAttachmentStatus(*storagev1.VolumeAttachment) (*storagev1.VolumeAttachment, error) }
VolumeAttachmentOps is an interface to perform k8s VolumeAttachmentOps operations