swarm

package
v0.40.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2025 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StackNamespaceLabel = "com.docker.stack.namespace"
)

Variables

View Source
var ModeEnabled bool // Whether the docker host is running in swarm mode

Functions

func CheckDaemonIsSwarmManager

func CheckDaemonIsSwarmManager(ctx context.Context, dockerCli command.Cli) (bool, error)

CheckDaemonIsSwarmManager does an Info API call to verify that the daemon is a swarm manager. This is necessary because we must create networks before we create services, but the API call for creating a network does not return a proper status code when it can't create a network in the "global" scope.

func GetConfigDetails

func GetConfigDetails(composefiles []string, stdin io.Reader) (types.ConfigDetails, error)

GetConfigDetails parse the composefiles specified in the cli and returns their ConfigDetails.

func LoadComposefile

func LoadComposefile(dockerCli command.Cli, opts options.Deploy, resolvedSecrets secrettypes.ResolvedSecrets) (*types.Config, error)

LoadComposefile parse the composefile specified in the cli and returns its Config and version.

func RunDeploy

func RunDeploy(ctx context.Context, dockerCLI command.Cli, opts *options.Deploy, cfg *composetypes.Config) error

RunDeploy is the swarm implementation of docker stack deploy.

func RunRemove

func RunRemove(ctx context.Context, dockerCli command.Cli, opts options.Remove) error

RunRemove is the swarm implementation of docker stack remove.

Types

type Service

type Service struct {
	ID string
	swarm.Meta
	Spec         swarm.ServiceSpec   `json:",omitempty"`
	PreviousSpec *swarm.ServiceSpec  `json:",omitempty"`
	Endpoint     swarm.Endpoint      `json:",omitempty"`
	UpdateStatus *swarm.UpdateStatus `json:",omitempty"`

	// ServiceStatus is an optional, extra field indicating the number of
	// desired and running tasks. It is provided primarily as a shortcut to
	// calculating these values client-side, which otherwise would require
	// listing all tasks for a service, an operation that could be
	// computation and network expensive.
	ServiceStatus *swarm.ServiceStatus `json:",omitempty"`

	// JobStatus is the status of a Service which is in one of ReplicatedJob or
	// GlobalJob modes. It is absent on Replicated and Global services.
	JobStatus *swarm.JobStatus `json:",omitempty"`
}

Service represents a service.

Jump to

Keyboard shortcuts

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