Documentation ¶
Index ¶
- func NewClientBuilder(client ctrlclient.Client) *fakeClientBuilder
- func NewTiltClient() ctrlclient.Client
- type ControllerFixture
- func (f ControllerFixture) Cancel()
- func (f *ControllerFixture) Create(o object) ctrl.Result
- func (f *ControllerFixture) Delete(o object) (bool, ctrl.Result)
- func (f *ControllerFixture) Get(key types.NamespacedName, out object) bool
- func (f *ControllerFixture) KeyForObject(o object) types.NamespacedName
- func (f *ControllerFixture) MustGet(key types.NamespacedName, out object)
- func (f *ControllerFixture) MustReconcile(key types.NamespacedName) ctrl.Result
- func (f *ControllerFixture) RootContext() context.Context
- func (f *ControllerFixture) TimeoutContext() context.Context
- func (f *ControllerFixture) Update(o object) ctrl.Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewClientBuilder ¶
func NewClientBuilder(client ctrlclient.Client) *fakeClientBuilder
func NewTiltClient ¶
func NewTiltClient() ctrlclient.Client
Types ¶
type ControllerFixture ¶
type ControllerFixture struct { Scheme *runtime.Scheme Client ctrlclient.Client // contains filtered or unexported fields }
func NewFixture ¶
func NewFixture(t testing.TB, c controller) *ControllerFixture
func (ControllerFixture) Cancel ¶
func (f ControllerFixture) Cancel()
Cancel cancels the internal context used for the controller and client requests.
Normally, it's not necessary to call this - the fixture will automatically cancel the context as part of test cleanup to avoid leaking resources. However, if you want to explicitly test how a controller reacts to context cancellation, this method can be used.
func (*ControllerFixture) Create ¶
func (f *ControllerFixture) Create(o object) ctrl.Result
func (*ControllerFixture) Get ¶
func (f *ControllerFixture) Get(key types.NamespacedName, out object) bool
func (*ControllerFixture) KeyForObject ¶
func (f *ControllerFixture) KeyForObject(o object) types.NamespacedName
func (*ControllerFixture) MustGet ¶
func (f *ControllerFixture) MustGet(key types.NamespacedName, out object)
func (*ControllerFixture) MustReconcile ¶
func (f *ControllerFixture) MustReconcile(key types.NamespacedName) ctrl.Result
func (*ControllerFixture) RootContext ¶
func (f *ControllerFixture) RootContext() context.Context
func (*ControllerFixture) TimeoutContext ¶
func (f *ControllerFixture) TimeoutContext() context.Context
func (*ControllerFixture) Update ¶
func (f *ControllerFixture) Update(o object) ctrl.Result
Update updates the object including Status subresource.
Click to show internal directories.
Click to hide internal directories.