test

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearDeploymentsUpdated

func ClearDeploymentsUpdated(deploymentsUpdated *[]*apps.Deployment)

ClearDeploymentsUpdated clears the deploymentsUpdated list

func DeploymentNamesUpdated

func DeploymentNamesUpdated(deploymentsUpdated *[]*apps.Deployment) []string

DeploymentNamesUpdated converts a deploymentsUpdated slice into a string slice of deployment names

func UpdateDeploymentAndWaitStub

func UpdateDeploymentAndWaitStub() (
	stubFunc func(context *clusterd.Context, deployment *apps.Deployment, namespace string) (*apps.Deployment, error),
	deploymentsUpdated *[]*apps.Deployment,
)

UpdateDeploymentAndWaitStub returns a stub replacement for the UpdateDeploymentAndWait function for unit tests which always returns success (nil). The generated simple clientset doesn't seem to handle the Deployment.Update method as expected. The deployment is instead zero-ed out when the deployment is updated with an unchanged version, which breaks unit tests. In order to still test the UpdateDeploymentAndWait function, the stub function returned will append a copy of the deployment used as input to the list of deployments updated. The function returns a pointer to this slice which the calling func may use to verify the expected contents of deploymentsUpdated based on expected behavior.

Types

This section is empty.

Jump to

Keyboard shortcuts

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