streamline

package
v0.6.39 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: AGPL-3.0, Apache-2.0, MIT Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitGlobalStore

func InitGlobalStore(s store.Store)

func ResetGlobalStore

func ResetGlobalStore()

Types

type EventSubscriber

type EventSubscriber func(event watch.Event)

type GlobalStore

type GlobalStore struct {
	// contains filtered or unexported fields
}

func GetGlobalStore

func GetGlobalStore() *GlobalStore

func (*GlobalStore) CommitTransientSHA

func (in *GlobalStore) CommitTransientSHA(obj unstructured.Unstructured) error

func (*GlobalStore) DeleteComponent

func (in *GlobalStore) DeleteComponent(key smcommon.StoreKey) error

func (*GlobalStore) Expire

func (in *GlobalStore) Expire(serviceID string) error

func (*GlobalStore) ExpireSHA

func (in *GlobalStore) ExpireSHA(obj unstructured.Unstructured) error

func (*GlobalStore) GetComponent

func (in *GlobalStore) GetComponent(obj unstructured.Unstructured) (result *smcommon.Component, err error)

func (*GlobalStore) GetResourceHealth

func (in *GlobalStore) GetResourceHealth(resources []unstructured.Unstructured) (hasPendingResources, hasFailedResources bool, err error)

func (*GlobalStore) SaveHookComponentWithManifestSHA

func (in *GlobalStore) SaveHookComponentWithManifestSHA(manifest, appliedResource unstructured.Unstructured) error

func (*GlobalStore) SetServiceChildren

func (in *GlobalStore) SetServiceChildren(serviceID, parentUID string, keys []smcommon.StoreKey) (int, error)

func (*GlobalStore) SyncAppliedResource

func (in *GlobalStore) SyncAppliedResource(obj unstructured.Unstructured) error

func (*GlobalStore) UpdateComponentSHA

func (in *GlobalStore) UpdateComponentSHA(obj unstructured.Unstructured, shaType store.SHAType) error

type NamespaceCache

type NamespaceCache interface {
	// HandleNamespaceEvent handles namespace events to keep the namespace cache in sync with the cluster state.
	HandleNamespaceEvent(e watch.Event)

	// EnsureNamespace ensures that the namespace exists with the desired metadata.
	// It can be a no-op based on the provided sync config.
	EnsureNamespace(ctx context.Context, namespace string, syncConfig *console.ServiceDeploymentForAgent_SyncConfig) error

	// DeleteNamespace deletes the namespace.
	// It can be a no-op based on the provided sync config.
	DeleteNamespace(ctx context.Context, namespace string, syncConfig *console.ServiceDeploymentForAgent_SyncConfig) error
}

func NewNamespaceCache

func NewNamespaceCache(client kubernetes.Interface) NamespaceCache

type Option

type Option func(*Supervisor)

func WithCacheSyncTimeout

func WithCacheSyncTimeout(d time.Duration) Option

func WithEventSubscribers

func WithEventSubscribers(gvr schema.GroupVersionResource, subscriber []EventSubscriber) Option

func WithMaxNotFoundRetries

func WithMaxNotFoundRetries(n int) Option

func WithRestartDelay

func WithRestartDelay(d time.Duration) Option

func WithSynchronizerResyncInterval

func WithSynchronizerResyncInterval(d time.Duration) Option

type StatusSynchronizer

type StatusSynchronizer struct {
	// contains filtered or unexported fields
}

func NewStatusSynchronizer

func NewStatusSynchronizer(client client.Client, cacheTTL time.Duration) StatusSynchronizer

NewStatusSynchronizer creates a new StatusSynchronizer with rate limiting set to 10 calls per second.

func (*StatusSynchronizer) UpdateServiceComponents

func (in *StatusSynchronizer) UpdateServiceComponents(serviceId string, components []*console.ComponentAttributes) error

type Supervisor

type Supervisor struct {
	// contains filtered or unexported fields
}

func NewSupervisor

func NewSupervisor(client dynamic.Interface, store store.Store, statusSynchronizer StatusSynchronizer,
	discoveryCache discoverycache.Cache, svcCache *cache.Cache[console.ServiceDeploymentForAgent], options ...Option) *Supervisor

func (*Supervisor) MaybeRegister

func (in *Supervisor) MaybeRegister(gvr schema.GroupVersionResource)

func (*Supervisor) Register

func (in *Supervisor) Register(gvr schema.GroupVersionResource)

func (*Supervisor) Run

func (in *Supervisor) Run(ctx context.Context)

func (*Supervisor) Stop

func (in *Supervisor) Stop()

func (*Supervisor) Unregister

func (in *Supervisor) Unregister(gvr schema.GroupVersionResource)

func (*Supervisor) WaitForCacheSync

func (in *Supervisor) WaitForCacheSync(ctx context.Context) error

type Synchronizer

type Synchronizer interface {
	Start(ctx context.Context) error
	Stop()
	Started() bool
}

func NewSynchronizer

func NewSynchronizer(client dynamic.Interface, gvr schema.GroupVersionResource, gvk schema.GroupVersionKind, store store.Store, resyncInterval time.Duration, componentQueue workqueue.TypedRateLimitingInterface[string], subscribers []EventSubscriber) Synchronizer

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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