Documentation ¶
Overview ¶
Package common is a generated GoMock package.
Index ¶
- func NamePartitionKey(obj interface{}) (lockKey string, identifier string, err error)
- func NamespacePartitionKey(obj interface{}) (lockKey string, identifier string, err error)
- func NewEventRecorder(controllerAgentName string, events typedcorev1.EventInterface, ...) record.EventRecorder
- func NewRateLimitedWorkQueue(ctx context.Context, name string) workqueue.RateLimitingInterface
- 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 HasSynced
- type LockKeyAndIdentifierFunc
- type MockHandler
- type MockHandlerMockRecorder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NamePartitionKey ¶ added in v1.21.6
NamePartitionKey returns a string which serves as a "locking key" for parallel processing of RadixEnvironments and RadixRegistrations
func NamespacePartitionKey ¶ added in v1.21.6
NamespacePartitionKey returns a string which serves as a "locking key" for parallel processing of RadixApplications, RadixAlerts, RadixDeployments and RadixJobs
func NewEventRecorder ¶
func NewEventRecorder(controllerAgentName string, events typedcorev1.EventInterface, logger zerolog.Logger) record.EventRecorder
NewEventRecorder Creates an event recorder for controller
func NewRateLimitedWorkQueue ¶ added in v1.55.0
func NewRateLimitedWorkQueue(ctx context.Context, name string) workqueue.RateLimitingInterface
Types ¶
type Controller ¶
type Controller struct { Name string HandlerOf string KubeClient kubernetes.Interface RadixClient radixclient.Interface WorkQueue workqueue.RateLimitingInterface Informer cache.SharedIndexInformer KubeInformerFactory kubeinformers.SharedInformerFactory Handler Handler Log zerolog.Logger WaitForChildrenToSync bool Recorder record.EventRecorder LockKeyAndIdentifier LockKeyAndIdentifierFunc // contains filtered or unexported fields }
Controller Instance variables
func (*Controller) Enqueue ¶
func (c *Controller) Enqueue(obj interface{}) (requeued bool, err 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 ¶ added in v1.16.1
type ControllerTestSuite struct { suite.Suite KubeClient *fake.Clientset RadixClient *fakeradix.Clientset 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 ¶ added in v1.16.1
func (s *ControllerTestSuite) SetupTest()
SetupTest Set up the test suite
func (*ControllerTestSuite) SyncedChannelCallback ¶ added in v1.16.1
func (s *ControllerTestSuite) SyncedChannelCallback() func(ctx context.Context, namespace string, name string, eventRecorder record.EventRecorder) error
SyncedChannelCallback Callback to send a signal to the Synced
func (*ControllerTestSuite) TearDownTest ¶ added in v1.16.1
func (s *ControllerTestSuite) TearDownTest()
TearDownTest Tear down the test suite
func (*ControllerTestSuite) WaitForNotSynced ¶ added in v1.16.1
func (s *ControllerTestSuite) WaitForNotSynced(failMessage string)
WaitForNotSynced Wait for Synced signal is not received during a second
func (*ControllerTestSuite) WaitForSynced ¶ added in v1.16.1
func (s *ControllerTestSuite) WaitForSynced(expectedOperation string)
WaitForSynced Wait while Synced signal received or fail after TestControllerSyncTimeout
type Handler ¶
type Handler interface {
Sync(ctx context.Context, namespace, name string, eventRecorder record.EventRecorder) error
}
Handler Common handler interface
type LockKeyAndIdentifierFunc ¶ added in v1.21.6
LockKeyAndIdentifierFunc is a function which is either NamespacePartitionKey or NamePartitionKey
type MockHandler ¶ added in v1.16.1
type MockHandler struct {
// contains filtered or unexported fields
}
MockHandler is a mock of Handler interface.
func NewMockHandler ¶ added in v1.16.1
func NewMockHandler(ctrl *gomock.Controller) *MockHandler
NewMockHandler creates a new mock instance.
func (*MockHandler) EXPECT ¶ added in v1.16.1
func (m *MockHandler) EXPECT() *MockHandlerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockHandler) Sync ¶ added in v1.16.1
func (m *MockHandler) Sync(ctx context.Context, namespace, name string, eventRecorder record.EventRecorder) error
Sync mocks base method.
type MockHandlerMockRecorder ¶ added in v1.16.1
type MockHandlerMockRecorder struct {
// contains filtered or unexported fields
}
MockHandlerMockRecorder is the mock recorder for MockHandler.
func (*MockHandlerMockRecorder) Sync ¶ added in v1.16.1
func (mr *MockHandlerMockRecorder) Sync(ctx, namespace, name, eventRecorder interface{}) *gomock.Call
Sync indicates an expected call of Sync.