client

package
v1.4.4-0...-86a696e Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2025 License: AGPL-3.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AddToScheme = localSchemeBuilder.AddToScheme

AddToScheme adds all types of this clientset into the given scheme. This allows composition of clientsets, like in:

import (
  "k8s.io/client-go/kubernetes"
  clientsetscheme "k8s.io/client-go/kubernetes/scheme"
  aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
)

kclientset, _ := kubernetes.NewForConfig(c)
_ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)

After this, RawExtensions in Kubernetes types will serialize kube-aggregator types correctly.

Codecs is new codec of new runtime scheme.

ParameterCodec is new parameter codec of new runtime scheme.

View Source
var Scheme = runtime.NewScheme()

Scheme is new runtime scheme.

Functions

func DriveClient

func DriveClient() types.LatestDriveInterface

DriveClient gets latest versioned drive interface.

func Eventf

func Eventf(object runtime.Object, eventType EventType, reason EventReason, messageFmt string, args ...interface{})

Eventf raises kubernetes events.

func FakeInit

func FakeInit()

FakeInit initializes fake clients.

func Init

func Init()

Init initializes various clients.

func InitRequestClient

func InitRequestClient() types.LatestInitRequestInterface

InitRequestClient gets latest versioned init request interface.

func NodeClient

func NodeClient() types.LatestNodeInterface

NodeClient gets latest versioned node interface.

func RESTClient

func RESTClient() rest.Interface

RESTClient gets latest versioned REST client.

func SetDriveInterface

func SetDriveInterface(i types.LatestDriveInterface)

SetDriveInterface sets latest drive interface. Note: To be used for writing test cases only

func SetInitRequestInterface

func SetInitRequestInterface(i types.LatestInitRequestInterface)

SetInitRequestInterface sets latest initrequest interface. Note: To be used for writing test cases only

func SetNodeInterface

func SetNodeInterface(i types.LatestNodeInterface)

SetNodeInterface sets latest node interface. Note: To be used for writing test cases only

func SetVolumeInterface

func SetVolumeInterface(i types.LatestVolumeInterface)

SetVolumeInterface sets the latest volume interface. Note: To be used for writing test cases only

func VolumeClient

func VolumeClient() types.LatestVolumeInterface

VolumeClient gets latest versioned volume interface.

Types

type Client

type Client struct {
	ClientsetInterface types.ExtClientsetInterface
	RESTClient         rest.Interface
	DriveClient        types.LatestDriveInterface
	VolumeClient       types.LatestVolumeInterface
	NodeClient         types.LatestNodeInterface
	InitRequestClient  types.LatestInitRequestInterface
	K8sClient          *k8s.Client
}

Client represents the directpv client set

func GetClient

func GetClient() *Client

GetClient returns the client

func NewClient

func NewClient(c *rest.Config) (*Client, error)

NewClient returns the directpv client

func (Client) APIextensions

func (c Client) APIextensions() apiextensions.ApiextensionsV1Interface

APIextensions returns the APIextensionsClient

func (Client) CRD

CRD returns the CRD client

func (Client) Discovery

func (c Client) Discovery() discovery.DiscoveryInterface

Discovery returns the discovery client

func (Client) Drive

func (c Client) Drive() types.LatestDriveInterface

Drive returns the DirectPV Drive interface

func (Client) InitRequest

func (c Client) InitRequest() types.LatestInitRequestInterface

InitRequest returns the DirectPV InitRequest interface

func (Client) K8s

func (c Client) K8s() *k8s.Client

K8s returns the kubernetes client

func (Client) Kube

func (c Client) Kube() kubernetes.Interface

Kube returns the kube client

func (Client) KubeConfig

func (c Client) KubeConfig() *rest.Config

KubeConfig returns the kubeconfig

func (Client) NewDriveLister

func (client Client) NewDriveLister() *DriveLister

NewDriveLister creates new drive lister.

func (Client) NewInitRequestLister

func (client Client) NewInitRequestLister() *InitRequestLister

NewInitRequestLister creates new volume lister.

func (Client) NewNodeLister

func (client Client) NewNodeLister() *NodeLister

NewNodeLister creates new volume lister.

func (Client) NewVolumeLister

func (client Client) NewVolumeLister() *VolumeLister

NewVolumeLister creates new volume lister.

func (Client) Node

func (c Client) Node() types.LatestNodeInterface

Node returns the DirectPV Node interface

func (Client) REST

func (c Client) REST() rest.Interface

REST returns the REST client

func (Client) SyncNodes

func (c Client) SyncNodes(ctx context.Context) (err error)

SyncNodes compares the csinodes with directpvnode list and syncs them It adds the missing nodes and deletes the non-existing nodes

func (Client) Volume

func (c Client) Volume() types.LatestVolumeInterface

Volume returns the DirectPV Volume interface

type DriveLister

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

DriveLister is lister wrapper for DirectPVDrive listing.

func NewDriveLister

func NewDriveLister() *DriveLister

NewDriveLister returns the new drive lister

func (*DriveLister) DriveIDSelector

func (lister *DriveLister) DriveIDSelector(driveIDs []directpvtypes.DriveID) *DriveLister

DriveIDSelector adds filter listing by drive IDs.

func (*DriveLister) DriveNameSelector

func (lister *DriveLister) DriveNameSelector(driveNames []directpvtypes.LabelValue) *DriveLister

DriveNameSelector adds filter listing by drive names.

func (*DriveLister) Get

func (lister *DriveLister) Get(ctx context.Context) ([]types.Drive, error)

Get returns list of drives.

func (*DriveLister) IgnoreNotFound

func (lister *DriveLister) IgnoreNotFound(b bool) *DriveLister

IgnoreNotFound controls listing to ignore drive not found error.

func (*DriveLister) LabelSelector

func (lister *DriveLister) LabelSelector(labels map[directpvtypes.LabelKey]directpvtypes.LabelValue) *DriveLister

LabelSelector adds filter listing by labels.

func (*DriveLister) List

func (lister *DriveLister) List(ctx context.Context) <-chan ListDriveResult

List returns channel to loop through drive items.

func (*DriveLister) MaxObjects

func (lister *DriveLister) MaxObjects(n int64) *DriveLister

MaxObjects controls number of items to be fetched in every iteration.

func (*DriveLister) NodeSelector

func (lister *DriveLister) NodeSelector(nodes []directpvtypes.LabelValue) *DriveLister

NodeSelector adds filter listing by nodes.

func (*DriveLister) StatusSelector

func (lister *DriveLister) StatusSelector(statusList []directpvtypes.DriveStatus) *DriveLister

StatusSelector adds filter listing by drive status.

type EventReason

type EventReason string

EventReason denotes kubernetes event reason.

const (
	EventReasonStageVolume             EventReason = "StageVolume"
	EventReasonVolumeMoved             EventReason = "VolumeMoved"
	EventReasonMetrics                 EventReason = "Metrics"
	EventReasonVolumeProvisioned       EventReason = "VolumeProvisioned"
	EventReasonVolumeAdded             EventReason = "VolumeAdded"
	EventReasonVolumeExpanded          EventReason = "VolumeExpanded"
	EventReasonVolumeReleased          EventReason = "VolumeReleased"
	EventReasonDriveMountError         EventReason = "DriveHasMountError"
	EventReasonDriveMounted            EventReason = "DriveMounted"
	EventReasonDriveHasMultipleMatches EventReason = "DriveHasMultipleMatches"
	EventReasonDriveIOError            EventReason = "DriveHasIOError"
	EventReasonDriveRelabelError       EventReason = "DriveHasRelabelError"
	EventReasonInitError               EventReason = "InitError"
	EventReasonDeviceNotFoundError     EventReason = "DeviceNotFoundError"
)

Enum values of EventReason type.

type EventType

type EventType string

EventType denotes kubernetes event type.

const (
	EventTypeNormal  EventType = EventType(apicorev1.EventTypeNormal)
	EventTypeWarning EventType = EventType(apicorev1.EventTypeWarning)
)

Enum values of EventType type.

type InitRequestLister

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

InitRequestLister is initRequest lister.

func NewInitRequestLister

func NewInitRequestLister() *InitRequestLister

NewInitRequestLister returns the new initrequest lister

func (*InitRequestLister) Get

func (lister *InitRequestLister) Get(ctx context.Context) ([]types.InitRequest, error)

Get returns list of initrequest.

func (*InitRequestLister) IgnoreNotFound

func (lister *InitRequestLister) IgnoreNotFound(b bool) *InitRequestLister

IgnoreNotFound controls listing to ignore not found error.

func (*InitRequestLister) InitRequestNameSelector

func (lister *InitRequestLister) InitRequestNameSelector(initRequestNames []string) *InitRequestLister

InitRequestNameSelector adds filter listing by InitRequestNames.

func (*InitRequestLister) List

func (lister *InitRequestLister) List(ctx context.Context) <-chan ListInitRequestResult

List returns channel to loop through initrequest items.

func (*InitRequestLister) MaxObjects

func (lister *InitRequestLister) MaxObjects(n int64) *InitRequestLister

MaxObjects controls number of items to be fetched in every iteration.

func (*InitRequestLister) NodeSelector

func (lister *InitRequestLister) NodeSelector(nodes []directpvtypes.LabelValue) *InitRequestLister

NodeSelector adds filter listing by nodes.

func (*InitRequestLister) RequestIDSelector

func (lister *InitRequestLister) RequestIDSelector(requestIDs []directpvtypes.LabelValue) *InitRequestLister

RequestIDSelector adds filter listing by its request IDs.

func (*InitRequestLister) Watch

func (lister *InitRequestLister) Watch(ctx context.Context) (<-chan WatchEvent[*types.InitRequest], func(), error)

Watch looks for changes in InitRequestList and reports them.

type ListDriveResult

type ListDriveResult struct {
	Drive types.Drive
	Err   error
}

ListDriveResult denotes list of drive result.

type ListInitRequestResult

type ListInitRequestResult struct {
	InitRequest types.InitRequest
	Err         error
}

ListInitRequestResult denotes list of initrequest result.

type ListNodeResult

type ListNodeResult struct {
	Node types.Node
	Err  error
}

ListNodeResult denotes list of node result.

type ListVolumeResult

type ListVolumeResult struct {
	Volume types.Volume
	Err    error
}

ListVolumeResult denotes list of volume result.

type NodeLister

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

NodeLister is node lister.

func NewNodeLister

func NewNodeLister() *NodeLister

NewNodeLister returns the new node lister

func (*NodeLister) Get

func (lister *NodeLister) Get(ctx context.Context) ([]types.Node, error)

Get returns list of nodes.

func (*NodeLister) IgnoreNotFound

func (lister *NodeLister) IgnoreNotFound(b bool) *NodeLister

IgnoreNotFound controls listing to ignore node not found error.

func (*NodeLister) List

func (lister *NodeLister) List(ctx context.Context) <-chan ListNodeResult

List returns channel to loop through node items.

func (*NodeLister) MaxObjects

func (lister *NodeLister) MaxObjects(n int64) *NodeLister

MaxObjects controls number of items to be fetched in every iteration.

func (*NodeLister) NodeNameSelector

func (lister *NodeLister) NodeNameSelector(nodeNames []string) *NodeLister

NodeNameSelector adds filter listing by node names.

func (*NodeLister) NodeSelector

func (lister *NodeLister) NodeSelector(nodes []directpvtypes.LabelValue) *NodeLister

NodeSelector adds filter listing by nodes.

func (*NodeLister) Watch

func (lister *NodeLister) Watch(ctx context.Context) (<-chan WatchEvent[*types.Node], func(), error)

Watch looks for changes in NodeList and reports them.

type VolumeLister

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

VolumeLister is volume lister.

func NewVolumeLister

func NewVolumeLister() *VolumeLister

NewVolumeLister returns the new volume lister

func (*VolumeLister) DriveIDSelector

func (lister *VolumeLister) DriveIDSelector(driveIDs []directpvtypes.LabelValue) *VolumeLister

DriveIDSelector adds filter listing by drive IDs.

func (*VolumeLister) DriveNameSelector

func (lister *VolumeLister) DriveNameSelector(driveNames []directpvtypes.LabelValue) *VolumeLister

DriveNameSelector adds filter listing by drive names.

func (*VolumeLister) Get

func (lister *VolumeLister) Get(ctx context.Context) ([]types.Volume, error)

Get returns list of volumes.

func (*VolumeLister) IgnoreNotFound

func (lister *VolumeLister) IgnoreNotFound(b bool) *VolumeLister

IgnoreNotFound controls listing to ignore drive not found error.

func (*VolumeLister) LabelSelector

func (lister *VolumeLister) LabelSelector(labels map[directpvtypes.LabelKey]directpvtypes.LabelValue) *VolumeLister

LabelSelector adds filter listing by labels.

func (*VolumeLister) List

func (lister *VolumeLister) List(ctx context.Context) <-chan ListVolumeResult

List returns channel to loop through volume items.

func (*VolumeLister) MaxObjects

func (lister *VolumeLister) MaxObjects(n int64) *VolumeLister

MaxObjects controls number of items to be fetched in every iteration.

func (*VolumeLister) NodeSelector

func (lister *VolumeLister) NodeSelector(nodes []directpvtypes.LabelValue) *VolumeLister

NodeSelector adds filter listing by nodes.

func (*VolumeLister) PodNSSelector

func (lister *VolumeLister) PodNSSelector(podNSs []directpvtypes.LabelValue) *VolumeLister

PodNSSelector adds filter listing by pod namespaces.

func (*VolumeLister) PodNameSelector

func (lister *VolumeLister) PodNameSelector(podNames []directpvtypes.LabelValue) *VolumeLister

PodNameSelector adds filter listing by pod names.

func (*VolumeLister) StatusSelector

func (lister *VolumeLister) StatusSelector(statusList []directpvtypes.VolumeStatus) *VolumeLister

StatusSelector adds filter listing by volume status.

func (*VolumeLister) VolumeNameSelector

func (lister *VolumeLister) VolumeNameSelector(volumeNames []string) *VolumeLister

VolumeNameSelector adds filter listing by volume names.

type WatchEvent

type WatchEvent[I any] struct {
	Type watch.EventType
	Item I
	Err  error
}

WatchEvent represents the events used in the Lister.

Jump to

Keyboard shortcuts

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