Documentation
¶
Overview ¶
Package common is a generated GoMock package.
Index ¶
- func NamePartitionKey(obj cache.ObjectName) (lockKey string)
- func NamespacePartitionKey(obj cache.ObjectName) (lockKey string)
- func NewRateLimitedWorkQueue(ctx context.Context, name string) workqueue.TypedRateLimitingInterface[cache.ObjectName]
- type Controller
- type ControllerTestSuite
- func (s *ControllerTestSuite) SetupTest()
- func (s *ControllerTestSuite) SyncedChannelCallback() func(ctx context.Context, namespace string, name string) error
- func (s *ControllerTestSuite) TearDownTest()
- func (s *ControllerTestSuite) WaitForNotSynced(failMessage string)
- func (s *ControllerTestSuite) WaitForSynced(expectedOperation string)
- type GetOwner
- type Handler
- type LockKeyFunc
- type MockHandler
- type MockHandlerMockRecorder
- type SyncEventRecorder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NamePartitionKey ¶
func NamePartitionKey(obj cache.ObjectName) (lockKey string)
NamePartitionKey returns a string which serves as a "locking key" for parallel processing of RadixEnvironments and RadixRegistrations
func NamespacePartitionKey ¶
func NamespacePartitionKey(obj cache.ObjectName) (lockKey string)
NamespacePartitionKey returns a string which serves as a "locking key" for parallel processing of RadixApplications, RadixAlerts, RadixDeployments and RadixJobs
func NewRateLimitedWorkQueue ¶
func NewRateLimitedWorkQueue(ctx context.Context, name string) workqueue.TypedRateLimitingInterface[cache.ObjectName]
Types ¶
type Controller ¶
type Controller struct {
Name string
HandlerOf string
KubeClient kubernetes.Interface
RadixClient radixclient.Interface
WorkQueue workqueue.TypedRateLimitingInterface[cache.ObjectName]
KubeInformerFactory kubeinformers.SharedInformerFactory
RadixInformerFactory informers.SharedInformerFactory
Handler Handler
LockKey LockKeyFunc
// contains filtered or unexported fields
}
Controller Instance variables
func (*Controller) Enqueue ¶
func (c *Controller) Enqueue(obj interface{}) error
Enqueue takes a resource and converts it into a namespace/name string which is then put onto the work queue
func (*Controller) HandleObject ¶
func (c *Controller) HandleObject(ctx context.Context, obj interface{}, ownerKind string, getOwnerFn GetOwner)
HandleObject ensures that when anything happens to object which any custom resource is owner of, that custom resource is synced
type ControllerTestSuite ¶
type ControllerTestSuite struct {
suite.Suite
KubeClient *fake.Clientset
RadixClient *fakeradix.Clientset
DynamicClient client.Client
SecretProviderClient *secretproviderfake.Clientset
PromClient *prometheusfake.Clientset
KubeUtil *kube.Kube
EventRecorder *record.FakeRecorder
RadixInformerFactory informers.SharedInformerFactory
KubeInformerFactory kubeinformers.SharedInformerFactory
MockCtrl *gomock.Controller
Handler *MockHandler
Synced chan bool
Ctx context.Context
CtxCancel context.CancelFunc
TestControllerSyncTimeout time.Duration
// contains filtered or unexported fields
}
ControllerTestSuite Test suite
func (*ControllerTestSuite) SetupTest ¶
func (s *ControllerTestSuite) SetupTest()
SetupTest Set up the test suite
func (*ControllerTestSuite) SyncedChannelCallback ¶
func (s *ControllerTestSuite) SyncedChannelCallback() func(ctx context.Context, namespace string, name string) error
SyncedChannelCallback Callback to send a signal to the Synced
func (*ControllerTestSuite) TearDownTest ¶
func (s *ControllerTestSuite) TearDownTest()
TearDownTest Tear down the test suite
func (*ControllerTestSuite) WaitForNotSynced ¶
func (s *ControllerTestSuite) WaitForNotSynced(failMessage string)
WaitForNotSynced Wait for Synced signal is not received during a second
func (*ControllerTestSuite) WaitForSynced ¶
func (s *ControllerTestSuite) WaitForSynced(expectedOperation string)
WaitForSynced Wait while Synced signal received or fail after TestControllerSyncTimeout
type LockKeyFunc ¶ added in v1.103.1
type LockKeyFunc func(obj cache.ObjectName) (lockKey string)
LockKeyFunc is a function which is either NamespacePartitionKey or NamePartitionKey
type MockHandler ¶
type MockHandler struct {
// contains filtered or unexported fields
}
MockHandler is a mock of Handler interface.
func NewMockHandler ¶
func NewMockHandler(ctrl *gomock.Controller) *MockHandler
NewMockHandler creates a new mock instance.
func (*MockHandler) EXPECT ¶
func (m *MockHandler) EXPECT() *MockHandlerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockHandlerMockRecorder ¶
type MockHandlerMockRecorder struct {
// contains filtered or unexported fields
}
MockHandlerMockRecorder is the mock recorder for MockHandler.
type SyncEventRecorder ¶ added in v1.103.1
type SyncEventRecorder struct {
Recorder record.EventRecorder
}
func NewSyncEventRecorder ¶ added in v1.103.1
func NewSyncEventRecorder(recorder record.EventRecorder) SyncEventRecorder
func (SyncEventRecorder) RecordSyncErrorEvent ¶ added in v1.103.1
func (r SyncEventRecorder) RecordSyncErrorEvent(obj runtime.Object, err error)
func (SyncEventRecorder) RecordSyncSuccessEvent ¶ added in v1.103.1
func (r SyncEventRecorder) RecordSyncSuccessEvent(obj runtime.Object)