client

package
v1.4.4-0...-95e7151 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2025 License: AGPL-3.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GroupName = "direct.csi.min.io"
	Identity  = "direct-csi-min-io"
)

DirectCSI group and identity names.

View Source
const DirectCSIVersionLabelKey = directcsi.Group + "/" + directcsi.Version

DirectCSIVersionLabelKey is the version with group and version ...

Variables

This section is empty.

Functions

func DirectCSIDriveTypeMeta

func DirectCSIDriveTypeMeta() metav1.TypeMeta

DirectCSIDriveTypeMeta gets new direct-csi drive meta.

func DirectCSIVolumeTypeMeta

func DirectCSIVolumeTypeMeta() metav1.TypeMeta

DirectCSIVolumeTypeMeta gets new direct-csi volume meta.

func DriveClient

DriveClient gets latest versioned drive interface.

func FakeInit

func FakeInit()

FakeInit initializes fake clients.

func GetGroupVersion

func GetGroupVersion(k8sClient *k8s.Client, kind string) (version, group string, err error)

GetGroupVersion probes group and version of given resource kind.

func GetLatestDirectCSIRESTClient

func GetLatestDirectCSIRESTClient(k8sClient *k8s.Client) rest.Interface

GetLatestDirectCSIRESTClient gets REST client of the latest direct-csi.

func Init

func Init()

Init initializes legacy clients.

func SetDriveClient

func SetDriveClient(clientset *legacyclientsetfake.Clientset)

SetDriveClient sets drive interface from fake clientset. Note: To be used for writing test cases only

func SetVolumeClient

func SetVolumeClient(clientset *legacyclientsetfake.Clientset)

SetVolumeClient sets volume interface from fake clientset. Note: To be used for writing test cases only

func VolumeClient

VolumeClient gets latest versioned volume interface.

Types

type Client

type Client struct {
	DriveClient  typeddirectcsi.DirectCSIDriveInterface
	VolumeClient typeddirectcsi.DirectCSIVolumeInterface
	K8sClient    *k8s.Client
}

Client represents the legacy client

func GetClient

func GetClient() *Client

GetClient returns the client

func NewClient

func NewClient(k8sClient *k8s.Client) (*Client, error)

NewClient creates a legacy client

func (Client) Discovery

func (client Client) Discovery() discovery.DiscoveryInterface

Discovery returns the discovery client

func (Client) Drive

Drive returns the legacy drive client

func (Client) ListDrives

func (client Client) ListDrives(ctx context.Context) <-chan ListDriveResult

ListDrives returns channel to loop through drive items.

func (Client) ListVolumes

func (client Client) ListVolumes(ctx context.Context) <-chan ListVolumeResult

ListVolumes returns channel to loop through volume items.

func (Client) RemoveAllDrives

func (client Client) RemoveAllDrives(ctx context.Context, backupFile string) (backupCreated bool, err error)

RemoveAllDrives removes legacy drive CRDs.

func (Client) RemoveAllVolumes

func (client Client) RemoveAllVolumes(ctx context.Context, backupFile string) (backupCreated bool, err error)

RemoveAllVolumes removes legacy volume CRDs.

func (Client) Volume

Volume returns the volume client

type DirectCSIDriveInterface

type DirectCSIDriveInterface struct {
	// contains filtered or unexported fields
}

DirectCSIDriveInterface is a dynamic client interface for DirectCSIDrives

func DirectCSIDriveInterfaceForConfig

func DirectCSIDriveInterfaceForConfig(k8sClient *k8s.Client) (*DirectCSIDriveInterface, error)

DirectCSIDriveInterfaceForConfig provides a dynamic client interface for DirectCSIDrives

func (*DirectCSIDriveInterface) APIVersion

func (d *DirectCSIDriveInterface) APIVersion() schema.GroupVersion

APIVersion returns the APIVersion this RESTClient is expected to use.

func (*DirectCSIDriveInterface) Create

Create takes the representation of a directCSIDrive and creates it. Returns the server's representation of the directCSIDrive, and an error, if there is any.

func (*DirectCSIDriveInterface) Delete

func (d *DirectCSIDriveInterface) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error

Delete takes name of the resource object and deletes it. Returns an error if one occurs.

func (*DirectCSIDriveInterface) DeleteCollection

func (d *DirectCSIDriveInterface) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error

DeleteCollection deletes a collection of resource objects.

func (*DirectCSIDriveInterface) Get

Get takes name of the directCSIDrive, and returns the corresponding directCSIDrive object, and an error if there is any.

func (*DirectCSIDriveInterface) List

List takes label and field selectors, and returns the list of DirectCSIDrives that match those selectors.

func (*DirectCSIDriveInterface) Patch

func (d *DirectCSIDriveInterface) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *directcsi.DirectCSIDrive, err error)

Patch applies the patch and returns the patched directCSIDrive.

func (*DirectCSIDriveInterface) Update

Update takes the representation of a directCSIDrive and updates it. Returns the server's representation of the directCSIDrive, and an error, if there is any.

func (*DirectCSIDriveInterface) UpdateStatus

UpdateStatus was generated because the type contains a Status member. Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().

func (*DirectCSIDriveInterface) Watch

func (d *DirectCSIDriveInterface) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)

Watch returns a watch.Interface that watches the requested directCSIDrives.

type DirectCSIVolumeInterface

type DirectCSIVolumeInterface struct {
	// contains filtered or unexported fields
}

DirectCSIVolumeInterface is a dynamic client interface for DirectCSIVolumes

func DirectCSIVolumeInterfaceForConfig

func DirectCSIVolumeInterfaceForConfig(k8sClient *k8s.Client) (*DirectCSIVolumeInterface, error)

DirectCSIVolumeInterfaceForConfig provides a dynamic client interface for DirectCSIVolumes

func (*DirectCSIVolumeInterface) APIVersion

func (d *DirectCSIVolumeInterface) APIVersion() schema.GroupVersion

APIVersion returns the APIVersion this RESTClient is expected to use.

func (*DirectCSIVolumeInterface) Create

Create takes the representation of a directCSIVolume and creates it. Returns the server's representation of the directCSIVolume, and an error, if there is any.

func (*DirectCSIVolumeInterface) Delete

func (d *DirectCSIVolumeInterface) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error

Delete takes name of the resource object and deletes it. Returns an error if one occurs.

func (*DirectCSIVolumeInterface) DeleteCollection

func (d *DirectCSIVolumeInterface) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error

DeleteCollection deletes a collection of resource objects.

func (*DirectCSIVolumeInterface) Get

Get takes name of the directCSIVolume, and returns the corresponding directCSIVolume object, and an error if there is any.

func (*DirectCSIVolumeInterface) List

List takes label and field selectors, and returns the list of DirectCSIVolumes that match those selectors.

func (*DirectCSIVolumeInterface) Patch

func (d *DirectCSIVolumeInterface) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *directcsi.DirectCSIVolume, err error)

Patch applies the patch and returns the patched directCSIVolume.

func (*DirectCSIVolumeInterface) Update

Update takes the representation of a directCSIVolume and updates it. Returns the server's representation of the directCSIVolume, and an error, if there is any.

func (*DirectCSIVolumeInterface) UpdateStatus

UpdateStatus was generated because the type contains a Status member. Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().

func (*DirectCSIVolumeInterface) Watch

func (d *DirectCSIVolumeInterface) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)

Watch returns a watch.Interface that watches the requested directCSIDrives.

type ListDriveResult

type ListDriveResult struct {
	Drive directv1beta5.DirectCSIDrive
	Err   error
}

ListDriveResult denotes list of drive result.

type ListVolumeResult

type ListVolumeResult struct {
	Volume directv1beta5.DirectCSIVolume
	Err    error
}

ListVolumeResult denotes list of volume result.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL