deallocator

package
v0.0.0-...-bc8cfc3 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Deallocator

type Deallocator struct {
	// contains filtered or unexported fields
}

Deallocator waits for services to fully shutdown (ie no containers left) and then proceeds to deallocate service-level resources (e.g. networks), and finally services themselves in particular, the Deallocator should be the only place where services, or service-level resources, are ever deleted!

It’s worth noting that this new component’s role is quite different from the task reaper’s: tasks are purely internal to Swarmkit, and their status is entirely managed by the system itself. In contrast, the deallocator is responsible for safely deleting entities that are directly controlled by the user.

NOTE: since networks are the only service-level resources as of now, it has been deemed over-engineered to have a generic way to handle other types of service-level resources; if we ever start having more of those and thus want to reconsider this choice, it might be worth having a look at this archived branch, that does implement a way of separating the code for the deallocator itself from each resource-speficic way of handling it https://github.com/docker/swarmkit/compare/a84c01f49091167dd086c26b45dc18b38d52e4d9...wk8:wk8/generic_deallocator#diff-75f4f75eee6a6a7a7268c672203ea0ac

func New

func New(store *store.MemoryStore) *Deallocator

New creates a new deallocator

func (*Deallocator) Run

func (deallocator *Deallocator) Run(ctx context.Context) error

Run starts the deallocator, which then starts cleaning up services and their resources when relevant (ie when no tasks still exist for a given service) This is a blocking function

func (*Deallocator) Stop

func (deallocator *Deallocator) Stop()

Stop stops the deallocator's routine FIXME (jrouge): see the comment on TaskReaper.Stop() and see when to properly stop this plus unit test on this!

Jump to

Keyboard shortcuts

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