mocks

package
v1.3.1-beta.1 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainerStoppedEvent

func ContainerStoppedEvent(name string) events.Message

func CreatedContainerSpec

func CreatedContainerSpec(name string) types.ContainerJSON

func DeadContainerSpec

func DeadContainerSpec(name string) types.ContainerJSON

func ExitedContainerSpec

func ExitedContainerSpec(name string, exitCode int) types.ContainerJSON

func PausedContainerSpec

func PausedContainerSpec(name string) types.ContainerJSON

func RemovingContainerSpec

func RemovingContainerSpec(name string) types.ContainerJSON

func RestartingContainerSpec

func RestartingContainerSpec(name string) types.ContainerJSON

func RunningWithHealthcheckContainerSpec

func RunningWithHealthcheckContainerSpec(name string, status string) types.ContainerJSON

Status can be "starting", "healthy" or "unhealthy"

func RunningWithoutHealthcheckContainerSpec

func RunningWithoutHealthcheckContainerSpec(name string) types.ContainerJSON

func ServiceGlobal

func ServiceGlobal(name string) swarm.Service

func ServiceNotReadyReplicated

func ServiceNotReadyReplicated(name string, runningTasks uint64, desiredTasks uint64) swarm.Service

func ServiceRemovedEvent

func ServiceRemovedEvent(name string) events.Message

func ServiceReplicated

func ServiceReplicated(name string, replicas uint64) swarm.Service

func ServiceScaledEvent

func ServiceScaledEvent(name string, oldReplicas string, newReplicas string) events.Message

func V1Deployment

func V1Deployment(replicas int, readyReplicas int) *appsv1.Deployment

func V1Scale

func V1Scale(replicas int) *autoscalingv1.Scale

func V1StatefulSet

func V1StatefulSet(replicas int, readyReplicas int) *appsv1.StatefulSet

Types

type AppsV1InterfaceMock

type AppsV1InterfaceMock struct {
	v1.AppsV1Interface
	// contains filtered or unexported fields
}

func (AppsV1InterfaceMock) Deployments

func (api AppsV1InterfaceMock) Deployments(namespace string) v1.DeploymentInterface

func (AppsV1InterfaceMock) StatefulSets

func (api AppsV1InterfaceMock) StatefulSets(namespace string) v1.StatefulSetInterface

type DeploymentMock

type DeploymentMock struct {
	v1.DeploymentInterface
	mock.Mock
}

func (*DeploymentMock) Get

func (d *DeploymentMock) Get(ctx context.Context, workloadName string, options metav1.GetOptions) (*appsv1.Deployment, error)

func (*DeploymentMock) GetScale

func (d *DeploymentMock) GetScale(ctx context.Context, workloadName string, options metav1.GetOptions) (*autoscalingv1.Scale, error)

func (*DeploymentMock) UpdateScale

func (d *DeploymentMock) UpdateScale(ctx context.Context, workloadName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (*autoscalingv1.Scale, error)

type DockerAPIClientMock

type DockerAPIClientMock struct {
	client.APIClient
	mock.Mock
	// contains filtered or unexported fields
}

func NewDockerAPIClientMock

func NewDockerAPIClientMock() *DockerAPIClientMock

func NewDockerAPIClientMockWithEvents

func NewDockerAPIClientMockWithEvents(messages []events.Message, errors []error) *DockerAPIClientMock

func (*DockerAPIClientMock) ContainerInspect

func (client *DockerAPIClientMock) ContainerInspect(ctx context.Context, container string) (types.ContainerJSON, error)

func (*DockerAPIClientMock) ContainerStart

func (client *DockerAPIClientMock) ContainerStart(ctx context.Context, container string, options types.ContainerStartOptions) error

func (*DockerAPIClientMock) ContainerStop

func (client *DockerAPIClientMock) ContainerStop(ctx context.Context, container string, timeout *time.Duration) error

func (*DockerAPIClientMock) Events

func (client *DockerAPIClientMock) Events(ctx context.Context, options types.EventsOptions) (<-chan events.Message, <-chan error)

func (*DockerAPIClientMock) ServiceList

func (client *DockerAPIClientMock) ServiceList(ctx context.Context, options types.ServiceListOptions) ([]swarm.Service, error)

func (*DockerAPIClientMock) ServiceUpdate

func (client *DockerAPIClientMock) ServiceUpdate(ctx context.Context, serviceID string, version swarm.Version, service swarm.ServiceSpec, options types.ServiceUpdateOptions) (types.ServiceUpdateResponse, error)

type KubernetesAPIClientMock

type KubernetesAPIClientMock struct {
	kubernetes.Clientset
	// contains filtered or unexported fields
}

func NewKubernetesAPIClientMock

func NewKubernetesAPIClientMock(deployments *DeploymentMock, statefulsets *StatefulSetsMock) *KubernetesAPIClientMock

func (*KubernetesAPIClientMock) AppsV1

type StatefulSetsMock

type StatefulSetsMock struct {
	v1.StatefulSetInterface
	mock.Mock
}

func (*StatefulSetsMock) Get

func (ss *StatefulSetsMock) Get(ctx context.Context, workloadName string, options metav1.GetOptions) (*appsv1.StatefulSet, error)

func (*StatefulSetsMock) GetScale

func (ss *StatefulSetsMock) GetScale(ctx context.Context, workloadName string, options metav1.GetOptions) (*autoscalingv1.Scale, error)

func (*StatefulSetsMock) UpdateScale

func (ss *StatefulSetsMock) UpdateScale(ctx context.Context, workloadName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (*autoscalingv1.Scale, error)

Jump to

Keyboard shortcuts

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