Documentation
¶
Index ¶
- func InitGlobalStore(s store.Store)
- func ResetGlobalStore()
- type EventSubscriber
- type GlobalStore
- func (in *GlobalStore) CommitTransientSHA(obj unstructured.Unstructured) error
- func (in *GlobalStore) DeleteComponent(key smcommon.StoreKey) error
- func (in *GlobalStore) Expire(serviceID string) error
- func (in *GlobalStore) ExpireSHA(obj unstructured.Unstructured) error
- func (in *GlobalStore) GetComponent(obj unstructured.Unstructured) (result *smcommon.Component, err error)
- func (in *GlobalStore) GetResourceHealth(resources []unstructured.Unstructured) (hasPendingResources, hasFailedResources bool, err error)
- func (in *GlobalStore) SaveHookComponentWithManifestSHA(manifest, appliedResource unstructured.Unstructured) error
- func (in *GlobalStore) SetServiceChildren(serviceID, parentUID string, keys []smcommon.StoreKey) (int, error)
- func (in *GlobalStore) SyncAppliedResource(obj unstructured.Unstructured) error
- func (in *GlobalStore) UpdateComponentSHA(obj unstructured.Unstructured, shaType store.SHAType) error
- type NamespaceCache
- type Option
- type StatusSynchronizer
- type Supervisor
- func (in *Supervisor) MaybeRegister(gvr schema.GroupVersionResource)
- func (in *Supervisor) Register(gvr schema.GroupVersionResource)
- func (in *Supervisor) Run(ctx context.Context)
- func (in *Supervisor) Stop()
- func (in *Supervisor) Unregister(gvr schema.GroupVersionResource)
- func (in *Supervisor) WaitForCacheSync(ctx context.Context) error
- type Synchronizer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitGlobalStore ¶
func ResetGlobalStore ¶
func ResetGlobalStore()
Types ¶
type EventSubscriber ¶
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 (*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 WithEventSubscribers ¶
func WithEventSubscribers(gvr schema.GroupVersionResource, subscriber []EventSubscriber) Option
func WithMaxNotFoundRetries ¶
func WithRestartDelay ¶
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 ¶
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
Source Files
¶
Click to show internal directories.
Click to hide internal directories.