Documentation ¶
Overview ¶
Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2024 Datadog, Inc.
Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2024 Datadog, Inc.
Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2024 Datadog, Inc.
Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2024 Datadog, Inc.
Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2024 Datadog, Inc.
Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2024 Datadog, Inc.
Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2024 Datadog, Inc.
Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2024 Datadog, Inc.
Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2024 Datadog, Inc.
Index ¶
- Constants
- func ContainersChanged(oldPodSpec, newPodSpec *corev1.PodSpec, log *zap.SugaredLogger) (bool, map[string]string, map[string]string, error)
- func Hash(container *corev1.Container) (string, error)
- func HashContainerList(containers *[]corev1.Container) (map[string]string, error)
- func HashPodSpec(podSpec *corev1.PodSpec) (map[string]string, map[string]string, error)
- func HashesChanged(oldHashes, newHashes map[string]string, log *zap.SugaredLogger) bool
- type CacheContextFunc
- type CacheContextFuncMock
- type CacheContextFuncMock_Execute_Call
- func (_c *CacheContextFuncMock_Execute_Call) Return(ctx context.Context, cancel context.CancelFunc) *CacheContextFuncMock_Execute_Call
- func (_c *CacheContextFuncMock_Execute_Call) Run(run func()) *CacheContextFuncMock_Execute_Call
- func (_c *CacheContextFuncMock_Execute_Call) RunAndReturn(run func() (context.Context, context.CancelFunc)) *CacheContextFuncMock_Execute_Call
- type CacheContextFuncMock_Expecter
- type ChaosPodHandler
- type CtxTuple
- type DeploymentHandler
- func (h DeploymentHandler) FetchAssociatedDisruptionRollouts(deployment *appsv1.Deployment) (*chaosv1beta1.DisruptionRolloutList, error)
- func (h DeploymentHandler) HasAssociatedDisruptionRollout(deployment *appsv1.Deployment) (bool, error)
- func (h DeploymentHandler) OnAdd(obj interface{})
- func (h DeploymentHandler) OnDelete(_ interface{})
- func (h DeploymentHandler) OnUpdate(oldObj, newObj interface{})
- func (h DeploymentHandler) UpdateDisruptionRolloutStatus(deployment *appsv1.Deployment, ...) error
- type DisruptionTargetHandler
- func (d DisruptionTargetHandler) OnAdd(obj interface{}, _ bool)
- func (d DisruptionTargetHandler) OnChangeHandleMetricsSink(pod *corev1.Pod, node *corev1.Node, okPod, okNode bool, event WatcherEventType)
- func (d DisruptionTargetHandler) OnChangeHandleNotifierSink(oldPod, newPod *corev1.Pod, oldNode, newNode *corev1.Node, ...)
- func (d DisruptionTargetHandler) OnDelete(obj interface{})
- func (d DisruptionTargetHandler) OnUpdate(oldObj, newObj interface{})
- type DisruptionsWatchersManager
- type DisruptionsWatchersManagerMock
- func (_m *DisruptionsWatchersManagerMock) CreateAllWatchers(disruption *v1beta1.Disruption, watcherManagerMock Manager, ...) error
- func (_m *DisruptionsWatchersManagerMock) EXPECT() *DisruptionsWatchersManagerMock_Expecter
- func (_m *DisruptionsWatchersManagerMock) RemoveAllExpiredWatchers()
- func (_m *DisruptionsWatchersManagerMock) RemoveAllOrphanWatchers() error
- func (_m *DisruptionsWatchersManagerMock) RemoveAllWatchers(disruption *v1beta1.Disruption)
- type DisruptionsWatchersManagerMock_CreateAllWatchers_Call
- func (_c *DisruptionsWatchersManagerMock_CreateAllWatchers_Call) Return(_a0 error) *DisruptionsWatchersManagerMock_CreateAllWatchers_Call
- func (_c *DisruptionsWatchersManagerMock_CreateAllWatchers_Call) Run(run func(disruption *v1beta1.Disruption, watcherManagerMock Manager, ...)) *DisruptionsWatchersManagerMock_CreateAllWatchers_Call
- func (_c *DisruptionsWatchersManagerMock_CreateAllWatchers_Call) RunAndReturn(run func(*v1beta1.Disruption, Manager, cache.Cache) error) *DisruptionsWatchersManagerMock_CreateAllWatchers_Call
- type DisruptionsWatchersManagerMock_Expecter
- func (_e *DisruptionsWatchersManagerMock_Expecter) CreateAllWatchers(disruption interface{}, watcherManagerMock interface{}, cacheMock interface{}) *DisruptionsWatchersManagerMock_CreateAllWatchers_Call
- func (_e *DisruptionsWatchersManagerMock_Expecter) RemoveAllExpiredWatchers() *DisruptionsWatchersManagerMock_RemoveAllExpiredWatchers_Call
- func (_e *DisruptionsWatchersManagerMock_Expecter) RemoveAllOrphanWatchers() *DisruptionsWatchersManagerMock_RemoveAllOrphanWatchers_Call
- func (_e *DisruptionsWatchersManagerMock_Expecter) RemoveAllWatchers(disruption interface{}) *DisruptionsWatchersManagerMock_RemoveAllWatchers_Call
- type DisruptionsWatchersManagerMock_RemoveAllExpiredWatchers_Call
- func (_c *DisruptionsWatchersManagerMock_RemoveAllExpiredWatchers_Call) Return() *DisruptionsWatchersManagerMock_RemoveAllExpiredWatchers_Call
- func (_c *DisruptionsWatchersManagerMock_RemoveAllExpiredWatchers_Call) Run(run func()) *DisruptionsWatchersManagerMock_RemoveAllExpiredWatchers_Call
- func (_c *DisruptionsWatchersManagerMock_RemoveAllExpiredWatchers_Call) RunAndReturn(run func()) *DisruptionsWatchersManagerMock_RemoveAllExpiredWatchers_Call
- type DisruptionsWatchersManagerMock_RemoveAllOrphanWatchers_Call
- func (_c *DisruptionsWatchersManagerMock_RemoveAllOrphanWatchers_Call) Return(_a0 error) *DisruptionsWatchersManagerMock_RemoveAllOrphanWatchers_Call
- func (_c *DisruptionsWatchersManagerMock_RemoveAllOrphanWatchers_Call) Run(run func()) *DisruptionsWatchersManagerMock_RemoveAllOrphanWatchers_Call
- func (_c *DisruptionsWatchersManagerMock_RemoveAllOrphanWatchers_Call) RunAndReturn(run func() error) *DisruptionsWatchersManagerMock_RemoveAllOrphanWatchers_Call
- type DisruptionsWatchersManagerMock_RemoveAllWatchers_Call
- func (_c *DisruptionsWatchersManagerMock_RemoveAllWatchers_Call) Return() *DisruptionsWatchersManagerMock_RemoveAllWatchers_Call
- func (_c *DisruptionsWatchersManagerMock_RemoveAllWatchers_Call) Run(run func(disruption *v1beta1.Disruption)) *DisruptionsWatchersManagerMock_RemoveAllWatchers_Call
- func (_c *DisruptionsWatchersManagerMock_RemoveAllWatchers_Call) RunAndReturn(run func(*v1beta1.Disruption)) *DisruptionsWatchersManagerMock_RemoveAllWatchers_Call
- type Factory
- type FactoryConfig
- type FactoryMock
- func (_m *FactoryMock) EXPECT() *FactoryMock_Expecter
- func (_m *FactoryMock) NewChaosPodWatcher(name string, disruption *v1beta1.Disruption, cacheMock cache.Cache) (Watcher, error)
- func (_m *FactoryMock) NewDisruptionTargetWatcher(name string, enableObserver bool, disruption *v1beta1.Disruption, ...) (Watcher, error)
- type FactoryMock_Expecter
- func (_e *FactoryMock_Expecter) NewChaosPodWatcher(name interface{}, disruption interface{}, cacheMock interface{}) *FactoryMock_NewChaosPodWatcher_Call
- func (_e *FactoryMock_Expecter) NewDisruptionTargetWatcher(name interface{}, enableObserver interface{}, disruption interface{}, ...) *FactoryMock_NewDisruptionTargetWatcher_Call
- type FactoryMock_NewChaosPodWatcher_Call
- func (_c *FactoryMock_NewChaosPodWatcher_Call) Return(_a0 Watcher, _a1 error) *FactoryMock_NewChaosPodWatcher_Call
- func (_c *FactoryMock_NewChaosPodWatcher_Call) Run(run func(name string, disruption *v1beta1.Disruption, cacheMock cache.Cache)) *FactoryMock_NewChaosPodWatcher_Call
- func (_c *FactoryMock_NewChaosPodWatcher_Call) RunAndReturn(run func(string, *v1beta1.Disruption, cache.Cache) (Watcher, error)) *FactoryMock_NewChaosPodWatcher_Call
- type FactoryMock_NewDisruptionTargetWatcher_Call
- func (_c *FactoryMock_NewDisruptionTargetWatcher_Call) Return(_a0 Watcher, _a1 error) *FactoryMock_NewDisruptionTargetWatcher_Call
- func (_c *FactoryMock_NewDisruptionTargetWatcher_Call) Run(...) *FactoryMock_NewDisruptionTargetWatcher_Call
- func (_c *FactoryMock_NewDisruptionTargetWatcher_Call) RunAndReturn(run func(string, bool, *v1beta1.Disruption, cache.Cache) (Watcher, error)) *FactoryMock_NewDisruptionTargetWatcher_Call
- type Manager
- type ManagerMock
- func (_m *ManagerMock) AddWatcher(watcher Watcher) error
- func (_m *ManagerMock) EXPECT() *ManagerMock_Expecter
- func (_m *ManagerMock) GetWatcher(name string) Watcher
- func (_m *ManagerMock) RemoveAllWatchers()
- func (_m *ManagerMock) RemoveExpiredWatchers()
- func (_m *ManagerMock) RemoveOrphanWatchers()
- func (_m *ManagerMock) RemoveWatcher(watcher Watcher) error
- type ManagerMock_AddWatcher_Call
- type ManagerMock_Expecter
- func (_e *ManagerMock_Expecter) AddWatcher(watcher interface{}) *ManagerMock_AddWatcher_Call
- func (_e *ManagerMock_Expecter) GetWatcher(name interface{}) *ManagerMock_GetWatcher_Call
- func (_e *ManagerMock_Expecter) RemoveAllWatchers() *ManagerMock_RemoveAllWatchers_Call
- func (_e *ManagerMock_Expecter) RemoveExpiredWatchers() *ManagerMock_RemoveExpiredWatchers_Call
- func (_e *ManagerMock_Expecter) RemoveOrphanWatchers() *ManagerMock_RemoveOrphanWatchers_Call
- func (_e *ManagerMock_Expecter) RemoveWatcher(watcher interface{}) *ManagerMock_RemoveWatcher_Call
- type ManagerMock_GetWatcher_Call
- type ManagerMock_RemoveAllWatchers_Call
- type ManagerMock_RemoveExpiredWatchers_Call
- func (_c *ManagerMock_RemoveExpiredWatchers_Call) Return() *ManagerMock_RemoveExpiredWatchers_Call
- func (_c *ManagerMock_RemoveExpiredWatchers_Call) Run(run func()) *ManagerMock_RemoveExpiredWatchers_Call
- func (_c *ManagerMock_RemoveExpiredWatchers_Call) RunAndReturn(run func()) *ManagerMock_RemoveExpiredWatchers_Call
- type ManagerMock_RemoveOrphanWatchers_Call
- func (_c *ManagerMock_RemoveOrphanWatchers_Call) Return() *ManagerMock_RemoveOrphanWatchers_Call
- func (_c *ManagerMock_RemoveOrphanWatchers_Call) Run(run func()) *ManagerMock_RemoveOrphanWatchers_Call
- func (_c *ManagerMock_RemoveOrphanWatchers_Call) RunAndReturn(run func()) *ManagerMock_RemoveOrphanWatchers_Call
- type ManagerMock_RemoveWatcher_Call
- func (_c *ManagerMock_RemoveWatcher_Call) Return(_a0 error) *ManagerMock_RemoveWatcher_Call
- func (_c *ManagerMock_RemoveWatcher_Call) Run(run func(watcher Watcher)) *ManagerMock_RemoveWatcher_Call
- func (_c *ManagerMock_RemoveWatcher_Call) RunAndReturn(run func(Watcher) error) *ManagerMock_RemoveWatcher_Call
- type StatefulSetHandler
- func (h StatefulSetHandler) FetchAssociatedDisruptionRollouts(statefulset *appsv1.StatefulSet) (*chaosv1beta1.DisruptionRolloutList, error)
- func (h StatefulSetHandler) HasAssociatedDisruptionRollout(statefulset *appsv1.StatefulSet) (bool, error)
- func (h StatefulSetHandler) OnAdd(obj interface{})
- func (h StatefulSetHandler) OnDelete(_ interface{})
- func (h StatefulSetHandler) OnUpdate(oldObj, newObj interface{})
- func (h StatefulSetHandler) UpdateDisruptionRolloutStatus(statefulset *appsv1.StatefulSet, ...) error
- type Watcher
- type WatcherConfig
- type WatcherEventType
- type WatcherManagers
- type WatcherMetricsAdapter
- type WatcherMetricsAdapterMock
- type WatcherMetricsAdapterMock_Expecter
- type WatcherMetricsAdapterMock_OnChange_Call
- func (_c *WatcherMetricsAdapterMock_OnChange_Call) Return() *WatcherMetricsAdapterMock_OnChange_Call
- func (_c *WatcherMetricsAdapterMock_OnChange_Call) Run(...) *WatcherMetricsAdapterMock_OnChange_Call
- func (_c *WatcherMetricsAdapterMock_OnChange_Call) RunAndReturn(...) *WatcherMetricsAdapterMock_OnChange_Call
- type WatcherMock
- func (_m *WatcherMock) Clean()
- func (_m *WatcherMock) EXPECT() *WatcherMock_Expecter
- func (_m *WatcherMock) GetCacheSource() (source.SyncingSource, error)
- func (_m *WatcherMock) GetConfig() WatcherConfig
- func (_m *WatcherMock) GetContextTuple() (CtxTuple, error)
- func (_m *WatcherMock) GetName() string
- func (_m *WatcherMock) IsExpired() bool
- func (_m *WatcherMock) Start() error
- type WatcherMock_Clean_Call
- type WatcherMock_Expecter
- func (_e *WatcherMock_Expecter) Clean() *WatcherMock_Clean_Call
- func (_e *WatcherMock_Expecter) GetCacheSource() *WatcherMock_GetCacheSource_Call
- func (_e *WatcherMock_Expecter) GetConfig() *WatcherMock_GetConfig_Call
- func (_e *WatcherMock_Expecter) GetContextTuple() *WatcherMock_GetContextTuple_Call
- func (_e *WatcherMock_Expecter) GetName() *WatcherMock_GetName_Call
- func (_e *WatcherMock_Expecter) IsExpired() *WatcherMock_IsExpired_Call
- func (_e *WatcherMock_Expecter) Start() *WatcherMock_Start_Call
- type WatcherMock_GetCacheSource_Call
- func (_c *WatcherMock_GetCacheSource_Call) Return(_a0 source.SyncingSource, _a1 error) *WatcherMock_GetCacheSource_Call
- func (_c *WatcherMock_GetCacheSource_Call) Run(run func()) *WatcherMock_GetCacheSource_Call
- func (_c *WatcherMock_GetCacheSource_Call) RunAndReturn(run func() (source.SyncingSource, error)) *WatcherMock_GetCacheSource_Call
- type WatcherMock_GetConfig_Call
- type WatcherMock_GetContextTuple_Call
- func (_c *WatcherMock_GetContextTuple_Call) Return(_a0 CtxTuple, _a1 error) *WatcherMock_GetContextTuple_Call
- func (_c *WatcherMock_GetContextTuple_Call) Run(run func()) *WatcherMock_GetContextTuple_Call
- func (_c *WatcherMock_GetContextTuple_Call) RunAndReturn(run func() (CtxTuple, error)) *WatcherMock_GetContextTuple_Call
- type WatcherMock_GetName_Call
- type WatcherMock_IsExpired_Call
- type WatcherMock_Start_Call
- type WatcherName
- type Watchers
Constants ¶
const ChaosPodHandlerName = "ChaosPodHandler"
const DisruptionTargetHandlerName = "DisruptionTargetHandler"
Variables ¶
This section is empty.
Functions ¶
func ContainersChanged ¶
func HashContainerList ¶
func HashPodSpec ¶
func HashesChanged ¶
func HashesChanged(oldHashes, newHashes map[string]string, log *zap.SugaredLogger) bool
Types ¶
type CacheContextFunc ¶
type CacheContextFunc func() (ctx context.Context, cancel context.CancelFunc)
CacheContextFunc is a function that returns a context and a cancel function.
type CacheContextFuncMock ¶
CacheContextFuncMock is an autogenerated mock type for the CacheContextFunc type
func NewCacheContextFuncMock ¶
func NewCacheContextFuncMock(t interface { mock.TestingT Cleanup(func()) }) *CacheContextFuncMock
NewCacheContextFuncMock creates a new instance of CacheContextFuncMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*CacheContextFuncMock) EXPECT ¶
func (_m *CacheContextFuncMock) EXPECT() *CacheContextFuncMock_Expecter
func (*CacheContextFuncMock) Execute ¶
func (_m *CacheContextFuncMock) Execute() (context.Context, context.CancelFunc)
Execute provides a mock function with given fields:
type CacheContextFuncMock_Execute_Call ¶
CacheContextFuncMock_Execute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Execute'
func (*CacheContextFuncMock_Execute_Call) Return ¶
func (_c *CacheContextFuncMock_Execute_Call) Return(ctx context.Context, cancel context.CancelFunc) *CacheContextFuncMock_Execute_Call
func (*CacheContextFuncMock_Execute_Call) Run ¶
func (_c *CacheContextFuncMock_Execute_Call) Run(run func()) *CacheContextFuncMock_Execute_Call
func (*CacheContextFuncMock_Execute_Call) RunAndReturn ¶
func (_c *CacheContextFuncMock_Execute_Call) RunAndReturn(run func() (context.Context, context.CancelFunc)) *CacheContextFuncMock_Execute_Call
type CacheContextFuncMock_Expecter ¶
type CacheContextFuncMock_Expecter struct {
// contains filtered or unexported fields
}
func (*CacheContextFuncMock_Expecter) Execute ¶
func (_e *CacheContextFuncMock_Expecter) Execute() *CacheContextFuncMock_Execute_Call
Execute is a helper method to define mock.On call
type ChaosPodHandler ¶
type ChaosPodHandler struct {
// contains filtered or unexported fields
}
ChaosPodHandler handles the lifecycle of chaos pods to send notifications if needed
func NewChaosPodHandler ¶
func NewChaosPodHandler(disruption *chaosv1beta1.Disruption, recorder record.EventRecorder, logger *zap.SugaredLogger, metricsAdapter WatcherMetricsAdapter) ChaosPodHandler
NewChaosPodHandler creates a new instance of ChaosPodHandler
func (ChaosPodHandler) OnAdd ¶
func (w ChaosPodHandler) OnAdd(_ interface{}, _ bool)
OnAdd is a handler function for the add of the chaos pod
func (ChaosPodHandler) OnDelete ¶
func (w ChaosPodHandler) OnDelete(_ interface{})
OnDelete is a handler function for the delete of the chaos pod
func (ChaosPodHandler) OnUpdate ¶
func (w ChaosPodHandler) OnUpdate(oldObj, newObj interface{})
OnUpdate is a handler function for the update of the chaos pod
type CtxTuple ¶
type CtxTuple struct { // CancelFunc is a function that can be called to cancel the associated context. CancelFunc context.CancelFunc // Ctx is a context.Context object that is used to manage the lifetime of an operation. Ctx context.Context // DisruptionNamespacedName is the namespaced name of a Disruption resource that is associated with this CtxTuple. DisruptionNamespacedName types.NamespacedName }
CtxTuple is a struct that holds a context and its cancel function, as well as a NamespacedName that identifies a Disruption resource.
type DeploymentHandler ¶
func NewDeploymentHandler ¶
func NewDeploymentHandler(client client.Client, logger *zap.SugaredLogger) DeploymentHandler
func (DeploymentHandler) FetchAssociatedDisruptionRollouts ¶
func (h DeploymentHandler) FetchAssociatedDisruptionRollouts(deployment *appsv1.Deployment) (*chaosv1beta1.DisruptionRolloutList, error)
func (DeploymentHandler) HasAssociatedDisruptionRollout ¶
func (h DeploymentHandler) HasAssociatedDisruptionRollout(deployment *appsv1.Deployment) (bool, error)
func (DeploymentHandler) OnAdd ¶
func (h DeploymentHandler) OnAdd(obj interface{})
OnAdd is a handler function for the add of a deployment
func (DeploymentHandler) OnDelete ¶
func (h DeploymentHandler) OnDelete(_ interface{})
OnDelete is a handler function for the delete of a deployment
func (DeploymentHandler) OnUpdate ¶
func (h DeploymentHandler) OnUpdate(oldObj, newObj interface{})
OnUpdate is a handler function for the update of a deployment
func (DeploymentHandler) UpdateDisruptionRolloutStatus ¶
func (h DeploymentHandler) UpdateDisruptionRolloutStatus(deployment *appsv1.Deployment, initContainersHash, containersHash map[string]string) error
type DisruptionTargetHandler ¶
type DisruptionTargetHandler struct {
// contains filtered or unexported fields
}
DisruptionTargetHandler struct used to manage what to do when changes occur on the watched objects in the cache
func (DisruptionTargetHandler) OnAdd ¶
func (d DisruptionTargetHandler) OnAdd(obj interface{}, _ bool)
OnAdd new target
func (DisruptionTargetHandler) OnChangeHandleMetricsSink ¶
func (d DisruptionTargetHandler) OnChangeHandleMetricsSink(pod *corev1.Pod, node *corev1.Node, okPod, okNode bool, event WatcherEventType)
OnChangeHandleMetricsSink Trigger Metric Sink on changes in the targets
func (DisruptionTargetHandler) OnChangeHandleNotifierSink ¶
func (d DisruptionTargetHandler) OnChangeHandleNotifierSink(oldPod, newPod *corev1.Pod, oldNode, newNode *corev1.Node, okOldPod, okNewPod, okOldNode, okNewNode bool)
OnChangeHandleNotifierSink Trigger Notifier Sink on changes in the targets
func (DisruptionTargetHandler) OnDelete ¶
func (d DisruptionTargetHandler) OnDelete(obj interface{})
OnDelete target
func (DisruptionTargetHandler) OnUpdate ¶
func (d DisruptionTargetHandler) OnUpdate(oldObj, newObj interface{})
OnUpdate target
type DisruptionsWatchersManager ¶
type DisruptionsWatchersManager interface { // CreateAllWatchers adds new Watchers instances for a disruption CreateAllWatchers(disruption *v1beta1.Disruption, watcherManagerMock Manager, cacheMock k8scontrollercache.Cache) error // RemoveAllWatchers removes all existing Watchers of a disruption RemoveAllWatchers(disruption *v1beta1.Disruption) // RemoveAllOrphanWatchers removes all watchers linked to an expired disruption RemoveAllOrphanWatchers() error // RemoveAllExpiredWatchers removes all expired Watchers RemoveAllExpiredWatchers() }
DisruptionsWatchersManager defines the interface for a manager that can handle adding, removing Watchers for a disruption
func NewDisruptionsWatchersManager ¶
func NewDisruptionsWatchersManager(controller controller.Controller, factory Factory, reader client.Reader, logger *zap.SugaredLogger) DisruptionsWatchersManager
NewDisruptionsWatchersManager return a new DisruptionsWatchersManager instance
type DisruptionsWatchersManagerMock ¶
DisruptionsWatchersManagerMock is an autogenerated mock type for the DisruptionsWatchersManager type
func NewDisruptionsWatchersManagerMock ¶
func NewDisruptionsWatchersManagerMock(t interface { mock.TestingT Cleanup(func()) }) *DisruptionsWatchersManagerMock
NewDisruptionsWatchersManagerMock creates a new instance of DisruptionsWatchersManagerMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*DisruptionsWatchersManagerMock) CreateAllWatchers ¶
func (_m *DisruptionsWatchersManagerMock) CreateAllWatchers(disruption *v1beta1.Disruption, watcherManagerMock Manager, cacheMock cache.Cache) error
CreateAllWatchers provides a mock function with given fields: disruption, watcherManagerMock, cacheMock
func (*DisruptionsWatchersManagerMock) EXPECT ¶
func (_m *DisruptionsWatchersManagerMock) EXPECT() *DisruptionsWatchersManagerMock_Expecter
func (*DisruptionsWatchersManagerMock) RemoveAllExpiredWatchers ¶
func (_m *DisruptionsWatchersManagerMock) RemoveAllExpiredWatchers()
RemoveAllExpiredWatchers provides a mock function with given fields:
func (*DisruptionsWatchersManagerMock) RemoveAllOrphanWatchers ¶
func (_m *DisruptionsWatchersManagerMock) RemoveAllOrphanWatchers() error
RemoveAllOrphanWatchers provides a mock function with given fields:
func (*DisruptionsWatchersManagerMock) RemoveAllWatchers ¶
func (_m *DisruptionsWatchersManagerMock) RemoveAllWatchers(disruption *v1beta1.Disruption)
RemoveAllWatchers provides a mock function with given fields: disruption
type DisruptionsWatchersManagerMock_CreateAllWatchers_Call ¶
DisruptionsWatchersManagerMock_CreateAllWatchers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateAllWatchers'
func (*DisruptionsWatchersManagerMock_CreateAllWatchers_Call) Run ¶
func (_c *DisruptionsWatchersManagerMock_CreateAllWatchers_Call) Run(run func(disruption *v1beta1.Disruption, watcherManagerMock Manager, cacheMock cache.Cache)) *DisruptionsWatchersManagerMock_CreateAllWatchers_Call
func (*DisruptionsWatchersManagerMock_CreateAllWatchers_Call) RunAndReturn ¶
func (_c *DisruptionsWatchersManagerMock_CreateAllWatchers_Call) RunAndReturn(run func(*v1beta1.Disruption, Manager, cache.Cache) error) *DisruptionsWatchersManagerMock_CreateAllWatchers_Call
type DisruptionsWatchersManagerMock_Expecter ¶
type DisruptionsWatchersManagerMock_Expecter struct {
// contains filtered or unexported fields
}
func (*DisruptionsWatchersManagerMock_Expecter) CreateAllWatchers ¶
func (_e *DisruptionsWatchersManagerMock_Expecter) CreateAllWatchers(disruption interface{}, watcherManagerMock interface{}, cacheMock interface{}) *DisruptionsWatchersManagerMock_CreateAllWatchers_Call
CreateAllWatchers is a helper method to define mock.On call
- disruption *v1beta1.Disruption
- watcherManagerMock Manager
- cacheMock cache.Cache
func (*DisruptionsWatchersManagerMock_Expecter) RemoveAllExpiredWatchers ¶
func (_e *DisruptionsWatchersManagerMock_Expecter) RemoveAllExpiredWatchers() *DisruptionsWatchersManagerMock_RemoveAllExpiredWatchers_Call
RemoveAllExpiredWatchers is a helper method to define mock.On call
func (*DisruptionsWatchersManagerMock_Expecter) RemoveAllOrphanWatchers ¶
func (_e *DisruptionsWatchersManagerMock_Expecter) RemoveAllOrphanWatchers() *DisruptionsWatchersManagerMock_RemoveAllOrphanWatchers_Call
RemoveAllOrphanWatchers is a helper method to define mock.On call
func (*DisruptionsWatchersManagerMock_Expecter) RemoveAllWatchers ¶
func (_e *DisruptionsWatchersManagerMock_Expecter) RemoveAllWatchers(disruption interface{}) *DisruptionsWatchersManagerMock_RemoveAllWatchers_Call
RemoveAllWatchers is a helper method to define mock.On call
- disruption *v1beta1.Disruption
type DisruptionsWatchersManagerMock_RemoveAllExpiredWatchers_Call ¶
DisruptionsWatchersManagerMock_RemoveAllExpiredWatchers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveAllExpiredWatchers'
func (*DisruptionsWatchersManagerMock_RemoveAllExpiredWatchers_Call) RunAndReturn ¶
func (_c *DisruptionsWatchersManagerMock_RemoveAllExpiredWatchers_Call) RunAndReturn(run func()) *DisruptionsWatchersManagerMock_RemoveAllExpiredWatchers_Call
type DisruptionsWatchersManagerMock_RemoveAllOrphanWatchers_Call ¶
DisruptionsWatchersManagerMock_RemoveAllOrphanWatchers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveAllOrphanWatchers'
func (*DisruptionsWatchersManagerMock_RemoveAllOrphanWatchers_Call) RunAndReturn ¶
func (_c *DisruptionsWatchersManagerMock_RemoveAllOrphanWatchers_Call) RunAndReturn(run func() error) *DisruptionsWatchersManagerMock_RemoveAllOrphanWatchers_Call
type DisruptionsWatchersManagerMock_RemoveAllWatchers_Call ¶
DisruptionsWatchersManagerMock_RemoveAllWatchers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveAllWatchers'
func (*DisruptionsWatchersManagerMock_RemoveAllWatchers_Call) Run ¶
func (_c *DisruptionsWatchersManagerMock_RemoveAllWatchers_Call) Run(run func(disruption *v1beta1.Disruption)) *DisruptionsWatchersManagerMock_RemoveAllWatchers_Call
func (*DisruptionsWatchersManagerMock_RemoveAllWatchers_Call) RunAndReturn ¶
func (_c *DisruptionsWatchersManagerMock_RemoveAllWatchers_Call) RunAndReturn(run func(*v1beta1.Disruption)) *DisruptionsWatchersManagerMock_RemoveAllWatchers_Call
type Factory ¶
type Factory interface { // NewChaosPodWatcher creates a new ChaosPodWatcher with the given name, disruption, and cache. NewChaosPodWatcher(name string, disruption *v1beta1.Disruption, cacheMock k8scache.Cache) (Watcher, error) // NewDisruptionTargetWatcher creates a new DisruptionTargetWatcher with the given name, enableObserver flag, disruption, and cache. NewDisruptionTargetWatcher(name string, enableObserver bool, disruption *v1beta1.Disruption, cacheMock k8scache.Cache) (Watcher, error) }
Factory is an interface for creating Watchers.
func NewWatcherFactory ¶
func NewWatcherFactory(config FactoryConfig) Factory
NewWatcherFactory creates a new instance of the factory for creating new watcher instances.
type FactoryConfig ¶
type FactoryConfig struct { Log *zap.SugaredLogger MetricSink metrics.Sink Reader client.Reader Recorder record.EventRecorder ChaosNamespace string }
type FactoryMock ¶
FactoryMock is an autogenerated mock type for the Factory type
func NewFactoryMock ¶
func NewFactoryMock(t interface { mock.TestingT Cleanup(func()) }) *FactoryMock
NewFactoryMock creates a new instance of FactoryMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*FactoryMock) EXPECT ¶
func (_m *FactoryMock) EXPECT() *FactoryMock_Expecter
func (*FactoryMock) NewChaosPodWatcher ¶
func (_m *FactoryMock) NewChaosPodWatcher(name string, disruption *v1beta1.Disruption, cacheMock cache.Cache) (Watcher, error)
NewChaosPodWatcher provides a mock function with given fields: name, disruption, cacheMock
func (*FactoryMock) NewDisruptionTargetWatcher ¶
func (_m *FactoryMock) NewDisruptionTargetWatcher(name string, enableObserver bool, disruption *v1beta1.Disruption, cacheMock cache.Cache) (Watcher, error)
NewDisruptionTargetWatcher provides a mock function with given fields: name, enableObserver, disruption, cacheMock
type FactoryMock_Expecter ¶
type FactoryMock_Expecter struct {
// contains filtered or unexported fields
}
func (*FactoryMock_Expecter) NewChaosPodWatcher ¶
func (_e *FactoryMock_Expecter) NewChaosPodWatcher(name interface{}, disruption interface{}, cacheMock interface{}) *FactoryMock_NewChaosPodWatcher_Call
NewChaosPodWatcher is a helper method to define mock.On call
- name string
- disruption *v1beta1.Disruption
- cacheMock cache.Cache
func (*FactoryMock_Expecter) NewDisruptionTargetWatcher ¶
func (_e *FactoryMock_Expecter) NewDisruptionTargetWatcher(name interface{}, enableObserver interface{}, disruption interface{}, cacheMock interface{}) *FactoryMock_NewDisruptionTargetWatcher_Call
NewDisruptionTargetWatcher is a helper method to define mock.On call
- name string
- enableObserver bool
- disruption *v1beta1.Disruption
- cacheMock cache.Cache
type FactoryMock_NewChaosPodWatcher_Call ¶
FactoryMock_NewChaosPodWatcher_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewChaosPodWatcher'
func (*FactoryMock_NewChaosPodWatcher_Call) Return ¶
func (_c *FactoryMock_NewChaosPodWatcher_Call) Return(_a0 Watcher, _a1 error) *FactoryMock_NewChaosPodWatcher_Call
func (*FactoryMock_NewChaosPodWatcher_Call) Run ¶
func (_c *FactoryMock_NewChaosPodWatcher_Call) Run(run func(name string, disruption *v1beta1.Disruption, cacheMock cache.Cache)) *FactoryMock_NewChaosPodWatcher_Call
func (*FactoryMock_NewChaosPodWatcher_Call) RunAndReturn ¶
func (_c *FactoryMock_NewChaosPodWatcher_Call) RunAndReturn(run func(string, *v1beta1.Disruption, cache.Cache) (Watcher, error)) *FactoryMock_NewChaosPodWatcher_Call
type FactoryMock_NewDisruptionTargetWatcher_Call ¶
FactoryMock_NewDisruptionTargetWatcher_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewDisruptionTargetWatcher'
func (*FactoryMock_NewDisruptionTargetWatcher_Call) Return ¶
func (_c *FactoryMock_NewDisruptionTargetWatcher_Call) Return(_a0 Watcher, _a1 error) *FactoryMock_NewDisruptionTargetWatcher_Call
func (*FactoryMock_NewDisruptionTargetWatcher_Call) Run ¶
func (_c *FactoryMock_NewDisruptionTargetWatcher_Call) Run(run func(name string, enableObserver bool, disruption *v1beta1.Disruption, cacheMock cache.Cache)) *FactoryMock_NewDisruptionTargetWatcher_Call
func (*FactoryMock_NewDisruptionTargetWatcher_Call) RunAndReturn ¶
func (_c *FactoryMock_NewDisruptionTargetWatcher_Call) RunAndReturn(run func(string, bool, *v1beta1.Disruption, cache.Cache) (Watcher, error)) *FactoryMock_NewDisruptionTargetWatcher_Call
type Manager ¶
type Manager interface { // AddWatcher adds a new Watcher instance to the Manager AddWatcher(watcher Watcher) error // RemoveWatcher removes an existing Watcher instance from the Manager RemoveWatcher(watcher Watcher) error // RemoveExpiredWatchers removes all expired Watcher instances from the Manager RemoveExpiredWatchers() // GetWatcher returns the Watcher instance with the specified name GetWatcher(name string) Watcher // RemoveOrphanWatchers removes all orphan Watcher instances from the Manager RemoveOrphanWatchers() // RemoveAllWatchers remove all Watchers instances from the Manager RemoveAllWatchers() }
Manager defines the interface for a manager that can handle adding, removing, and retrieving Watchers.
func NewManager ¶
func NewManager(r client.Reader, c controller.Controller) Manager
NewManager creates a new Manager instance
type ManagerMock ¶
ManagerMock is an autogenerated mock type for the Manager type
func NewManagerMock ¶
func NewManagerMock(t interface { mock.TestingT Cleanup(func()) }) *ManagerMock
NewManagerMock creates a new instance of ManagerMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*ManagerMock) AddWatcher ¶
func (_m *ManagerMock) AddWatcher(watcher Watcher) error
AddWatcher provides a mock function with given fields: watcher
func (*ManagerMock) EXPECT ¶
func (_m *ManagerMock) EXPECT() *ManagerMock_Expecter
func (*ManagerMock) GetWatcher ¶
func (_m *ManagerMock) GetWatcher(name string) Watcher
GetWatcher provides a mock function with given fields: name
func (*ManagerMock) RemoveAllWatchers ¶
func (_m *ManagerMock) RemoveAllWatchers()
RemoveAllWatchers provides a mock function with given fields:
func (*ManagerMock) RemoveExpiredWatchers ¶
func (_m *ManagerMock) RemoveExpiredWatchers()
RemoveExpiredWatchers provides a mock function with given fields:
func (*ManagerMock) RemoveOrphanWatchers ¶
func (_m *ManagerMock) RemoveOrphanWatchers()
RemoveOrphanWatchers provides a mock function with given fields:
func (*ManagerMock) RemoveWatcher ¶
func (_m *ManagerMock) RemoveWatcher(watcher Watcher) error
RemoveWatcher provides a mock function with given fields: watcher
type ManagerMock_AddWatcher_Call ¶
ManagerMock_AddWatcher_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddWatcher'
func (*ManagerMock_AddWatcher_Call) Return ¶
func (_c *ManagerMock_AddWatcher_Call) Return(_a0 error) *ManagerMock_AddWatcher_Call
func (*ManagerMock_AddWatcher_Call) Run ¶
func (_c *ManagerMock_AddWatcher_Call) Run(run func(watcher Watcher)) *ManagerMock_AddWatcher_Call
func (*ManagerMock_AddWatcher_Call) RunAndReturn ¶
func (_c *ManagerMock_AddWatcher_Call) RunAndReturn(run func(Watcher) error) *ManagerMock_AddWatcher_Call
type ManagerMock_Expecter ¶
type ManagerMock_Expecter struct {
// contains filtered or unexported fields
}
func (*ManagerMock_Expecter) AddWatcher ¶
func (_e *ManagerMock_Expecter) AddWatcher(watcher interface{}) *ManagerMock_AddWatcher_Call
AddWatcher is a helper method to define mock.On call
- watcher Watcher
func (*ManagerMock_Expecter) GetWatcher ¶
func (_e *ManagerMock_Expecter) GetWatcher(name interface{}) *ManagerMock_GetWatcher_Call
GetWatcher is a helper method to define mock.On call
- name string
func (*ManagerMock_Expecter) RemoveAllWatchers ¶
func (_e *ManagerMock_Expecter) RemoveAllWatchers() *ManagerMock_RemoveAllWatchers_Call
RemoveAllWatchers is a helper method to define mock.On call
func (*ManagerMock_Expecter) RemoveExpiredWatchers ¶
func (_e *ManagerMock_Expecter) RemoveExpiredWatchers() *ManagerMock_RemoveExpiredWatchers_Call
RemoveExpiredWatchers is a helper method to define mock.On call
func (*ManagerMock_Expecter) RemoveOrphanWatchers ¶
func (_e *ManagerMock_Expecter) RemoveOrphanWatchers() *ManagerMock_RemoveOrphanWatchers_Call
RemoveOrphanWatchers is a helper method to define mock.On call
func (*ManagerMock_Expecter) RemoveWatcher ¶
func (_e *ManagerMock_Expecter) RemoveWatcher(watcher interface{}) *ManagerMock_RemoveWatcher_Call
RemoveWatcher is a helper method to define mock.On call
- watcher Watcher
type ManagerMock_GetWatcher_Call ¶
ManagerMock_GetWatcher_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetWatcher'
func (*ManagerMock_GetWatcher_Call) Return ¶
func (_c *ManagerMock_GetWatcher_Call) Return(_a0 Watcher) *ManagerMock_GetWatcher_Call
func (*ManagerMock_GetWatcher_Call) Run ¶
func (_c *ManagerMock_GetWatcher_Call) Run(run func(name string)) *ManagerMock_GetWatcher_Call
func (*ManagerMock_GetWatcher_Call) RunAndReturn ¶
func (_c *ManagerMock_GetWatcher_Call) RunAndReturn(run func(string) Watcher) *ManagerMock_GetWatcher_Call
type ManagerMock_RemoveAllWatchers_Call ¶
ManagerMock_RemoveAllWatchers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveAllWatchers'
func (*ManagerMock_RemoveAllWatchers_Call) Return ¶
func (_c *ManagerMock_RemoveAllWatchers_Call) Return() *ManagerMock_RemoveAllWatchers_Call
func (*ManagerMock_RemoveAllWatchers_Call) Run ¶
func (_c *ManagerMock_RemoveAllWatchers_Call) Run(run func()) *ManagerMock_RemoveAllWatchers_Call
func (*ManagerMock_RemoveAllWatchers_Call) RunAndReturn ¶
func (_c *ManagerMock_RemoveAllWatchers_Call) RunAndReturn(run func()) *ManagerMock_RemoveAllWatchers_Call
type ManagerMock_RemoveExpiredWatchers_Call ¶
ManagerMock_RemoveExpiredWatchers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveExpiredWatchers'
func (*ManagerMock_RemoveExpiredWatchers_Call) Return ¶
func (_c *ManagerMock_RemoveExpiredWatchers_Call) Return() *ManagerMock_RemoveExpiredWatchers_Call
func (*ManagerMock_RemoveExpiredWatchers_Call) Run ¶
func (_c *ManagerMock_RemoveExpiredWatchers_Call) Run(run func()) *ManagerMock_RemoveExpiredWatchers_Call
func (*ManagerMock_RemoveExpiredWatchers_Call) RunAndReturn ¶
func (_c *ManagerMock_RemoveExpiredWatchers_Call) RunAndReturn(run func()) *ManagerMock_RemoveExpiredWatchers_Call
type ManagerMock_RemoveOrphanWatchers_Call ¶
ManagerMock_RemoveOrphanWatchers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveOrphanWatchers'
func (*ManagerMock_RemoveOrphanWatchers_Call) Return ¶
func (_c *ManagerMock_RemoveOrphanWatchers_Call) Return() *ManagerMock_RemoveOrphanWatchers_Call
func (*ManagerMock_RemoveOrphanWatchers_Call) Run ¶
func (_c *ManagerMock_RemoveOrphanWatchers_Call) Run(run func()) *ManagerMock_RemoveOrphanWatchers_Call
func (*ManagerMock_RemoveOrphanWatchers_Call) RunAndReturn ¶
func (_c *ManagerMock_RemoveOrphanWatchers_Call) RunAndReturn(run func()) *ManagerMock_RemoveOrphanWatchers_Call
type ManagerMock_RemoveWatcher_Call ¶
ManagerMock_RemoveWatcher_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveWatcher'
func (*ManagerMock_RemoveWatcher_Call) Return ¶
func (_c *ManagerMock_RemoveWatcher_Call) Return(_a0 error) *ManagerMock_RemoveWatcher_Call
func (*ManagerMock_RemoveWatcher_Call) Run ¶
func (_c *ManagerMock_RemoveWatcher_Call) Run(run func(watcher Watcher)) *ManagerMock_RemoveWatcher_Call
func (*ManagerMock_RemoveWatcher_Call) RunAndReturn ¶
func (_c *ManagerMock_RemoveWatcher_Call) RunAndReturn(run func(Watcher) error) *ManagerMock_RemoveWatcher_Call
type StatefulSetHandler ¶
func NewStatefulSetHandler ¶
func NewStatefulSetHandler(client client.Client, logger *zap.SugaredLogger) StatefulSetHandler
func (StatefulSetHandler) FetchAssociatedDisruptionRollouts ¶
func (h StatefulSetHandler) FetchAssociatedDisruptionRollouts(statefulset *appsv1.StatefulSet) (*chaosv1beta1.DisruptionRolloutList, error)
func (StatefulSetHandler) HasAssociatedDisruptionRollout ¶
func (h StatefulSetHandler) HasAssociatedDisruptionRollout(statefulset *appsv1.StatefulSet) (bool, error)
func (StatefulSetHandler) OnAdd ¶
func (h StatefulSetHandler) OnAdd(obj interface{})
OnAdd is a handler function for the add of a statefulset
func (StatefulSetHandler) OnDelete ¶
func (h StatefulSetHandler) OnDelete(_ interface{})
OnDelete is a handler function for the delete of a statefulset
func (StatefulSetHandler) OnUpdate ¶
func (h StatefulSetHandler) OnUpdate(oldObj, newObj interface{})
OnUpdate is a handler function for the update of a statefulset
func (StatefulSetHandler) UpdateDisruptionRolloutStatus ¶
func (h StatefulSetHandler) UpdateDisruptionRolloutStatus(statefulset *appsv1.StatefulSet, initContainersHash, containersHash map[string]string) error
type Watcher ¶
type Watcher interface { // Clean cancels the context associated with the watcher, stopping the syncing of resources and freeing up resources. Clean() // GetCacheSource returns the syncing source of the watcher's cache. GetCacheSource() (source.SyncingSource, error) // GetContextTuple returns the context tuple associated with the watcher. GetContextTuple() (CtxTuple, error) // GetName returns the name of the watcher. GetName() string // IsExpired returns true if the context associated with the watcher has expired, meaning the watcher is no longer active. IsExpired() bool // Start starts the watcher by creating an informer from the watcher's cache and adding a resource event handler to the informer. Start() error // GetConfig return the current config of the Watcher instance. GetConfig() WatcherConfig }
Watcher is an interface that describes the methods provided by a Kubernetes resource watcher.
func NewWatcher ¶
func NewWatcher(config WatcherConfig, cacheMock k8scontrollercache.Cache, cacheContextMockFunc CacheContextFunc) (Watcher, error)
NewWatcher is a function that creates a new watcher instance based on the given configuration values.
type WatcherConfig ¶
type WatcherConfig struct { // CacheOptions for configuring the cache. CacheOptions k8scontrollercache.Options // Handler function that will be called when an event occurs. Handler k8sclientcache.ResourceEventHandler // Log for logging. Log *zap.SugaredLogger // Name of the watcher instance. Name string // Namespace of the resource to watch. DisruptionNamespacedName types.NamespacedName // ObjectType of the object to watch. ObjectType client.Object }
WatcherConfig holds configuration values used to create a new Watcher instance.
type WatcherEventType ¶
type WatcherEventType string
const ( WatcherAddEvent WatcherEventType = "Add" WatcherUpdateEvent WatcherEventType = "Update" WatcherDeleteEvent WatcherEventType = "Delete" )
type WatcherManagers ¶
type WatcherManagers map[types.NamespacedName]Manager
WatcherManagers represents a map of Manager instances
type WatcherMetricsAdapter ¶
type WatcherMetricsAdapter interface {
OnChange(disruption *v1beta1.Disruption, watcherName string, pod *corev1.Pod, node *corev1.Node, okPod bool, okNode bool, event WatcherEventType)
}
WatcherMetricsAdapter is in charge of watcher metrics.
func NewWatcherMetricsAdapter ¶
func NewWatcherMetricsAdapter(metricsSink metrics.Sink, log *zap.SugaredLogger) WatcherMetricsAdapter
NewWatcherMetricsAdapter constructor of WatcherMetricsAdapter
type WatcherMetricsAdapterMock ¶
WatcherMetricsAdapterMock is an autogenerated mock type for the WatcherMetricsAdapter type
func NewWatcherMetricsAdapterMock ¶
func NewWatcherMetricsAdapterMock(t interface { mock.TestingT Cleanup(func()) }) *WatcherMetricsAdapterMock
NewWatcherMetricsAdapterMock creates a new instance of WatcherMetricsAdapterMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*WatcherMetricsAdapterMock) EXPECT ¶
func (_m *WatcherMetricsAdapterMock) EXPECT() *WatcherMetricsAdapterMock_Expecter
func (*WatcherMetricsAdapterMock) OnChange ¶
func (_m *WatcherMetricsAdapterMock) OnChange(disruption *v1beta1.Disruption, watcherName string, pod *v1.Pod, node *v1.Node, okPod bool, okNode bool, event WatcherEventType)
OnChange provides a mock function with given fields: disruption, watcherName, pod, node, okPod, okNode, event
type WatcherMetricsAdapterMock_Expecter ¶
type WatcherMetricsAdapterMock_Expecter struct {
// contains filtered or unexported fields
}
func (*WatcherMetricsAdapterMock_Expecter) OnChange ¶
func (_e *WatcherMetricsAdapterMock_Expecter) OnChange(disruption interface{}, watcherName interface{}, pod interface{}, node interface{}, okPod interface{}, okNode interface{}, event interface{}) *WatcherMetricsAdapterMock_OnChange_Call
OnChange is a helper method to define mock.On call
- disruption *v1beta1.Disruption
- watcherName string
- pod *v1.Pod
- node *v1.Node
- okPod bool
- okNode bool
- event WatcherEventType
type WatcherMetricsAdapterMock_OnChange_Call ¶
WatcherMetricsAdapterMock_OnChange_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnChange'
func (*WatcherMetricsAdapterMock_OnChange_Call) Return ¶
func (_c *WatcherMetricsAdapterMock_OnChange_Call) Return() *WatcherMetricsAdapterMock_OnChange_Call
func (*WatcherMetricsAdapterMock_OnChange_Call) Run ¶
func (_c *WatcherMetricsAdapterMock_OnChange_Call) Run(run func(disruption *v1beta1.Disruption, watcherName string, pod *v1.Pod, node *v1.Node, okPod bool, okNode bool, event WatcherEventType)) *WatcherMetricsAdapterMock_OnChange_Call
func (*WatcherMetricsAdapterMock_OnChange_Call) RunAndReturn ¶
func (_c *WatcherMetricsAdapterMock_OnChange_Call) RunAndReturn(run func(*v1beta1.Disruption, string, *v1.Pod, *v1.Node, bool, bool, WatcherEventType)) *WatcherMetricsAdapterMock_OnChange_Call
type WatcherMock ¶
WatcherMock is an autogenerated mock type for the Watcher type
func NewWatcherMock ¶
func NewWatcherMock(t interface { mock.TestingT Cleanup(func()) }) *WatcherMock
NewWatcherMock creates a new instance of WatcherMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*WatcherMock) Clean ¶
func (_m *WatcherMock) Clean()
Clean provides a mock function with given fields:
func (*WatcherMock) EXPECT ¶
func (_m *WatcherMock) EXPECT() *WatcherMock_Expecter
func (*WatcherMock) GetCacheSource ¶
func (_m *WatcherMock) GetCacheSource() (source.SyncingSource, error)
GetCacheSource provides a mock function with given fields:
func (*WatcherMock) GetConfig ¶
func (_m *WatcherMock) GetConfig() WatcherConfig
GetConfig provides a mock function with given fields:
func (*WatcherMock) GetContextTuple ¶
func (_m *WatcherMock) GetContextTuple() (CtxTuple, error)
GetContextTuple provides a mock function with given fields:
func (*WatcherMock) GetName ¶
func (_m *WatcherMock) GetName() string
GetName provides a mock function with given fields:
func (*WatcherMock) IsExpired ¶
func (_m *WatcherMock) IsExpired() bool
IsExpired provides a mock function with given fields:
func (*WatcherMock) Start ¶
func (_m *WatcherMock) Start() error
Start provides a mock function with given fields:
type WatcherMock_Clean_Call ¶
WatcherMock_Clean_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Clean'
func (*WatcherMock_Clean_Call) Return ¶
func (_c *WatcherMock_Clean_Call) Return() *WatcherMock_Clean_Call
func (*WatcherMock_Clean_Call) Run ¶
func (_c *WatcherMock_Clean_Call) Run(run func()) *WatcherMock_Clean_Call
func (*WatcherMock_Clean_Call) RunAndReturn ¶
func (_c *WatcherMock_Clean_Call) RunAndReturn(run func()) *WatcherMock_Clean_Call
type WatcherMock_Expecter ¶
type WatcherMock_Expecter struct {
// contains filtered or unexported fields
}
func (*WatcherMock_Expecter) Clean ¶
func (_e *WatcherMock_Expecter) Clean() *WatcherMock_Clean_Call
Clean is a helper method to define mock.On call
func (*WatcherMock_Expecter) GetCacheSource ¶
func (_e *WatcherMock_Expecter) GetCacheSource() *WatcherMock_GetCacheSource_Call
GetCacheSource is a helper method to define mock.On call
func (*WatcherMock_Expecter) GetConfig ¶
func (_e *WatcherMock_Expecter) GetConfig() *WatcherMock_GetConfig_Call
GetConfig is a helper method to define mock.On call
func (*WatcherMock_Expecter) GetContextTuple ¶
func (_e *WatcherMock_Expecter) GetContextTuple() *WatcherMock_GetContextTuple_Call
GetContextTuple is a helper method to define mock.On call
func (*WatcherMock_Expecter) GetName ¶
func (_e *WatcherMock_Expecter) GetName() *WatcherMock_GetName_Call
GetName is a helper method to define mock.On call
func (*WatcherMock_Expecter) IsExpired ¶
func (_e *WatcherMock_Expecter) IsExpired() *WatcherMock_IsExpired_Call
IsExpired is a helper method to define mock.On call
func (*WatcherMock_Expecter) Start ¶
func (_e *WatcherMock_Expecter) Start() *WatcherMock_Start_Call
Start is a helper method to define mock.On call
type WatcherMock_GetCacheSource_Call ¶
WatcherMock_GetCacheSource_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCacheSource'
func (*WatcherMock_GetCacheSource_Call) Return ¶
func (_c *WatcherMock_GetCacheSource_Call) Return(_a0 source.SyncingSource, _a1 error) *WatcherMock_GetCacheSource_Call
func (*WatcherMock_GetCacheSource_Call) Run ¶
func (_c *WatcherMock_GetCacheSource_Call) Run(run func()) *WatcherMock_GetCacheSource_Call
func (*WatcherMock_GetCacheSource_Call) RunAndReturn ¶
func (_c *WatcherMock_GetCacheSource_Call) RunAndReturn(run func() (source.SyncingSource, error)) *WatcherMock_GetCacheSource_Call
type WatcherMock_GetConfig_Call ¶
WatcherMock_GetConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetConfig'
func (*WatcherMock_GetConfig_Call) Return ¶
func (_c *WatcherMock_GetConfig_Call) Return(_a0 WatcherConfig) *WatcherMock_GetConfig_Call
func (*WatcherMock_GetConfig_Call) Run ¶
func (_c *WatcherMock_GetConfig_Call) Run(run func()) *WatcherMock_GetConfig_Call
func (*WatcherMock_GetConfig_Call) RunAndReturn ¶
func (_c *WatcherMock_GetConfig_Call) RunAndReturn(run func() WatcherConfig) *WatcherMock_GetConfig_Call
type WatcherMock_GetContextTuple_Call ¶
WatcherMock_GetContextTuple_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetContextTuple'
func (*WatcherMock_GetContextTuple_Call) Return ¶
func (_c *WatcherMock_GetContextTuple_Call) Return(_a0 CtxTuple, _a1 error) *WatcherMock_GetContextTuple_Call
func (*WatcherMock_GetContextTuple_Call) Run ¶
func (_c *WatcherMock_GetContextTuple_Call) Run(run func()) *WatcherMock_GetContextTuple_Call
func (*WatcherMock_GetContextTuple_Call) RunAndReturn ¶
func (_c *WatcherMock_GetContextTuple_Call) RunAndReturn(run func() (CtxTuple, error)) *WatcherMock_GetContextTuple_Call
type WatcherMock_GetName_Call ¶
WatcherMock_GetName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetName'
func (*WatcherMock_GetName_Call) Return ¶
func (_c *WatcherMock_GetName_Call) Return(_a0 string) *WatcherMock_GetName_Call
func (*WatcherMock_GetName_Call) Run ¶
func (_c *WatcherMock_GetName_Call) Run(run func()) *WatcherMock_GetName_Call
func (*WatcherMock_GetName_Call) RunAndReturn ¶
func (_c *WatcherMock_GetName_Call) RunAndReturn(run func() string) *WatcherMock_GetName_Call
type WatcherMock_IsExpired_Call ¶
WatcherMock_IsExpired_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsExpired'
func (*WatcherMock_IsExpired_Call) Return ¶
func (_c *WatcherMock_IsExpired_Call) Return(_a0 bool) *WatcherMock_IsExpired_Call
func (*WatcherMock_IsExpired_Call) Run ¶
func (_c *WatcherMock_IsExpired_Call) Run(run func()) *WatcherMock_IsExpired_Call
func (*WatcherMock_IsExpired_Call) RunAndReturn ¶
func (_c *WatcherMock_IsExpired_Call) RunAndReturn(run func() bool) *WatcherMock_IsExpired_Call
type WatcherMock_Start_Call ¶
WatcherMock_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start'
func (*WatcherMock_Start_Call) Return ¶
func (_c *WatcherMock_Start_Call) Return(_a0 error) *WatcherMock_Start_Call
func (*WatcherMock_Start_Call) Run ¶
func (_c *WatcherMock_Start_Call) Run(run func()) *WatcherMock_Start_Call
func (*WatcherMock_Start_Call) RunAndReturn ¶
func (_c *WatcherMock_Start_Call) RunAndReturn(run func() error) *WatcherMock_Start_Call
type WatcherName ¶
type WatcherName string
const ( ChaosPodWatcherName WatcherName = "ChaosPod" DisruptionTargetWatcherName WatcherName = "DisruptionTarget" )
Source Files ¶
- cache_context_func_mock.go
- chaos_pod_handler.go
- deployment_handler.go
- deployment_statefulset_helpers.go
- disruptions_watchers_manager.go
- disruptions_watchers_manager_mock.go
- factory.go
- factory_mock.go
- manager.go
- manager_mock.go
- metrics.go
- statefulset_handler.go
- target_pod_handler.go
- watcher.go
- watcher_metrics_adapter_mock.go
- watcher_mock.go