testutils

package
v1.18.3 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2025 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FakeClientBuilderCell = func() cell.Cell {
	return cell.Group(
		cell.ProvidePrivate(newStateDBObjectTracker),
		cell.Provide(FakeClientBuilder),
	)
}

See a comment for FakeClientCell

View Source
var FakeClientCell = func() cell.Cell {
	return cell.Module(
		"k8s-fake-client",
		"Fake Kubernetes client",

		cell.ProvidePrivate(
			newStateDBObjectTracker,
		),

		cell.Provide(
			NewFakeClientsetWithTracker,
			func(fc *FakeClientset) hive.ScriptCmdsOut {
				return hive.NewScriptCmds(FakeClientCommands(fc))
			},
		),
	)
}

We do not create a cell as global variable since compiler will compile all of the fake protobufs into the release binary which increases the binary size by ~20 MB

Functions

func FakeClientBuilder

func FakeClientBuilder(log *slog.Logger, ot *statedbObjectTracker) k8sclient.ClientBuilderFunc

func FakeClientCommands

func FakeClientCommands(fc *FakeClientset) map[string]script.Cmd

Types

type APIExtFakeClientset

type APIExtFakeClientset = apiext_fake.Clientset

type CiliumFakeClientset

type CiliumFakeClientset = cilium_fake.Clientset

type FakeClientset

type FakeClientset struct {
	*MCSAPIFakeClientset
	*KubernetesFakeClientset
	*CiliumFakeClientset
	*APIExtFakeClientset
	k8sclient.ClientsetGetters

	SlimFakeClientset *SlimFakeClientset
	// contains filtered or unexported fields
}

func NewFakeClientset

func NewFakeClientset(log *slog.Logger) (*FakeClientset, k8sclient.Clientset)

func NewFakeClientsetWithTracker

func NewFakeClientsetWithTracker(log *slog.Logger, ot *statedbObjectTracker) (*FakeClientset, k8sclient.Clientset)

func NewFakeClientsetWithVersion

func NewFakeClientsetWithVersion(log *slog.Logger, ot *statedbObjectTracker, version string) (*FakeClientset, k8sclient.Clientset)

func (*FakeClientset) Config

func (c *FakeClientset) Config() k8sclient.Config

func (*FakeClientset) Disable

func (c *FakeClientset) Disable()

func (*FakeClientset) Discovery

func (*FakeClientset) IsEnabled

func (c *FakeClientset) IsEnabled() bool

func (*FakeClientset) RestConfig

func (c *FakeClientset) RestConfig() *rest.Config

func (*FakeClientset) Slim

type KubernetesFakeClientset

type KubernetesFakeClientset = fake.Clientset

type MCSAPIFakeClientset

type MCSAPIFakeClientset = mcsapi_fake.Clientset

type SlimFakeClientset

type SlimFakeClientset = slim_fake.Clientset

Jump to

Keyboard shortcuts

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