test

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDummyConfigAgent

func NewDummyConfigAgent() interfaces.ConfigAgent

NewDummyConfigAgent returns a new DummyConfigAgent instance

Types

type DummyConfigAgent

type DummyConfigAgent struct {
	UpdatedResources []interfaces.MetaResource
	DeletedResources []interfaces.MetaResource
}

DummyConfigAgent replaces RealConfigAgent in tests

func (*DummyConfigAgent) ResourceDeleted

func (d *DummyConfigAgent) ResourceDeleted(res interfaces.MetaResource)

func (*DummyConfigAgent) ResourceUpdated

func (d *DummyConfigAgent) ResourceUpdated(res interfaces.MetaResource)

func (*DummyConfigAgent) Start

func (d *DummyConfigAgent) Start(controllerStopCh chan struct{})

func (*DummyConfigAgent) Stop

func (d *DummyConfigAgent) Stop()

type DummyK8sClient

type DummyK8sClient struct {
	Patches []*ResourcePatch
	Error   error
}

func NewDummyK8sClient

func NewDummyK8sClient() *DummyK8sClient

NewDummyK8sClient returns a dummy implementation

func (*DummyK8sClient) PatchDeployment

func (c *DummyK8sClient) PatchDeployment(namespace, name string, data interface{}) (err error)

func (*DummyK8sClient) PatchStatefulSet

func (c *DummyK8sClient) PatchStatefulSet(namespace, name string, data interface{}) (err error)

type DummyMetaConfig

type DummyMetaConfig struct {
	FullNameValue string
	VersionValue  string
	ChecksumValue string
}

func NewDummyMetaConfig

func NewDummyMetaConfig(checksum string) *DummyMetaConfig

NewDummyK8sClient returns a dummy implementation

func NewMetaConfigWithParams

func NewMetaConfigWithParams(name, version, checksum string) *DummyMetaConfig

NewDummyMetaConfigWithParams returns a dummy implementation

func (*DummyMetaConfig) Checksum

func (c *DummyMetaConfig) Checksum() string

func (*DummyMetaConfig) FullName

func (c *DummyMetaConfig) FullName() string

func (*DummyMetaConfig) Version

func (c *DummyMetaConfig) Version() string

type DummyMetaDeployment

type DummyMetaDeployment struct {
	FullNameValue                   string
	VersionValue                    string
	NeedsRestartOnConfigChangeValue bool
	ReferencedConfigsValue          []string
	AppliedChecksumsValue           map[string]string

	UpdateError      error
	UpdatedChecksums map[string]string
	UpdatedRestart   bool
}

func NewDummyMetaDeployment

func NewDummyMetaDeployment() *DummyMetaDeployment

NewDummyK8sClient returns a dummy implementation

func (*DummyMetaDeployment) AppliedChecksums

func (d *DummyMetaDeployment) AppliedChecksums() map[string]string

func (*DummyMetaDeployment) FullName

func (d *DummyMetaDeployment) FullName() string

func (*DummyMetaDeployment) NeedsRestartOnConfigChange

func (d *DummyMetaDeployment) NeedsRestartOnConfigChange() bool

func (*DummyMetaDeployment) ReferencedConfigs

func (d *DummyMetaDeployment) ReferencedConfigs() []string

func (*DummyMetaDeployment) UpdateConfigChecksums

func (d *DummyMetaDeployment) UpdateConfigChecksums(k8sClient interfaces.K8sClient, checksums map[string]string, restart bool) error

func (*DummyMetaDeployment) Version

func (d *DummyMetaDeployment) Version() string

type ResourcePatch

type ResourcePatch struct {
	Path string
	Data interface{}
}

Jump to

Keyboard shortcuts

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