Documentation ¶
Index ¶
- Constants
- func EnsureMapIsInitiated(m map[string]string) map[string]string
- func IsNotFoundError(err error) bool
- func Merge(m1, m2 map[string]string) (map[string]string, error)
- type BindingLabelsFetcher
- type BindingUsageSpecStorage
- type ConflictError
- type GenericSupervisor
- func (m *GenericSupervisor) EnsureLabelsCreated(namespace, resourceName, usageName string, labels map[string]string) error
- func (m *GenericSupervisor) EnsureLabelsDeleted(namespace, resourceName, usageName string) error
- func (m *GenericSupervisor) GetInjectedLabels(namespace, resourceName, usageName string) (map[string]string, error)
- func (m *GenericSupervisor) HasSynced() bool
- type Kind
- type KubernetesResourceSupervisor
- type NotFoundError
- type PodPresetModifier
- type ResourceSupervisorAggregator
- type SBUDeletedEvent
- type ServiceBindingUsageController
- type UsageSpec
Constants ¶
const (
// LivenessBUCSample name of ServiceBindingUsage used for liveness probe
LivenessBUCSample = "informer.liveness.probe.service.binding.usage.name"
)
Variables ¶
This section is empty.
Functions ¶
func EnsureMapIsInitiated ¶
EnsureMapIsInitiated ensures that given map is initiated. - returns given map if it's already allocated - otherwise returns empty map
func IsNotFoundError ¶
IsNotFoundError checks if given error is NotFound error
Types ¶
type BindingLabelsFetcher ¶
type BindingLabelsFetcher struct {
// contains filtered or unexported fields
}
BindingLabelsFetcher extracts binding labels defined in ClusterServiceClass for given ServiceBinding
func NewBindingLabelsFetcher ¶
func NewBindingLabelsFetcher(siLister scListers.ServiceInstanceLister, cscLister scListers.ClusterServiceClassLister, scLister scListers.ServiceClassLister) *BindingLabelsFetcher
NewBindingLabelsFetcher returnd BindingLabelsFetcher
func (*BindingLabelsFetcher) Fetch ¶
func (c *BindingLabelsFetcher) Fetch(svcBinding *scTypes.ServiceBinding) (map[string]string, error)
Fetch returns binding labels defined in ClusterServiceClass/ServiceClass
type BindingUsageSpecStorage ¶
type BindingUsageSpecStorage struct {
// contains filtered or unexported fields
}
BindingUsageSpecStorage provides functionality to get/delete/save ServiceBindingUsage.Spec
func NewBindingUsageSpecStorage ¶
func NewBindingUsageSpecStorage(cfgMapClient configMapClient, cfgMapName string) *BindingUsageSpecStorage
NewBindingUsageSpecStorage returns new instance of BindingUsageSpecStorage
func (*BindingUsageSpecStorage) Delete ¶
func (c *BindingUsageSpecStorage) Delete(namespace, name string) error
Delete deletes stored spec for given ServiceBindingUsage
func (*BindingUsageSpecStorage) Get ¶
func (c *BindingUsageSpecStorage) Get(usageNS, usageName string) (*UsageSpec, bool, error)
Get returns stored spec for given ServiceBindingUsage
func (*BindingUsageSpecStorage) Upsert ¶
func (c *BindingUsageSpecStorage) Upsert(bUsage *sbuTypes.ServiceBindingUsage, applied bool) error
Upsert upserts spec for given ServiceBindingUsage
type ConflictError ¶
type ConflictError struct {
ConflictingResource string
}
ConflictError indicates situation when conflict occurs
func (*ConflictError) Error ¶
func (e *ConflictError) Error() string
type GenericSupervisor ¶
type GenericSupervisor struct {
// contains filtered or unexported fields
}
GenericSupervisor ensures that expected labels are present or not on a k8s resource provided by given resourceInterface.
func NewGenericSupervisor ¶
func NewGenericSupervisor(resourceInterface dynamic.NamespaceableResourceInterface, labeler labelsSvc, log logrus.FieldLogger) *GenericSupervisor
NewGenericSupervisor creates a new GenericSupervisor.
func (*GenericSupervisor) EnsureLabelsCreated ¶
func (m *GenericSupervisor) EnsureLabelsCreated(namespace, resourceName, usageName string, labels map[string]string) error
EnsureLabelsCreated ensures that given labels are added to resource
func (*GenericSupervisor) EnsureLabelsDeleted ¶
func (m *GenericSupervisor) EnsureLabelsDeleted(namespace, resourceName, usageName string) error
EnsureLabelsDeleted ensures that given labels are deleted on resource
func (*GenericSupervisor) GetInjectedLabels ¶
func (m *GenericSupervisor) GetInjectedLabels(namespace, resourceName, usageName string) (map[string]string, error)
GetInjectedLabels returns labels applied on given resource by usage controller
func (*GenericSupervisor) HasSynced ¶
func (m *GenericSupervisor) HasSynced() bool
HasSynced returns true, because the GenericSupervisor does not use any informers/caches
type KubernetesResourceSupervisor ¶
type KubernetesResourceSupervisor interface { EnsureLabelsCreated(resourceNs, resourceName, usageName string, labels map[string]string) error EnsureLabelsDeleted(resourceNs, resourceName, usageName string) error GetInjectedLabels(resourceNs, resourceName, usageName string) (map[string]string, error) }
KubernetesResourceSupervisor validates if given Kubernetes resource can be modified by ServiceBindingUsage. If yes it can ensure that labels are present or deleted on previous validated resource.
type NotFoundError ¶
type NotFoundError struct {
// contains filtered or unexported fields
}
NotFoundError indicates situation when given resource was not found
func NewNotFoundError ¶
func NewNotFoundError(format string, args ...interface{}) NotFoundError
NewNotFoundError returns a new not found error with given message
func (NotFoundError) Error ¶
func (e NotFoundError) Error() string
func (NotFoundError) NotFound ¶
func (NotFoundError) NotFound() bool
NotFound returns information if such error should be treated as not found
type PodPresetModifier ¶
type PodPresetModifier struct {
// contains filtered or unexported fields
}
PodPresetModifier provides functionality needed to create and delete PodPreset
func NewPodPresetModifier ¶
func NewPodPresetModifier(settingsClient settingsv1alpha1.SettingsV1alpha1Interface) *PodPresetModifier
NewPodPresetModifier creates a new PodPresetModifier
func (*PodPresetModifier) EnsurePodPresetDeleted ¶
func (m *PodPresetModifier) EnsurePodPresetDeleted(namespace, name string) error
EnsurePodPresetDeleted deletes a PodPreset if needed
func (*PodPresetModifier) UpsertPodPreset ¶
func (m *PodPresetModifier) UpsertPodPreset(podPreset *svcatSettings.PodPreset) error
UpsertPodPreset creates a new PodPreset or update it if needed
type ResourceSupervisorAggregator ¶
type ResourceSupervisorAggregator struct {
// contains filtered or unexported fields
}
ResourceSupervisorAggregator aggregates all defined resources supervisors
func NewResourceSupervisorAggregator ¶
func NewResourceSupervisorAggregator() *ResourceSupervisorAggregator
NewResourceSupervisorAggregator returns new instance of ResourceSupervisorAggregator
func (*ResourceSupervisorAggregator) Get ¶
func (f *ResourceSupervisorAggregator) Get(k Kind) (KubernetesResourceSupervisor, error)
Get returns supervisor for given kind
func (*ResourceSupervisorAggregator) Register ¶
func (f *ResourceSupervisorAggregator) Register(k Kind, supervisor KubernetesResourceSupervisor) error
Register adds new resource supervisor
func (*ResourceSupervisorAggregator) Unregister ¶
func (f *ResourceSupervisorAggregator) Unregister(k Kind) error
Unregister removes resource supervisor
type SBUDeletedEvent ¶
SBUDeletedEvent contains information about deleted ServiceBindingUsage
type ServiceBindingUsageController ¶
type ServiceBindingUsageController struct {
// contains filtered or unexported fields
}
ServiceBindingUsageController watches ServiceBindingUsage and injects data to given Deployment/Function
func NewServiceBindingUsage ¶
func NewServiceBindingUsage( appliedSpecStorage appliedSpecStorage, bindingUsageClient sbuClient.ServicecatalogV1alpha1Interface, sbuInformer sbuInformer.ServiceBindingUsageInformer, bindingInformer scInformer.ServiceBindingInformer, kindSupervisors kindsSupervisors, podPresetModifier podPresetModifier, labelsFetcher bindingLabelsFetcher, log logrus.FieldLogger, cbm businessMetric) *ServiceBindingUsageController
NewServiceBindingUsage creates a new ServiceBindingUsageController.
func (*ServiceBindingUsageController) AddOnDeleteListener ¶
func (c *ServiceBindingUsageController) AddOnDeleteListener(listener onDeleteListener)
AddOnDeleteListener adds OnDeleteListener The method is not thread safe
func (*ServiceBindingUsageController) Run ¶
func (c *ServiceBindingUsageController) Run(stopCh <-chan struct{})
Run begins watching and syncing.
type UsageSpec ¶
type UsageSpec struct { UsedBy sbuTypes.LocalReferenceByKindAndName Applied bool }
UsageSpec represents DTO which is used to store information about applied sbu in config map
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Code generated by mockery v1.0.0 Code generated by mockery v1.0.0 Code generated by mockery v1.0.0 Code generated by mockery v1.0.0 Code generated by mockery v1.0.0 Code generated by mockery v1.0.0 Code generated by mockery v1.0.0 Code generated by mockery v1.0.0 Code generated by mockery v1.0.0 Code generated by mockery v1.0.0
|
Code generated by mockery v1.0.0 Code generated by mockery v1.0.0 Code generated by mockery v1.0.0 Code generated by mockery v1.0.0 Code generated by mockery v1.0.0 Code generated by mockery v1.0.0 Code generated by mockery v1.0.0 Code generated by mockery v1.0.0 Code generated by mockery v1.0.0 Code generated by mockery v1.0.0 |
automock
Code generated by mockery v1.0.0
|
Code generated by mockery v1.0.0 |