projector

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServiceBindingRootEnv    = "SERVICE_BINDING_ROOT"
	Group                    = "projector.servicebinding.io"
	VolumePrefix             = "servicebinding-"
	SecretAnnotationPrefix   = Group + "/secret-"
	TypeAnnotationPrefix     = Group + "/type-"
	ProviderAnnotationPrefix = Group + "/provider-"
)

Variables

This section is empty.

Functions

func NewMetaPodTemplate

func NewMetaPodTemplate(ctx context.Context, workload runtime.Object, mapping *servicebindingv1beta1.ClusterWorkloadResourceMappingTemplate) (*metaPodTemplate, error)

NewMetaPodTemplate coerces the workload object into a MetaPodTemplate following the mapping definition. The resulting MetaPodTemplate may have one or more service bindings applied to it at a time, but should not be reused. The workload must be JSON marshalable.

Types

type MappingSource

type MappingSource interface {
	// LookupMapping the mapping template for the workload. Typically a ClusterWorkloadResourceMapping is defined for the workload's
	// fully qualified resource `{resource}.{group}`. The workload's version is either directly matched, or the wildcard version `*`
	// mapping template is returned. If no explicit mapping is found, a mapping appropriate for a PodSpecable resource may be used.
	LookupMapping(ctx context.Context, workload runtime.Object) (*servicebindingv1beta1.ClusterWorkloadResourceMappingTemplate, error)
}

func NewStaticMapping

NewStaticMapping returns a single ClusterWorkloadResourceMappingTemplate for each lookup. It is useful for testing.

type ServiceBindingProjector

type ServiceBindingProjector interface {
	// Project the service into the workload as defined by the ServiceBinding.
	Project(ctx context.Context, binding *servicebindingv1beta1.ServiceBinding, workload runtime.Object) error
	// Unproject the serice from the workload as defined by the ServiceBinding.
	Unproject(ctx context.Context, binding *servicebindingv1beta1.ServiceBinding, workload runtime.Object) error
}

func New

func New(mappingSource MappingSource) ServiceBindingProjector

New creates a service binding projector configured for the mapping source. The binding projector is typically created once and applied to multiple workloads.

Jump to

Keyboard shortcuts

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