pipeline

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2021 License: Apache-2.0 Imports: 7 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application interface {

	// Application resource
	HasResource

	// dot-separated path inside the application resource locating container resources
	// the returned value follows foo.bar.bla convention
	// it cannot be empty
	ContainersPath() string

	// optional dot-separated path inside the application resource locating field where intermediate binding secret ref should be injected
	// the returns value follows foo.bar.bla convention, but it can be empty
	SecretPath() string
}

Application to be bound to service(s)

type BindingItem

type BindingItem struct {
	Name   string
	Value  interface{}
	Source Service
}

type BindingItems

type BindingItems []*BindingItem

func (*BindingItems) AsMap

func (items *BindingItems) AsMap() map[string]string

Returns map representation of given list of binding items

type CRD

type CRD interface {

	// CRD resource
	HasResource

	// optional Descriptor attached to ClusterServiceVersion resource
	Descriptor() (*olmv1alpha1.CRDDescription, error)
}

Custom Resource Definition

type Context

type Context interface {
	BindingName() string

	// Services referred by binding
	// if reading fails, return error
	Services() ([]Service, error)

	// Applications referred by binding
	// it can be empty slice
	// if reading fails, return error
	Applications() ([]Application, error)

	// Returns true if binding is about to be removed
	UnbindRequested() bool

	BindingSecretName() string

	// Return true if bindings should be projected as files inside application containers
	BindAsFiles() bool

	// Path where bindings should be mounted inside application containers
	MountPath() string

	// Template that should be applied on collected binding names, prior projection
	NamingTemplate() string

	// Additional bindings that will be projected into application containers
	// entry key is the future binding name
	// entry value contains template that generates binding value
	Mappings() map[string]string

	// Add binding item to the context
	AddBindingItem(item *BindingItem)

	// List binding items that should be projected into application containers
	BindingItems() BindingItems

	// Indicates that the binding should be retried at some later time
	// The current processing stops and context gets closed
	RetryProcessing(reason error)

	// Indicates that en error has occurred while processing the binding
	Error(err error)

	// Stops processing
	StopProcessing()

	// Closes the context, persisting changed resources
	// Returns error if occurrs
	Close() error

	// Sets context condition
	SetCondition(condition *metav1.Condition)

	kubernetes.ConfigMapReader
	kubernetes.SecretReader

	FlowStatus() FlowStatus
}

Pipeline context passed to each handler

type ContextProvider

type ContextProvider interface {
	Get(binding *api.ServiceBinding) (Context, error)
}

Provides context for a given service binding

type FlowStatus

type FlowStatus struct {
	Retry bool
	Stop  bool
	Err   error
}

Pipeline flow control

type Handler

type Handler interface {
	Handle(ctx Context)
}

A pipeline stage

type HandlerFunc

type HandlerFunc func(ctx Context)

func (HandlerFunc) Handle

func (f HandlerFunc) Handle(ctx Context)

type HasResource

type HasResource interface {
	Resource() *unstructured.Unstructured
}

type Pipeline

type Pipeline interface {

	// Reconcile given service binding
	// Returns true if processing should be repeated
	// and optional error if occurred
	// important: even if error occurred it might not be needed to retry processing
	Process(binding *api.ServiceBinding) (bool, error)
}

Reconciliation pipeline

type Service

type Service interface {

	// Service resource
	HasResource

	// Return CRD for this service, otherwise nil if not backed by CRD
	// Error might be returned if occurred during the operation
	CustomResourceDefinition() (CRD, error)

	// Resources owned by the service, if any
	// Error might be returned if occurred during the operation
	OwnedResources() ([]*unstructured.Unstructured, error)

	// Attach binding definition to service
	AddBindingDef(def binding.Definition)

	// All binding definitions attached to the service
	BindingDefs() []binding.Definition

	// Optional service id
	Id() *string
}

Service to be bound

Directories

Path Synopsis
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
handler
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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