Documentation ¶
Index ¶
- Variables
- func CopyConfig(config swarm.Config) *swarm.Config
- func CopyConfigSpec(spec swarm.ConfigSpec) *swarm.ConfigSpec
- func CopyNetworkCreate(spec dockerTypes.NetworkCreate) *dockerTypes.NetworkCreate
- func CopyNetworkResource(spec dockerTypes.NetworkResource) *dockerTypes.NetworkResource
- func CopySecret(spec swarm.Secret) *swarm.Secret
- func CopySecretSpec(spec swarm.SecretSpec) *swarm.SecretSpec
- func CopyService(spec swarm.Service) *swarm.Service
- func CopyServiceSpec(spec swarm.ServiceSpec) *swarm.ServiceSpec
- func CopySnapshotStack(snapshot interfaces.SnapshotStack) *interfaces.SnapshotStack
- func CopyStackSpec(spec types.StackSpec) *types.StackSpec
- func FakeGetStackIDFromLabelFilter(args filters.Args) (string, bool)
- func GenerateConfigFixtures(n int, name, label string) []swarm.Config
- func GenerateNetworkFixtures(n int, name, label string) []dockerTypes.NetworkCreateRequest
- func GenerateSecretFixtures(n int, name, label string) []swarm.Secret
- func GenerateServiceFixtures(n int, name, label string) []swarm.Service
- func GenerateStackFixtures(n int, label string) []types.Stack
- func GetTestConfig(name string) swarm.Config
- func GetTestConfigSpec(name string) swarm.ConfigSpec
- func GetTestNetworkRequest(name, driver string) dockerTypes.NetworkCreateRequest
- func GetTestSecret(name string) swarm.Secret
- func GetTestSecretSpec(name string) swarm.SecretSpec
- func GetTestService(name, image string) swarm.Service
- func GetTestServiceSpec(name, image string) swarm.ServiceSpec
- func GetTestStack(name string) types.Stack
- func GetTestStackSpec(name string) types.StackSpec
- func GetTestStackSpecWithMultipleSpecs(n int, name string) types.StackSpec
- func InjectForcedGetError(cli *FakeReconcilerClient, spec *types.StackSpec, removeError string)
- func InjectForcedGetResourcesError(cli *FakeReconcilerClient, spec *types.StackSpec, removeError string)
- func InjectForcedRemoveError(cli *FakeReconcilerClient, spec *types.StackSpec, removeError string)
- func InjectForcedUpdateError(cli *FakeReconcilerClient, spec *types.StackSpec, removeError string)
- func InjectStackID(spec *types.StackSpec, stackID string)
- type FakeConfigStore
- func (f *FakeConfigStore) CreateConfig(spec swarm.ConfigSpec) (string, error)
- func (f *FakeConfigStore) GetConfig(idOrName string) (swarm.Config, error)
- func (f *FakeConfigStore) GetConfigs(opts dockerTypes.ConfigListOptions) ([]swarm.Config, error)
- func (f *FakeConfigStore) InternalAddConfig(id string, config *swarm.Config)
- func (f *FakeConfigStore) InternalDeleteConfig(id string) *swarm.Config
- func (f *FakeConfigStore) InternalGetConfig(id string) *swarm.Config
- func (f *FakeConfigStore) InternalQueryConfigs(transform func(*swarm.Config) interface{}) []interface{}
- func (f *FakeConfigStore) MarkConfigSpecForError(errorKey string, spec *swarm.ConfigSpec, ops ...string)
- func (f *FakeConfigStore) RemoveConfig(idOrName string) error
- func (f *FakeConfigStore) SortedIDs() []string
- func (f *FakeConfigStore) SpecifyErrorTrigger(errorKey string, err error)
- func (f *FakeConfigStore) SpecifyKeyPrefix(keyPrefix string)
- func (f *FakeConfigStore) UpdateConfig(idOrName string, version uint64, spec swarm.ConfigSpec) error
- type FakeNetworkStore
- func (f *FakeNetworkStore) CreateNetwork(request dockerTypes.NetworkCreateRequest) (string, error)
- func (f *FakeNetworkStore) GetNetwork(idOrName string) (dockerTypes.NetworkResource, error)
- func (f *FakeNetworkStore) GetNetworks(plainFilters filters.Args) ([]dockerTypes.NetworkResource, error)
- func (f *FakeNetworkStore) GetNetworksByName(name string) ([]dockerTypes.NetworkResource, error)
- func (f *FakeNetworkStore) InternalAddNetwork(id string, network *dockerTypes.NetworkResource)
- func (f *FakeNetworkStore) InternalDeleteNetwork(id string) *dockerTypes.NetworkResource
- func (f *FakeNetworkStore) InternalGetNetwork(id string) *dockerTypes.NetworkResource
- func (f *FakeNetworkStore) InternalQueryNetworks(transform func(*dockerTypes.NetworkResource) interface{}) []interface{}
- func (f *FakeNetworkStore) MarkNetworkCreateForError(errorKey string, spec *dockerTypes.NetworkCreate, ops ...string)
- func (f *FakeNetworkStore) MarkNetworkResourceForError(errorKey string, network *dockerTypes.NetworkResource, ops ...string)
- func (f *FakeNetworkStore) RemoveNetwork(idOrName string) error
- func (f *FakeNetworkStore) SortedIDs() []string
- func (f *FakeNetworkStore) SpecifyErrorTrigger(errorKey string, err error)
- func (f *FakeNetworkStore) SpecifyKeyPrefix(keyPrefix string)
- func (f *FakeNetworkStore) TransformNetworkCreateRequest(request dockerTypes.NetworkCreateRequest) *dockerTypes.NetworkResource
- type FakeReconcilerClient
- func (f *FakeReconcilerClient) CreateStack(stackSpec types.StackSpec) (types.StackCreateResponse, error)
- func (f *FakeReconcilerClient) GenerateStackDependencies(stackID string) error
- func (*FakeReconcilerClient) GetNode(id string) (swarm.Node, error)
- func (*FakeReconcilerClient) GetTask(string) (swarm.Task, error)
- func (*FakeReconcilerClient) GetTasks(dockerTypes.TaskListOptions) ([]swarm.Task, error)
- func (*FakeReconcilerClient) Info() swarm.Info
- func (*FakeReconcilerClient) SubscribeToEvents(since, until time.Time, ef filters.Args) ([]events.Message, chan interface{})
- func (*FakeReconcilerClient) UnsubscribeFromEvents(events chan interface{})
- type FakeSecretStore
- func (f *FakeSecretStore) CreateSecret(spec swarm.SecretSpec) (string, error)
- func (f *FakeSecretStore) GetSecret(idOrName string) (swarm.Secret, error)
- func (f *FakeSecretStore) GetSecrets(opts dockerTypes.SecretListOptions) ([]swarm.Secret, error)
- func (f *FakeSecretStore) InternalAddSecret(id string, secret *swarm.Secret)
- func (f *FakeSecretStore) InternalDeleteSecret(id string) *swarm.Secret
- func (f *FakeSecretStore) InternalGetSecret(id string) *swarm.Secret
- func (f *FakeSecretStore) InternalQuerySecrets(transform func(*swarm.Secret) interface{}) []interface{}
- func (f *FakeSecretStore) MarkSecretSpecForError(errorKey string, spec *swarm.SecretSpec, ops ...string)
- func (f *FakeSecretStore) RemoveSecret(idOrName string) error
- func (f *FakeSecretStore) SortedIDs() []string
- func (f *FakeSecretStore) SpecifyErrorTrigger(errorKey string, err error)
- func (f *FakeSecretStore) SpecifyKeyPrefix(keyPrefix string)
- func (f *FakeSecretStore) UpdateSecret(idOrName string, version uint64, spec swarm.SecretSpec) error
- type FakeServiceStore
- func (f *FakeServiceStore) CreateService(spec swarm.ServiceSpec, _ string, _ bool) (*dockerTypes.ServiceCreateResponse, error)
- func (f *FakeServiceStore) GetService(idOrName string, _ bool) (swarm.Service, error)
- func (f *FakeServiceStore) GetServices(opts dockerTypes.ServiceListOptions) ([]swarm.Service, error)
- func (f *FakeServiceStore) InternalAddService(id string, service *swarm.Service)
- func (f *FakeServiceStore) InternalDeleteService(id string) *swarm.Service
- func (f *FakeServiceStore) InternalGetService(id string) *swarm.Service
- func (f *FakeServiceStore) InternalQueryServices(transform func(service *swarm.Service) interface{}) []interface{}
- func (f *FakeServiceStore) MarkServiceSpecForError(errorKey string, spec *swarm.ServiceSpec, ops ...string)
- func (f *FakeServiceStore) RemoveService(idOrName string) error
- func (f *FakeServiceStore) SortedIDs() []string
- func (f *FakeServiceStore) SpecifyErrorTrigger(errorKey string, err error)
- func (f *FakeServiceStore) SpecifyKeyPrefix(keyPrefix string)
- func (f *FakeServiceStore) UpdateService(idOrName string, version uint64, spec swarm.ServiceSpec, ...) (*dockerTypes.ServiceUpdateResponse, error)
- type FakeStackStore
- func (s *FakeStackStore) AddStack(spec types.StackSpec) (string, error)
- func (s *FakeStackStore) DeleteStack(idOrName string) error
- func (s *FakeStackStore) GetSnapshotStack(idOrName string) (interfaces.SnapshotStack, error)
- func (s *FakeStackStore) GetStack(idOrName string) (types.Stack, error)
- func (s *FakeStackStore) InternalAddStack(id string, snapshot *interfaces.SnapshotStack)
- func (s *FakeStackStore) InternalDeleteStack(id string) *interfaces.SnapshotStack
- func (s *FakeStackStore) InternalGetStack(id string) *interfaces.SnapshotStack
- func (s *FakeStackStore) InternalQueryStacks(transform func(*interfaces.SnapshotStack) interface{}) []interface{}
- func (s *FakeStackStore) ListStacks() ([]types.Stack, error)
- func (s *FakeStackStore) MarkStackSpecForError(errorKey string, spec *types.StackSpec, ops ...string)
- func (s *FakeStackStore) SortedIDs() []string
- func (s *FakeStackStore) SpecifyErrorTrigger(errorKey string, err error)
- func (s *FakeStackStore) SpecifyKeyPrefix(keyPrefix string)
- func (s *FakeStackStore) UpdateSnapshotStack(idOrName string, snapshot interfaces.SnapshotStack, version uint64) (interfaces.SnapshotStack, error)
- func (s *FakeStackStore) UpdateStack(idOrName string, stackSpec types.StackSpec, version uint64) error
Constants ¶
This section is empty.
Variables ¶
var ( FakeNotFound = errdefs.NotFound(errors.New("service not found")) FakeInvalidArg = errdefs.InvalidParameter(errors.New("not valid")) FakeUnimplemented = errdefs.NotImplemented(errors.New("UNIMPLEMENTED")) )
error definitions to reuse
Functions ¶
func CopyConfig ¶
CopyConfig duplicates the Config
func CopyConfigSpec ¶
func CopyConfigSpec(spec swarm.ConfigSpec) *swarm.ConfigSpec
CopyConfigSpec duplicates the ConfigSpec
func CopyNetworkCreate ¶
func CopyNetworkCreate(spec dockerTypes.NetworkCreate) *dockerTypes.NetworkCreate
CopyNetworkCreate duplicates the dockerTypes.NetworkCreate
func CopyNetworkResource ¶
func CopyNetworkResource(spec dockerTypes.NetworkResource) *dockerTypes.NetworkResource
CopyNetworkResource duplicates the dockerTypes.NetworkResource
func CopySecret ¶
CopySecret duplicates the swarm.Secret
func CopySecretSpec ¶
func CopySecretSpec(spec swarm.SecretSpec) *swarm.SecretSpec
CopySecretSpec duplicates the swarm.SecretSpec
func CopyService ¶
CopyService duplicates the ServiceSpec
func CopyServiceSpec ¶
func CopyServiceSpec(spec swarm.ServiceSpec) *swarm.ServiceSpec
CopyServiceSpec duplicates the ServiceSpec
func CopySnapshotStack ¶
func CopySnapshotStack(snapshot interfaces.SnapshotStack) *interfaces.SnapshotStack
CopySnapshotStack duplicates the interfaces.SnapshotStack
func CopyStackSpec ¶
CopyStackSpec duplicates the types.StackSpec
func FakeGetStackIDFromLabelFilter ¶
FakeGetStackIDFromLabelFilter takes a filters.Args and determines if it includes a filter for StackLabel. If so, it returns the Stack ID specified by the label and true. If not, it returns emptystring and false.
func GenerateConfigFixtures ¶
GenerateConfigFixtures creates some swarm.Config fixtures as well as marking the EVEN ones as belonging to types.StackLabel
func GenerateNetworkFixtures ¶
func GenerateNetworkFixtures(n int, name, label string) []dockerTypes.NetworkCreateRequest
GenerateNetworkFixtures creates some dockerTypes.NetworkCreateRequest fixtures as well as marking the EVEN ones as belonging to types.StackLabel
func GenerateSecretFixtures ¶
GenerateSecretFixtures creates some swarm.Secret fixtures as well as marking the EVEN ones as belonging to types.StackLabel
func GenerateServiceFixtures ¶
GenerateServiceFixtures creates some swarm.Service fixtures as well as marking the EVEN ones as belonging to types.StackLabel
func GenerateStackFixtures ¶
GenerateStackFixtures creates some types.Stack fixtures as well as marking the EVEN ones as belonging to types.StackLabel
func GetTestConfig ¶
GetTestConfig creates a minimal swarm.Config
func GetTestConfigSpec ¶
func GetTestConfigSpec(name string) swarm.ConfigSpec
GetTestConfigSpec creates a minimal swarm.ConfigSpec
func GetTestNetworkRequest ¶
func GetTestNetworkRequest(name, driver string) dockerTypes.NetworkCreateRequest
GetTestNetworkRequest creates a minimal dockerTypes.NetworkCreateRequest
func GetTestSecret ¶
GetTestSecret creates a minimal swarm.Secret
func GetTestSecretSpec ¶
func GetTestSecretSpec(name string) swarm.SecretSpec
GetTestSecretSpec creates a minimal swarm.SecretSpec
func GetTestService ¶
GetTestService creates a minimal swarm.Service
func GetTestServiceSpec ¶
func GetTestServiceSpec(name, image string) swarm.ServiceSpec
GetTestServiceSpec creates a minimal swarm.ServiceSpec
func GetTestStack ¶
GetTestStack creates a minimal type.Stack
func GetTestStackSpec ¶
GetTestStackSpec creates a full types.StackSpec
func GetTestStackSpecWithMultipleSpecs ¶
GetTestStackSpecWithMultipleSpecs creates a full types.StackSpec with multiple specs
func InjectForcedGetError ¶
func InjectForcedGetError(cli *FakeReconcilerClient, spec *types.StackSpec, removeError string)
InjectForcedGetError marks all specs with Get* errors
func InjectForcedGetResourcesError ¶
func InjectForcedGetResourcesError(cli *FakeReconcilerClient, spec *types.StackSpec, removeError string)
InjectForcedGetResourcesError marks all specs with Get errors
func InjectForcedRemoveError ¶
func InjectForcedRemoveError(cli *FakeReconcilerClient, spec *types.StackSpec, removeError string)
InjectForcedRemoveError adds types.StackLabel to all specs
func InjectForcedUpdateError ¶
func InjectForcedUpdateError(cli *FakeReconcilerClient, spec *types.StackSpec, removeError string)
InjectForcedUpdateError adds types.StackLabel to all specs
func InjectStackID ¶
InjectStackID adds types.StackLabel to all specs
Types ¶
type FakeConfigStore ¶
type FakeConfigStore struct {
// contains filtered or unexported fields
}
FakeConfigStore contains the subset of Backend APIs for swarm.Config
func NewFakeConfigStore ¶
func NewFakeConfigStore() *FakeConfigStore
NewFakeConfigStore creates a new FakeConfigStore
func (*FakeConfigStore) CreateConfig ¶
func (f *FakeConfigStore) CreateConfig(spec swarm.ConfigSpec) (string, error)
CreateConfig creates a swarm config.
func (*FakeConfigStore) GetConfig ¶
func (f *FakeConfigStore) GetConfig(idOrName string) (swarm.Config, error)
GetConfig gets a swarm config
func (*FakeConfigStore) GetConfigs ¶
func (f *FakeConfigStore) GetConfigs(opts dockerTypes.ConfigListOptions) ([]swarm.Config, error)
GetConfigs implements the GetConfigs method of the SwarmConfigBackend, returning a list of configs. It only supports 1 kind of filter, which is a filter for stack ID.
func (*FakeConfigStore) InternalAddConfig ¶
func (f *FakeConfigStore) InternalAddConfig(id string, config *swarm.Config)
InternalAddConfig adds swarm.Config to storage without preconditions
func (*FakeConfigStore) InternalDeleteConfig ¶
func (f *FakeConfigStore) InternalDeleteConfig(id string) *swarm.Config
InternalDeleteConfig removes swarm.Config from storage without preconditions
func (*FakeConfigStore) InternalGetConfig ¶
func (f *FakeConfigStore) InternalGetConfig(id string) *swarm.Config
InternalGetConfig retrieves swarm.Config or nil from storage without preconditions
func (*FakeConfigStore) InternalQueryConfigs ¶
func (f *FakeConfigStore) InternalQueryConfigs(transform func(*swarm.Config) interface{}) []interface{}
InternalQueryConfigs retrieves all swarm.Config from storage while applying a transform
func (*FakeConfigStore) MarkConfigSpecForError ¶
func (f *FakeConfigStore) MarkConfigSpecForError(errorKey string, spec *swarm.ConfigSpec, ops ...string)
MarkConfigSpecForError marks a ConfigSpec to trigger an error when calls from interfaces.SwarmConfigBackend are configured for the errorKey. - All interfaces.SwarmConfigBackend calls may be triggered if len(ops)==0 - Otherwise, ops may be any of the following: GetConfigs, GetConfig, CreateConfig, UpdateConfig, RemoveConfig
func (*FakeConfigStore) RemoveConfig ¶
func (f *FakeConfigStore) RemoveConfig(idOrName string) error
RemoveConfig deletes the config
func (*FakeConfigStore) SortedIDs ¶
func (f *FakeConfigStore) SortedIDs() []string
SortedIDs returns sorted Config IDs
func (*FakeConfigStore) SpecifyErrorTrigger ¶
func (f *FakeConfigStore) SpecifyErrorTrigger(errorKey string, err error)
SpecifyErrorTrigger associates an error to an errorKey so that when calls interfaces.SwarmConfigBackend find a marked swarm.ConfigSpec an error is returned
func (*FakeConfigStore) SpecifyKeyPrefix ¶
func (f *FakeConfigStore) SpecifyKeyPrefix(keyPrefix string)
SpecifyKeyPrefix provides prefix to generated ID's
func (*FakeConfigStore) UpdateConfig ¶
func (f *FakeConfigStore) UpdateConfig( idOrName string, version uint64, spec swarm.ConfigSpec, ) error
UpdateConfig updates the config to the provided spec.
type FakeNetworkStore ¶
type FakeNetworkStore struct {
// contains filtered or unexported fields
}
FakeNetworkStore contains the subset of Backend APIs for dockerTypes.NetworkResource
func NewFakeNetworkStore ¶
func NewFakeNetworkStore() *FakeNetworkStore
NewFakeNetworkStore creates a new FakeNetworkStore
func (*FakeNetworkStore) CreateNetwork ¶
func (f *FakeNetworkStore) CreateNetwork(request dockerTypes.NetworkCreateRequest) (string, error)
CreateNetwork creates a swarm network.
func (*FakeNetworkStore) GetNetwork ¶
func (f *FakeNetworkStore) GetNetwork(idOrName string) (dockerTypes.NetworkResource, error)
GetNetwork gets a swarm network
func (*FakeNetworkStore) GetNetworks ¶
func (f *FakeNetworkStore) GetNetworks(plainFilters filters.Args) ([]dockerTypes.NetworkResource, error)
GetNetworks implements the GetNetworks method of the SwarmNetworkBackend, returning a list of networks. It only supports 1 kind of filter, which is a filter for stack ID.
func (*FakeNetworkStore) GetNetworksByName ¶
func (f *FakeNetworkStore) GetNetworksByName(name string) ([]dockerTypes.NetworkResource, error)
GetNetworksByName implements the GetNetworks method of the SwarmNetworkBackend, returning a list of networks by name
func (*FakeNetworkStore) InternalAddNetwork ¶
func (f *FakeNetworkStore) InternalAddNetwork(id string, network *dockerTypes.NetworkResource)
InternalAddNetwork adds dockerTypes.NetworkResource to storage without preconditions
func (*FakeNetworkStore) InternalDeleteNetwork ¶
func (f *FakeNetworkStore) InternalDeleteNetwork(id string) *dockerTypes.NetworkResource
InternalDeleteNetwork removes dockerTypes.NetworkResource from storage without preconditions
func (*FakeNetworkStore) InternalGetNetwork ¶
func (f *FakeNetworkStore) InternalGetNetwork(id string) *dockerTypes.NetworkResource
InternalGetNetwork retrieves dockerTypes.NetworkResource or nil from storage without preconditions
func (*FakeNetworkStore) InternalQueryNetworks ¶
func (f *FakeNetworkStore) InternalQueryNetworks(transform func(*dockerTypes.NetworkResource) interface{}) []interface{}
InternalQueryNetworks retrieves all dockerTypes.NetworkResource from storage while applying a transform
func (*FakeNetworkStore) MarkNetworkCreateForError ¶
func (f *FakeNetworkStore) MarkNetworkCreateForError(errorKey string, spec *dockerTypes.NetworkCreate, ops ...string)
MarkNetworkCreateForError marks a dockerTypes.NetworkCreate to trigger an error when calls from interfaces.SwarmNetworkBackend are configured for the errorKey. - All interfaces.SwarmNetworkBackend calls may be triggered if len(ops)==0 - Otherwise, ops may be any of the following: GetNetworks, GetNetworksByName, GetNetwork, CreateNetwork, RemoveNetwork
func (*FakeNetworkStore) MarkNetworkResourceForError ¶
func (f *FakeNetworkStore) MarkNetworkResourceForError(errorKey string, network *dockerTypes.NetworkResource, ops ...string)
MarkNetworkResourceForError see MarkNetworkCreateForError, NetworkResource objects do not contain their creation object like a Spec. It is simpler to have a second version of the Mark function
func (*FakeNetworkStore) RemoveNetwork ¶
func (f *FakeNetworkStore) RemoveNetwork(idOrName string) error
RemoveNetwork deletes the network
func (*FakeNetworkStore) SortedIDs ¶
func (f *FakeNetworkStore) SortedIDs() []string
SortedIDs returns sorted Stack IDs
func (*FakeNetworkStore) SpecifyErrorTrigger ¶
func (f *FakeNetworkStore) SpecifyErrorTrigger(errorKey string, err error)
SpecifyErrorTrigger associates an error to an errorKey so that when calls interfaces.SwarmSecretBackend find a marked dockerTypes.NetworkResource an error is returned
func (*FakeNetworkStore) SpecifyKeyPrefix ¶
func (f *FakeNetworkStore) SpecifyKeyPrefix(keyPrefix string)
SpecifyKeyPrefix provides prefix to generated ID's
func (*FakeNetworkStore) TransformNetworkCreateRequest ¶
func (f *FakeNetworkStore) TransformNetworkCreateRequest(request dockerTypes.NetworkCreateRequest) *dockerTypes.NetworkResource
TransformNetworkCreateRequest utility function populates NetworkResource from a NetworkCreateRequest
type FakeReconcilerClient ¶
type FakeReconcilerClient struct { FakeStackStore FakeServiceStore FakeSecretStore FakeConfigStore FakeNetworkStore }
FakeReconcilerClient is a fake implementing the BackendClient interface, which is used to test the reconciler.
func NewFakeReconcilerClient ¶
func NewFakeReconcilerClient() *FakeReconcilerClient
NewFakeReconcilerClient creates a BackendClient using the FIVE fake storage interfaces for stack, service, secret, network, config
func (*FakeReconcilerClient) CreateStack ¶
func (f *FakeReconcilerClient) CreateStack(stackSpec types.StackSpec) (types.StackCreateResponse, error)
CreateStack creates a new stack if the stack is valid.
func (*FakeReconcilerClient) GenerateStackDependencies ¶
func (f *FakeReconcilerClient) GenerateStackDependencies(stackID string) error
GenerateStackDependencies creates a new stack if the stack is valid. nolint: gocyclo
func (*FakeReconcilerClient) GetNode ¶
func (*FakeReconcilerClient) GetNode(id string) (swarm.Node, error)
GetNode calls of the SwarmResourceBackend - unused
func (*FakeReconcilerClient) GetTask ¶
func (*FakeReconcilerClient) GetTask(string) (swarm.Task, error)
GetTask calls of the SwarmResourceBackend - unused
func (*FakeReconcilerClient) GetTasks ¶
func (*FakeReconcilerClient) GetTasks(dockerTypes.TaskListOptions) ([]swarm.Task, error)
GetTasks calls of the SwarmResourceBackend - unused
func (*FakeReconcilerClient) Info ¶
func (*FakeReconcilerClient) Info() swarm.Info
Info call of the SwarmResourceBackend - unused
func (*FakeReconcilerClient) SubscribeToEvents ¶
func (*FakeReconcilerClient) SubscribeToEvents(since, until time.Time, ef filters.Args) ([]events.Message, chan interface{})
SubscribeToEvents subscribes to events - unused
func (*FakeReconcilerClient) UnsubscribeFromEvents ¶
func (*FakeReconcilerClient) UnsubscribeFromEvents(events chan interface{})
UnsubscribeFromEvents subscribes to events - unused
type FakeSecretStore ¶
type FakeSecretStore struct {
// contains filtered or unexported fields
}
FakeSecretStore contains the subset of Backend APIs SwarmSecretBackend
func NewFakeSecretStore ¶
func NewFakeSecretStore() *FakeSecretStore
NewFakeSecretStore creates a new FakeSecretStore
func (*FakeSecretStore) CreateSecret ¶
func (f *FakeSecretStore) CreateSecret(spec swarm.SecretSpec) (string, error)
CreateSecret creates a swarm secret.
func (*FakeSecretStore) GetSecret ¶
func (f *FakeSecretStore) GetSecret(idOrName string) (swarm.Secret, error)
GetSecret gets a swarm secret
func (*FakeSecretStore) GetSecrets ¶
func (f *FakeSecretStore) GetSecrets(opts dockerTypes.SecretListOptions) ([]swarm.Secret, error)
GetSecrets implements the GetSecrets method of the SwarmSecretBackend, returning a list of secrets. It only supports 1 kind of filter, which is a filter for stack ID.
func (*FakeSecretStore) InternalAddSecret ¶
func (f *FakeSecretStore) InternalAddSecret(id string, secret *swarm.Secret)
InternalAddSecret adds swarm.Secret to storage without preconditions
func (*FakeSecretStore) InternalDeleteSecret ¶
func (f *FakeSecretStore) InternalDeleteSecret(id string) *swarm.Secret
InternalDeleteSecret removes swarm.SecretSpec from storage without preconditions
func (*FakeSecretStore) InternalGetSecret ¶
func (f *FakeSecretStore) InternalGetSecret(id string) *swarm.Secret
InternalGetSecret retrieves swarm.Secret or nil from storage without preconditions
func (*FakeSecretStore) InternalQuerySecrets ¶
func (f *FakeSecretStore) InternalQuerySecrets(transform func(*swarm.Secret) interface{}) []interface{}
InternalQuerySecrets retrieves all swarm.Secret from storage while applying a transform
func (*FakeSecretStore) MarkSecretSpecForError ¶
func (f *FakeSecretStore) MarkSecretSpecForError(errorKey string, spec *swarm.SecretSpec, ops ...string)
MarkSecretSpecForError marks a swarm.SecretSpec to trigger an error when calls from interfaces.SwarmSecretBackend are configured for the errorKey. - All interfaces.SwarmSecretBackend calls may be triggered if len(ops)==0 - Otherwise, ops may be any of the following: GetSecrets, GetSecret, CreateSecret, UpdateSecret, RemoveSecret
func (*FakeSecretStore) RemoveSecret ¶
func (f *FakeSecretStore) RemoveSecret(idOrName string) error
RemoveSecret deletes the secret
func (*FakeSecretStore) SortedIDs ¶
func (f *FakeSecretStore) SortedIDs() []string
SortedIDs returns sorted Secret IDs
func (*FakeSecretStore) SpecifyErrorTrigger ¶
func (f *FakeSecretStore) SpecifyErrorTrigger(errorKey string, err error)
SpecifyErrorTrigger associates an error to an errorKey so that when calls interfaces.SwarmSecretBackend find a marked swarm.SecretSpec an error is returned
func (*FakeSecretStore) SpecifyKeyPrefix ¶
func (f *FakeSecretStore) SpecifyKeyPrefix(keyPrefix string)
SpecifyKeyPrefix provides prefix to generated ID's
func (*FakeSecretStore) UpdateSecret ¶
func (f *FakeSecretStore) UpdateSecret( idOrName string, version uint64, spec swarm.SecretSpec, ) error
UpdateSecret updates the secret to the provided spec.
type FakeServiceStore ¶
type FakeServiceStore struct {
// contains filtered or unexported fields
}
FakeServiceStore contains the subset of Backend APIs SwarmServiceBackend
func NewFakeServiceStore ¶
func NewFakeServiceStore() *FakeServiceStore
NewFakeServiceStore creates a new FakeServiceStore
func (*FakeServiceStore) CreateService ¶
func (f *FakeServiceStore) CreateService(spec swarm.ServiceSpec, _ string, _ bool) (*dockerTypes.ServiceCreateResponse, error)
CreateService creates a swarm service.
func (*FakeServiceStore) GetService ¶
GetService gets a swarm service
func (*FakeServiceStore) GetServices ¶
func (f *FakeServiceStore) GetServices(opts dockerTypes.ServiceListOptions) ([]swarm.Service, error)
GetServices implements the GetServices method of the SwarmServiceBackend, returning a list of services. It only supports 1 kind of filter, which is a filter for stack ID.
func (*FakeServiceStore) InternalAddService ¶
func (f *FakeServiceStore) InternalAddService(id string, service *swarm.Service)
InternalAddService adds swarm.Service to storage without preconditions
func (*FakeServiceStore) InternalDeleteService ¶
func (f *FakeServiceStore) InternalDeleteService(id string) *swarm.Service
InternalDeleteService removes swarm.Service from storage without preconditions
func (*FakeServiceStore) InternalGetService ¶
func (f *FakeServiceStore) InternalGetService(id string) *swarm.Service
InternalGetService retrieves swarm.Service or nil from storage without preconditions
func (*FakeServiceStore) InternalQueryServices ¶
func (f *FakeServiceStore) InternalQueryServices(transform func(service *swarm.Service) interface{}) []interface{}
InternalQueryServices retrieves all swarm.Service from storage while applying a transform
func (*FakeServiceStore) MarkServiceSpecForError ¶
func (f *FakeServiceStore) MarkServiceSpecForError(errorKey string, spec *swarm.ServiceSpec, ops ...string)
MarkServiceSpecForError marks a swarm.ServiceSpec to trigger an error when calls from interfaces.SwarmServiceBackend are configured for the errorKey. - All interfaces.SwarmServiceBackend calls may be triggered if len(ops)==0 - Otherwise, ops may be any of the following: GetServices, GetService, CreateService, UpdateService, RemoveService
func (*FakeServiceStore) RemoveService ¶
func (f *FakeServiceStore) RemoveService(idOrName string) error
RemoveService deletes the service
func (*FakeServiceStore) SortedIDs ¶
func (f *FakeServiceStore) SortedIDs() []string
SortedIDs returns sorted Service IDs
func (*FakeServiceStore) SpecifyErrorTrigger ¶
func (f *FakeServiceStore) SpecifyErrorTrigger(errorKey string, err error)
SpecifyErrorTrigger associates an error to an errorKey so that when calls interfaces.SwarmServiceBackend find a marked swarm.ServiceSpec an error is returned
func (*FakeServiceStore) SpecifyKeyPrefix ¶
func (f *FakeServiceStore) SpecifyKeyPrefix(keyPrefix string)
SpecifyKeyPrefix provides prefix to generated ID's
func (*FakeServiceStore) UpdateService ¶
func (f *FakeServiceStore) UpdateService( idOrName string, version uint64, spec swarm.ServiceSpec, _ dockerTypes.ServiceUpdateOptions, _ bool, ) (*dockerTypes.ServiceUpdateResponse, error)
UpdateService updates the service to the provided spec.
type FakeStackStore ¶
FakeStackStore contains the subset of Backend APIs for types.Stack
func NewFakeStackStore ¶
func NewFakeStackStore() *FakeStackStore
NewFakeStackStore creates a new FakeStackStore
func (*FakeStackStore) AddStack ¶
func (s *FakeStackStore) AddStack(spec types.StackSpec) (string, error)
AddStack adds a stack to the store.
func (*FakeStackStore) DeleteStack ¶
func (s *FakeStackStore) DeleteStack(idOrName string) error
DeleteStack removes a stack from the store.
func (*FakeStackStore) GetSnapshotStack ¶
func (s *FakeStackStore) GetSnapshotStack(idOrName string) (interfaces.SnapshotStack, error)
GetSnapshotStack retrieves a single stack from the store.
func (*FakeStackStore) GetStack ¶
func (s *FakeStackStore) GetStack(idOrName string) (types.Stack, error)
GetStack retrieves a single stack from the store.
func (*FakeStackStore) InternalAddStack ¶
func (s *FakeStackStore) InternalAddStack(id string, snapshot *interfaces.SnapshotStack)
InternalAddStack adds types.Stack to storage without preconditions
func (*FakeStackStore) InternalDeleteStack ¶
func (s *FakeStackStore) InternalDeleteStack(id string) *interfaces.SnapshotStack
InternalDeleteStack removes types.Stack from storage without preconditions
func (*FakeStackStore) InternalGetStack ¶
func (s *FakeStackStore) InternalGetStack(id string) *interfaces.SnapshotStack
InternalGetStack retrieves types.Stack or nil from storage without preconditions
func (*FakeStackStore) InternalQueryStacks ¶
func (s *FakeStackStore) InternalQueryStacks(transform func(*interfaces.SnapshotStack) interface{}) []interface{}
InternalQueryStacks retrieves all types.Stack from storage while applying a transform
func (*FakeStackStore) ListStacks ¶
func (s *FakeStackStore) ListStacks() ([]types.Stack, error)
ListStacks returns all known stacks from the store.
func (*FakeStackStore) MarkStackSpecForError ¶
func (s *FakeStackStore) MarkStackSpecForError(errorKey string, spec *types.StackSpec, ops ...string)
MarkStackSpecForError marks a ConfigSpec to trigger an error when calls from interfaces.SwarmConfigBackend are configured for the errorKey. - All interfaces.SwarmConfigBackend calls may be triggered if len(ops)==0 - Otherwise, ops may be any of the following: ListStacks, GetStack, AddStack, UpdateStack, DeleteStack, UpdateSnapshotStack, GetSnapshotStack
func (*FakeStackStore) SortedIDs ¶
func (s *FakeStackStore) SortedIDs() []string
SortedIDs returns sorted Stack IDs
func (*FakeStackStore) SpecifyErrorTrigger ¶
func (s *FakeStackStore) SpecifyErrorTrigger(errorKey string, err error)
SpecifyErrorTrigger associates an error to an errorKey so that when calls to interfaces.StackStore find a marked types.StackSpec an error is returned
func (*FakeStackStore) SpecifyKeyPrefix ¶
func (s *FakeStackStore) SpecifyKeyPrefix(keyPrefix string)
SpecifyKeyPrefix provides prefix to generated ID's
func (*FakeStackStore) UpdateSnapshotStack ¶
func (s *FakeStackStore) UpdateSnapshotStack(idOrName string, snapshot interfaces.SnapshotStack, version uint64) (interfaces.SnapshotStack, error)
UpdateSnapshotStack updates the snapshot in the store.
func (*FakeStackStore) UpdateStack ¶
func (s *FakeStackStore) UpdateStack(idOrName string, stackSpec types.StackSpec, version uint64) error
UpdateStack updates the stack in the store.