stack

package
v0.0.0-...-004cd70 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2024 License: GPL-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

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

Resolve image constants

Variables

View Source
var WaitTimeout int = 50

Timeout to wait until docker services converge, default is 50s (random choice)

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 IsDeployed

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

IsDeployed chekcks whether an appp is deployed or not.

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, dontWait bool) 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.

Types

type Deploy

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

Deploy holds docker stack deploy options

type Remove

type Remove struct {
	Namespaces []string
}

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

Jump to

Keyboard shortcuts

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