fake

package
v0.22.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFakeTiltClient added in v0.20.9

func NewFakeTiltClient() ctrlclient.Client

Types

type ControllerFixture

type ControllerFixture struct {
	Scheme *runtime.Scheme
	Client ctrlclient.Client
	// contains filtered or unexported fields
}

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) Context added in v0.20.8

func (f *ControllerFixture) Context() context.Context

func (*ControllerFixture) Create

func (f *ControllerFixture) Create(o object) ctrl.Result

func (*ControllerFixture) Delete

func (f *ControllerFixture) Delete(o object) (bool, 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) List added in v0.20.6

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) Stdout added in v0.22.4

func (b ControllerFixture) Stdout() string

func (ControllerFixture) T added in v0.21.0

func (*ControllerFixture) Update

func (f *ControllerFixture) Update(o object) ctrl.Result

Update updates the object including Status subresource.

type ControllerFixtureBuilder added in v0.20.9

type ControllerFixtureBuilder struct {
	Client ctrlclient.Client
	// contains filtered or unexported fields
}

func NewControllerFixtureBuilder added in v0.20.9

func NewControllerFixtureBuilder(t testing.TB) *ControllerFixtureBuilder

func (ControllerFixtureBuilder) Build added in v0.20.9

func (b ControllerFixtureBuilder) Build(c controller) *ControllerFixture

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL