driver

package
v1.2.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package driver implements Driver's methods.

Index

Constants

This section is empty.

Variables

View Source
var ControllerCtxKey int

ControllerCtxKey the pointer is the key that a ControllerContext returns itself for.

View Source
var InjectorCtxKey int

InjectorCtxKey the pointer is the key that a InjectorContext returns itself for.

Functions

This section is empty.

Types

type ControllerContext

type ControllerContext struct {
	context.Context

	ProxyServerPort  uint32
	ProxyServiceCert *certificate.Certificate
	FsmNamespace     string
	KubeConfig       *rest.Config
	Configurator     configurator.Configurator
	MeshCatalog      catalog.MeshCataloger
	CertManager      *certificate.Manager
	MsgBroker        *messaging.Broker
	DebugHandlers    map[string]http.Handler
	CancelFunc       func()
	Stop             chan struct {
	}
}

ControllerContext carries the arguments for invoking ControllerDriver.Start

func (*ControllerContext) Deadline

func (c *ControllerContext) Deadline() (deadline time.Time, ok bool)

Deadline returns the time when work done on behalf of this context should be canceled. Deadline returns ok==false when no deadline is set. Successive calls to Deadline return the same results.

func (*ControllerContext) Done

func (c *ControllerContext) Done() <-chan struct{}

Done returns a channel that's closed when work done on behalf of this context should be canceled. Done may return nil if this context can never be canceled. Successive calls to Done return the same value. The close of the Done channel may happen asynchronously, after the cancel function returns.

func (*ControllerContext) Err

func (c *ControllerContext) Err() error

Err returns nil, if Done is not yet closed, If Done is closed, Err returns a non-nil error explaining why: Canceled if the context was canceled or DeadlineExceeded if the context's deadline passed. After Err returns a non-nil error, successive calls to Err return the same error.

func (*ControllerContext) Value

func (c *ControllerContext) Value(key interface{}) interface{}

Value returns the value associated with this context for key, or nil if no value is associated with key. Successive calls to Value with the same key returns the same result.

type Driver

type Driver interface {
	Patch(ctx context.Context) error
	Start(ctx context.Context) (health.Probes, error)
}

Driver is an interface that must be implemented by a sidecar driver. Patch method is invoked by fsm-injector and Start method is invoked by fsm-controller

type InjectorContext

type InjectorContext struct {
	context.Context

	MeshName                     string
	KubeClient                   kubernetes.Interface
	FsmNamespace                 string
	FsmContainerPullPolicy       corev1.PullPolicy
	Configurator                 configurator.Configurator
	CertManager                  *certificate.Manager
	Pod                          *corev1.Pod
	PodOS                        string
	PodNamespace                 string
	ProxyUUID                    uuid.UUID
	BootstrapCertificateCNPrefix string
	BootstrapCertificate         *certificate.Certificate
	DryRun                       bool
}

InjectorContext carries the arguments for invoking InjectorDriver.Patch

func (*InjectorContext) Deadline

func (c *InjectorContext) Deadline() (deadline time.Time, ok bool)

Deadline returns the time when work done on behalf of this context should be canceled. Deadline returns ok==false when no deadline is set. Successive calls to Deadline return the same results.

func (*InjectorContext) Done

func (c *InjectorContext) Done() <-chan struct{}

Done returns a channel that's closed when work done on behalf of this context should be canceled. Done may return nil if this context can never be canceled. Successive calls to Done return the same value. The close of the Done channel may happen asynchronously, after the cancel function returns.

func (*InjectorContext) Err

func (c *InjectorContext) Err() error

Err returns nil, if Done is not yet closed, If Done is closed, Err returns a non-nil error explaining why: Canceled if the context was canceled or DeadlineExceeded if the context's deadline passed. After Err returns a non-nil error, successive calls to Err return the same error.

func (*InjectorContext) Value

func (c *InjectorContext) Value(key interface{}) interface{}

Value returns the value associated with this context for key, or nil if no value is associated with key. Successive calls to Value with the same key returns the same result.

Jump to

Keyboard shortcuts

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