fake

package
v2.23.4 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplicationInstallerLogger

type ApplicationInstallerLogger struct {
}

ApplicationInstallerLogger is a fake ApplicationInstaller that just logs actions. it's used for the development of the controller.

func (ApplicationInstallerLogger) Apply

func (ApplicationInstallerLogger) Delete

func (ApplicationInstallerLogger) DonwloadSource

func (a ApplicationInstallerLogger) DonwloadSource(ctx context.Context, log *zap.SugaredLogger, seedClient ctrlruntimeclient.Client, applicationInstallation *appskubermaticv1.ApplicationInstallation, downloadDest string) (string, error)

func (ApplicationInstallerLogger) GetAppCache

func (a ApplicationInstallerLogger) GetAppCache() string

type ApplicationInstallerRecorder

type ApplicationInstallerRecorder struct {
	// DownloadEvents stores the call to download function. Key is the name of the applicationInstallation.
	DownloadEvents sync.Map

	// ApplyEvents stores the call to apply function. Key is the name of the applicationInstallation.
	ApplyEvents sync.Map

	// DeleteEvents stores the call to delete function. Key is the name of the applicationInstallation.
	DeleteEvents sync.Map
}

ApplicationInstallerRecorder is a fake ApplicationInstaller that records calls to apply and delete for testing assertions.

func (*ApplicationInstallerRecorder) Apply

func (*ApplicationInstallerRecorder) Delete

func (*ApplicationInstallerRecorder) DonwloadSource

func (a *ApplicationInstallerRecorder) DonwloadSource(ctx context.Context, log *zap.SugaredLogger, seedClient ctrlruntimeclient.Client, applicationInstallation *appskubermaticv1.ApplicationInstallation, downloadDest string) (string, error)

func (*ApplicationInstallerRecorder) GetAppCache

func (a *ApplicationInstallerRecorder) GetAppCache() string

type CustomApplicationInstaller added in v2.22.0

type CustomApplicationInstaller struct {
	GetAppCacheFunc    func() string
	DonwloadSourceFunc func(ctx context.Context, log *zap.SugaredLogger, seedClient ctrlruntimeclient.Client, applicationInstallation *appskubermaticv1.ApplicationInstallation, downloadDest string) (string, error)
	ApplyFunc          func(ctx context.Context, log *zap.SugaredLogger, seedClient ctrlruntimeclient.Client, userClient ctrlruntimeclient.Client, appDefinition *appskubermaticv1.ApplicationDefinition, applicationInstallation *appskubermaticv1.ApplicationInstallation, appSourcePath string) (util.StatusUpdater, error)
	DeleteFunc         func(ctx context.Context, log *zap.SugaredLogger, seedClient ctrlruntimeclient.Client, userClient ctrlruntimeclient.Client, applicationInstallation *appskubermaticv1.ApplicationInstallation) (util.StatusUpdater, error)
}

CustomApplicationInstaller is an applicationInstaller in which every function can be independently mocked. If a function is not mocked, then default values are returned.

func (CustomApplicationInstaller) Apply added in v2.22.0

func (CustomApplicationInstaller) Delete added in v2.22.0

func (CustomApplicationInstaller) DonwloadSource added in v2.22.0

func (c CustomApplicationInstaller) DonwloadSource(ctx context.Context, log *zap.SugaredLogger, seedClient ctrlruntimeclient.Client, applicationInstallation *appskubermaticv1.ApplicationInstallation, downloadDest string) (string, error)

func (CustomApplicationInstaller) GetAppCache added in v2.22.0

func (c CustomApplicationInstaller) GetAppCache() string

Jump to

Keyboard shortcuts

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