Documentation
¶
Index ¶
- Constants
- Variables
- func GetConfigDetails(composefiles []string, stdin io.Reader) (types.ConfigDetails, error)
- func GetModeEnabled() bool
- func GetServicesByLabel(ctx context.Context, apiclient client.APIClient, labelKey, labelValue string) ([]swarm.Service, error)
- func GetStackServices(ctx context.Context, apiclient client.APIClient, namespace string) ([]swarm.Service, error)
- func GetStacks(ctx context.Context, apiclient client.APIClient) (map[string][]swarm.Service, error)
- func LoadComposefile(dockerCli command.Cli, opts options.Deploy, environment map[string]string, ...) (*types.Config, error)
- func RefreshModeEnabled(ctx context.Context, dockerClient client.APIClient) error
- func RunDeploy(ctx context.Context, dockerCLI command.Cli, opts *options.Deploy, ...) error
- func RunRemove(ctx context.Context, dockerCli command.Cli, opts options.Remove) error
- func ScaleService(ctx context.Context, dockerCLI command.Cli, serviceName string, ...) error
- func SetDisableSwarmFeature(ignore bool)
- func WaitOnServices(ctx context.Context, dockerCli command.Cli, serviceIDs []string) error
- type DeployMode
- type Service
Constants ¶
View Source
const ( ResolveImageAlways = "always" ResolveImageChanged = "changed" ResolveImageNever = "never" )
ResolveImage constants for controlling image resolution during deployment.
View Source
const (
StackNamespaceLabel = "com.docker.stack.namespace"
)
Variables ¶
View Source
var ErrNotReplicatedService = errors.New("service is not in replicated or replicated-job mode")
Functions ¶
func GetConfigDetails ¶
GetConfigDetails parse the composefiles specified in the cli and returns their ConfigDetails.
func GetModeEnabled ¶ added in v0.78.0
func GetModeEnabled() bool
GetModeEnabled, Whether the docker host is running in swarm mode, it will return false if ignoreSwarmFeature is true.
func GetServicesByLabel ¶ added in v0.54.0
func GetStackServices ¶ added in v0.45.0
func LoadComposefile ¶
func LoadComposefile(dockerCli command.Cli, opts options.Deploy, environment map[string]string, workingDir string) (*types.Config, error)
LoadComposefile parse the composefile specified in the cli and returns its Config and version.
func RefreshModeEnabled ¶ added in v0.78.0
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 ScaleService ¶ added in v0.45.0
func SetDisableSwarmFeature ¶ added in v0.78.0
func SetDisableSwarmFeature(ignore bool)
SetDisableSwarmFeature, disable swarm feature.
Types ¶
type DeployMode ¶ added in v0.81.0
type DeployMode string
const ( DeployModeReplicated DeployMode = "replicated" DeployModeReplicatedJob DeployMode = "replicated-job" DeployModeGlobal DeployMode = "global" DeployModeGlobalJob DeployMode = "global-job" )
type Service ¶
type Service struct {
ID string
swarm.Meta
Spec swarm.ServiceSpec
PreviousSpec *swarm.ServiceSpec `json:",omitempty"`
Endpoint swarm.Endpoint
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.
Click to show internal directories.
Click to hide internal directories.