manager

package
v0.0.0-...-4c477b2 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2025 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTenantFailed = errors.New("tenant failed")
	ErrNoResources  = errors.New("there are no resources deployed that the collector(s) can use")
)

Functions

func GetBridgeNamesFromBridges

func GetBridgeNamesFromBridges(bridges []v1alpha1.Bridge) []string

func GetResourceNamesFromResource

func GetResourceNamesFromResource(resources []model.ResourceOwnedByTenant) []v1alpha1.NamespacedName

Types

type BaseManager

type BaseManager struct {
	client.Client
	logr.Logger
}

BaseManager provides common functionality for all managers

func NewBaseManager

func NewBaseManager(client client.Client, logger logr.Logger) BaseManager

NewBaseManager creates a new base manager

func (*BaseManager) GetBridgeManager

func (b *BaseManager) GetBridgeManager() *BridgeManager

func (*BaseManager) GetTenantResourceManager

func (b *BaseManager) GetTenantResourceManager() *TenantResourceManager

type BridgeManager

type BridgeManager struct {
	BaseManager
}

BridgeManager manages bridge resources

func (*BridgeManager) GetBridgesForTenant

func (b *BridgeManager) GetBridgesForTenant(ctx context.Context, tenantName string) (bridgesOwned []v1alpha1.Bridge, err error)

func (*BridgeManager) ValidateBridgeConnection

func (b *BridgeManager) ValidateBridgeConnection(ctx context.Context, tenantName string, bridge *v1alpha1.Bridge) error

type CollectorManager

type CollectorManager struct {
	BaseManager
}

CollectorManager manages collector resources

func (*CollectorManager) BuildConfigInputForCollector

func (c *CollectorManager) BuildConfigInputForCollector(ctx context.Context, collector *v1alpha1.Collector) (otelcolconfgen.OtelColConfigInput, error)

func (*CollectorManager) OtelCollector

func (c *CollectorManager) OtelCollector(collector *v1alpha1.Collector, otelConfig otelv1beta1.Config, additionalArgs map[string]string, tenants []v1alpha1.Tenant, outputs []components.OutputWithSecretData, saName string) (*otelv1beta1.OpenTelemetryCollector, reconciler.DesiredState)

func (*CollectorManager) ReconcileRBAC

func (c *CollectorManager) ReconcileRBAC(collector *v1alpha1.Collector, scheme *runtime.Scheme) (v1alpha1.NamespacedName, error)

func (*CollectorManager) ValidateConfigInput

func (c *CollectorManager) ValidateConfigInput(cfgInput otelcolconfgen.OtelColConfigInput) error

type TenantResourceManager

type TenantResourceManager struct {
	BaseManager
}

TenantResourceManager is a manager for resources owned by tenants: Subscriptions and Outputs

func (*TenantResourceManager) DisownResources

func (t *TenantResourceManager) DisownResources(ctx context.Context, resourceToDisown []model.ResourceOwnedByTenant)

disownResources fails internally by logging errors individually this is by design so that we don't fail the whole reconciliation when a single resource cannot be disowned

func (*TenantResourceManager) GetLogsourceNamespaceNamesForTenant

func (t *TenantResourceManager) GetLogsourceNamespaceNamesForTenant(ctx context.Context, tenant *v1alpha1.Tenant) ([]string, error)

GetLogsourceNamespaceNamesForTenant returns the namespaces that match the log source namespace selectors of the tenant

func (*TenantResourceManager) GetResourceOwnedByTenant

func (t *TenantResourceManager) GetResourceOwnedByTenant(ctx context.Context, resource model.ResourceOwnedByTenant, tenant *v1alpha1.Tenant) (ownedList []model.ResourceOwnedByTenant, updateList []model.ResourceOwnedByTenant, err error)

GetResourceOwnedByTenant returns a list of resources owned by the tenant and a list of resources that need to be updated

func (*TenantResourceManager) GetResourcesReferencingTenantButNotSelected

func (t *TenantResourceManager) GetResourcesReferencingTenantButNotSelected(ctx context.Context, tenant *v1alpha1.Tenant, resource model.ResourceOwnedByTenant, selectedResources []model.ResourceOwnedByTenant) ([]model.ResourceOwnedByTenant, error)

GetResourcesReferencingTenantButNotSelected returns a list of resources that are referencing the tenant in their status but are not selected by the tenant directly

func (*TenantResourceManager) UpdateResourcesForTenant

func (t *TenantResourceManager) UpdateResourcesForTenant(ctx context.Context, tenantName string, resources []model.ResourceOwnedByTenant) (updatedResources []model.ResourceOwnedByTenant)

updateResourcesForTenant fails internally and logs failures individually this is by design in order to avoid blocking the whole reconciliation in case we cannot update a single resource

func (*TenantResourceManager) ValidateSubscriptionReferencedOutputsWithCache

func (t *TenantResourceManager) ValidateSubscriptionReferencedOutputsWithCache(ctx context.Context, subscription *v1alpha1.Subscription, outputMap map[v1alpha1.NamespacedName]*v1alpha1.Output) ([]v1alpha1.NamespacedName, []string)

ValidateSubscriptionReferencedOutputsWithCache validates outputs referenced by the subscription using a provided cache of outputs

Jump to

Keyboard shortcuts

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