plugin

package
v1.27.16 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// DRAPluginName is the name of the in-tree DRA Plugin.
	DRAPluginName = "kubernetes.io/dra"
)
View Source
const PluginClientTimeout = 10 * time.Second

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	NodePrepareResource(
		ctx context.Context,
		namespace string,
		claimUID types.UID,
		claimName string,
		resourceHandle string,
	) (*drapbv1.NodePrepareResourceResponse, error)

	NodeUnprepareResource(
		ctx context.Context,
		namespace string,
		claimUID types.UID,
		claimName string,
		resourceHandle string,
	) (*drapbv1.NodeUnprepareResourceResponse, error)
}

func NewDRAPluginClient

func NewDRAPluginClient(pluginName string) (Client, error)

type Plugin

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

Plugin is a description of a DRA Plugin, defined by an endpoint and the highest DRA version supported.

type PluginsStore

type PluginsStore struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

PluginsStore holds a list of DRA Plugins.

func (*PluginsStore) Clear

func (s *PluginsStore) Clear()

Clear deletes all entries in the store. This methiod is protected by a mutex.

func (*PluginsStore) Delete

func (s *PluginsStore) Delete(pluginName string)

Delete lets you delete a DRA Plugin by name. This method is protected by a mutex.

func (*PluginsStore) Get

func (s *PluginsStore) Get(pluginName string) *Plugin

Get lets you retrieve a DRA Plugin by name. This method is protected by a mutex.

func (*PluginsStore) Set

func (s *PluginsStore) Set(pluginName string, plugin *Plugin)

Set lets you save a DRA Plugin to the list and give it a specific name. This method is protected by a mutex.

type RegistrationHandler

type RegistrationHandler struct{}

RegistrationHandler is the handler which is fed to the pluginwatcher API.

func NewRegistrationHandler

func NewRegistrationHandler() *RegistrationHandler

NewPluginHandler returns new registration handler.

func (*RegistrationHandler) DeRegisterPlugin

func (h *RegistrationHandler) DeRegisterPlugin(pluginName string)

DeRegisterPlugin is called when a plugin has removed its socket, signaling it is no longer available.

func (*RegistrationHandler) RegisterPlugin

func (h *RegistrationHandler) RegisterPlugin(pluginName string, endpoint string, versions []string) error

RegisterPlugin is called when a plugin can be registered.

func (*RegistrationHandler) ValidatePlugin

func (h *RegistrationHandler) ValidatePlugin(pluginName string, endpoint string, versions []string) error

ValidatePlugin is called by kubelet's plugin watcher upon detection of a new registration socket opened by DRA plugin.

Jump to

Keyboard shortcuts

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