kubernetesk8s.io/kubernetes/pkg/kubelet/util/pluginwatcher Index | Files | Directories

package pluginwatcher

import "k8s.io/kubernetes/pkg/kubelet/util/pluginwatcher"

Index

Functions

func NewExampleHandler

func NewExampleHandler(supportedVersions []string, permitDeprecatedDir bool) *exampleHandler

NewExampleHandler provide a example handler

func NewExamplePlugin

func NewExamplePlugin() *examplePlugin

NewExamplePlugin returns an initialized examplePlugin instance

func NewTestExamplePlugin

func NewTestExamplePlugin(pluginName string, pluginType string, endpoint string, advertisedVersions ...string) *examplePlugin

NewTestExamplePlugin returns an initialized examplePlugin instance for testing

Types

type PluginHandler

type PluginHandler interface {
	// Validate returns an error if the information provided by
	// the potential plugin is erroneous (unsupported version, ...)
	ValidatePlugin(pluginName string, endpoint string, versions []string, foundInDeprecatedDir bool) error
	// RegisterPlugin is called so that the plugin can be register by any
	// plugin consumer
	// Error encountered here can still be Notified to the plugin.
	RegisterPlugin(pluginName, endpoint string, versions []string) error
	// DeRegister is called once the pluginwatcher observes that the socket has
	// been deleted.
	DeRegisterPlugin(pluginName string)
}

type Watcher

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

Watcher is the plugin watcher

func NewWatcher

func NewWatcher(sockDir string, deprecatedSockDir string) *Watcher

NewWatcher provides a new watcher deprecatedSockDir refers to a pre-GA directory that was used by older plugins for socket registration. New plugins should not use this directory.

func (*Watcher) AddHandler

func (w *Watcher) AddHandler(pluginType string, handler PluginHandler)

func (*Watcher) Start

func (w *Watcher) Start() error

Start watches for the creation of plugin sockets at the path

func (*Watcher) Stop

func (w *Watcher) Stop() error

Stop stops probing the creation of plugin sockets at the path

Source Files

example_handler.go example_plugin.go plugin_watcher.go types.go

Directories

PathSynopsis
pkg/kubelet/util/pluginwatcher/example_plugin_apis
pkg/kubelet/util/pluginwatcher/example_plugin_apis/v1beta1Package v1beta1 is a generated protocol buffer package.
pkg/kubelet/util/pluginwatcher/example_plugin_apis/v1beta2Package v1beta2 is a generated protocol buffer package.
Version
v1.14.1
Published
Apr 5, 2019
Platform
js/wasm
Imports
18 packages
Last checked
10 seconds ago

Tools for package owners.