stack

package
v0.0.0-...-0b474ea Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: GPL-2.0 Imports: 30 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	ResolveImageAlways  = "always"
	ResolveImageChanged = "changed"
	ResolveImageNever   = "never"
)

Resolve image constants

Variables

View Source
var WaitTimeout = 0

Timeout to wait until docker services converge. This timeout is disabled by default but can be configured by passing a TIMEOUT=... in the app .env

Functions

func DontSkipValidation

func DontSkipValidation(opts *loader.Options)

DontSkipValidation ensures validation is done for compose file loading

func GetStackServices

func GetStackServices(ctx context.Context, dockerclient client.APIClient, namespace string) ([]swarm.Service, error)

func GetStacks

func GetStacks(cl *dockerClient.Client) ([]*formatter.Stack, error)

Copypasta from https://github.com/docker/cli/blob/master/cli/command/stack/swarm/list.go GetStacks lists the swarm stacks.

func LoadComposefile

func LoadComposefile(opts Deploy, appEnv map[string]string, options ...func(*loader.Options)) (*composetypes.Config, error)

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

func RunDeploy

func RunDeploy(
	cl *dockerClient.Client,
	opts Deploy,
	cfg *composetypes.Config,
	appName string,
	serverName string,
	dontWait bool,
	noInput bool,
	filters filters.Args,
) error

RunDeploy is the swarm implementation of docker stack deploy

func RunRemove

func RunRemove(ctx context.Context, client *apiclient.Client, opts Remove) error

RunRemove is the swarm implementation of docker stack remove

func SkipInterpolation

func SkipInterpolation(opts *loader.Options)

SkipInterpolation skip interpolating environment variables.

func WaitOnServices

func WaitOnServices(ctx context.Context, cl *dockerClient.Client, opts WaitOpts) error

Types

type Deploy

type Deploy struct {
	Composefiles     []string
	Namespace        string
	ResolveImage     string
	SendRegistryAuth bool
	Prune            bool
	Detach           bool
	Quiet            bool
}

Deploy holds docker stack deploy options

type DeployMeta

type DeployMeta struct {
	IsDeployed   bool   // whether the app is deployed or not
	Version      string // the deployed version
	IsChaos      bool   // whether or not the deployment is --chaos
	ChaosVersion string // the --chaos deployment version
}

DeployMeta is runtime metadata about an app deployment.

func IsDeployed

func IsDeployed(ctx context.Context, cl *dockerClient.Client, stackName string) (DeployMeta, error)

IsDeployed gathers metadata about an app deployment.

func (DeployMeta) String

func (d DeployMeta) String() string

type Remove

type Remove struct {
	Namespaces []string
	Detach     bool
}

Remove holds docker stack remove options

type StackStatus

type StackStatus struct {
	Services []swarm.Service
	Err      error
}

func GetAllDeployedServices

func GetAllDeployedServices(cl *dockerClient.Client, contextName string) StackStatus

func GetDeployedServicesByLabel

func GetDeployedServicesByLabel(cl *dockerClient.Client, contextName string, label string) StackStatus

GetDeployedServicesByLabel filters services by label

func GetDeployedServicesByName

func GetDeployedServicesByName(ctx context.Context, cl *dockerClient.Client, stackName, serviceName string) StackStatus

GetDeployedServicesByName filters services by name

type WaitOpts

type WaitOpts struct {
	AppName    string
	Filters    filters.Args
	NoInput    bool
	NoLog      bool
	Quiet      bool
	ServerName string
	Services   []ui.ServiceMeta
}

Jump to

Keyboard shortcuts

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