Documentation ¶
Index ¶
- func CreateService(ctx context.Context, t *testing.T, d *daemon.Daemon, opts ...ServiceSpecOpt) string
- func CreateServiceSpec(t *testing.T, opts ...ServiceSpecOpt) swarmtypes.ServiceSpec
- func ExecTask(ctx context.Context, t *testing.T, d *daemon.Daemon, task swarmtypes.Task, ...) types.HijackedResponse
- func GetRunningTasks(ctx context.Context, t *testing.T, c client.ServiceAPIClient, serviceID string) []swarmtypes.Task
- func JobComplete(ctx context.Context, client client.CommonAPIClient, service swarmtypes.Service) func(log poll.LogT) poll.Result
- func NetworkPoll(config *poll.Settings)
- func NewSwarm(ctx context.Context, t *testing.T, testEnv *environment.Execution, ...) *daemon.Daemon
- func NoTasks(ctx context.Context, client client.ServiceAPIClient) func(log poll.LogT) poll.Result
- func NoTasksForService(ctx context.Context, client client.ServiceAPIClient, serviceID string) func(log poll.LogT) poll.Result
- func RunningTasksCount(ctx context.Context, client client.ServiceAPIClient, serviceID string, ...) func(log poll.LogT) poll.Result
- func ServicePoll(config *poll.Settings)
- func ServiceWithImage(image string) func(*swarmtypes.ServiceSpec)
- func ServiceWithInit(b *bool) func(*swarmtypes.ServiceSpec)
- func ServiceWithMode(mode swarmtypes.ServiceMode) func(*swarmtypes.ServiceSpec)
- type ServiceSpecOpt
- func ServiceWithCapabilities(add []string, drop []string) ServiceSpecOpt
- func ServiceWithCommand(cmd []string) ServiceSpecOpt
- func ServiceWithConfig(configRef *swarmtypes.ConfigReference) ServiceSpecOpt
- func ServiceWithEndpoint(endpoint *swarmtypes.EndpointSpec) ServiceSpecOpt
- func ServiceWithMaxReplicas(n uint64) ServiceSpecOpt
- func ServiceWithName(name string) ServiceSpecOpt
- func ServiceWithNetwork(network string) ServiceSpecOpt
- func ServiceWithPidsLimit(limit int64) ServiceSpecOpt
- func ServiceWithReplicas(n uint64) ServiceSpecOpt
- func ServiceWithSecret(secretRef *swarmtypes.SecretReference) ServiceSpecOpt
- func ServiceWithSysctls(sysctls map[string]string) ServiceSpecOpt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateService ¶
func CreateService(ctx context.Context, t *testing.T, d *daemon.Daemon, opts ...ServiceSpecOpt) string
CreateService creates a service on the passed in swarm daemon.
func CreateServiceSpec ¶
func CreateServiceSpec(t *testing.T, opts ...ServiceSpecOpt) swarmtypes.ServiceSpec
CreateServiceSpec creates a default service-spec, and applies the provided options
func ExecTask ¶
func ExecTask(ctx context.Context, t *testing.T, d *daemon.Daemon, task swarmtypes.Task, options container.ExecOptions) types.HijackedResponse
ExecTask runs the passed in exec config on the given task
func GetRunningTasks ¶
func GetRunningTasks(ctx context.Context, t *testing.T, c client.ServiceAPIClient, serviceID string) []swarmtypes.Task
GetRunningTasks gets the list of running tasks for a service
func JobComplete ¶
func JobComplete(ctx context.Context, client client.CommonAPIClient, service swarmtypes.Service) func(log poll.LogT) poll.Result
JobComplete is a poll function for determining that a ReplicatedJob is completed additionally, while polling, it verifies that the job never exceeds MaxConcurrent running tasks
func NetworkPoll ¶
NetworkPoll tweaks the pollSettings for `network`
func NewSwarm ¶
func NewSwarm(ctx context.Context, t *testing.T, testEnv *environment.Execution, ops ...daemon.Option) *daemon.Daemon
NewSwarm creates a swarm daemon for testing
func NoTasksForService ¶
func NoTasksForService(ctx context.Context, client client.ServiceAPIClient, serviceID string) func(log poll.LogT) poll.Result
NoTasksForService verifies that there are no more tasks for the given service
func RunningTasksCount ¶
func RunningTasksCount(ctx context.Context, client client.ServiceAPIClient, serviceID string, instances uint64) func(log poll.LogT) poll.Result
RunningTasksCount verifies there are `instances` tasks running for `serviceID`
func ServicePoll ¶
ServicePoll tweaks the pollSettings for `service`
func ServiceWithImage ¶
func ServiceWithImage(image string) func(*swarmtypes.ServiceSpec)
ServiceWithImage sets the image to use for the service
func ServiceWithInit ¶
func ServiceWithInit(b *bool) func(*swarmtypes.ServiceSpec)
ServiceWithInit sets whether the service should use init or not
func ServiceWithMode ¶
func ServiceWithMode(mode swarmtypes.ServiceMode) func(*swarmtypes.ServiceSpec)
ServiceWithMode sets the mode of the service to the provided mode.
Types ¶
type ServiceSpecOpt ¶
type ServiceSpecOpt func(*swarmtypes.ServiceSpec)
ServiceSpecOpt is used with `CreateService` to pass in service spec modifiers
func ServiceWithCapabilities ¶
func ServiceWithCapabilities(add []string, drop []string) ServiceSpecOpt
ServiceWithCapabilities sets the Capabilities option of the service's ContainerSpec.
func ServiceWithCommand ¶
func ServiceWithCommand(cmd []string) ServiceSpecOpt
ServiceWithCommand sets the command to use for the service
func ServiceWithConfig ¶
func ServiceWithConfig(configRef *swarmtypes.ConfigReference) ServiceSpecOpt
ServiceWithConfig adds the config reference to the service
func ServiceWithEndpoint ¶
func ServiceWithEndpoint(endpoint *swarmtypes.EndpointSpec) ServiceSpecOpt
ServiceWithEndpoint sets the Endpoint of the service
func ServiceWithMaxReplicas ¶
func ServiceWithMaxReplicas(n uint64) ServiceSpecOpt
ServiceWithMaxReplicas sets the max replicas for the service
func ServiceWithName ¶
func ServiceWithName(name string) ServiceSpecOpt
ServiceWithName sets the name of the service
func ServiceWithNetwork ¶
func ServiceWithNetwork(network string) ServiceSpecOpt
ServiceWithNetwork sets the network of the service
func ServiceWithPidsLimit ¶
func ServiceWithPidsLimit(limit int64) ServiceSpecOpt
ServiceWithPidsLimit sets the PidsLimit option of the service's Resources.Limits.
func ServiceWithReplicas ¶
func ServiceWithReplicas(n uint64) ServiceSpecOpt
ServiceWithReplicas sets the replicas for the service
func ServiceWithSecret ¶
func ServiceWithSecret(secretRef *swarmtypes.SecretReference) ServiceSpecOpt
ServiceWithSecret adds the secret reference to the service
func ServiceWithSysctls ¶
func ServiceWithSysctls(sysctls map[string]string) ServiceSpecOpt
ServiceWithSysctls sets the Sysctls option of the service's ContainerSpec.