exec

package
v0.0.0-...-4560a53 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2023 License: Zlib Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ComposeStackManager

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

ComposeStackManager is a wrapper for docker-compose binary

func NewComposeStackManager

func NewComposeStackManager(deployer libstack.Deployer, proxyManager *proxy.Manager) (*ComposeStackManager, error)

NewComposeStackManager returns a docker-compose wrapper if corresponding binary present, otherwise nil

func (*ComposeStackManager) ComposeSyntaxMaxVersion

func (manager *ComposeStackManager) ComposeSyntaxMaxVersion() string

ComposeSyntaxMaxVersion returns the maximum supported version of the docker compose syntax

func (*ComposeStackManager) Down

func (manager *ComposeStackManager) Down(ctx context.Context, stack *portainer.Stack, endpoint *portainer.Endpoint) error

Down stops and removes containers, networks, images, and volumes

func (*ComposeStackManager) NormalizeStackName

func (manager *ComposeStackManager) NormalizeStackName(name string) string

NormalizeStackName returns a new stack name with unsupported characters replaced

func (*ComposeStackManager) Pull

func (manager *ComposeStackManager) Pull(ctx context.Context, stack *portainer.Stack, endpoint *portainer.Endpoint) error

Pull an image associated with a service defined in a docker-compose.yml or docker-stack.yml file, but does not start containers based on those images.

func (*ComposeStackManager) Up

func (manager *ComposeStackManager) Up(ctx context.Context, stack *portainer.Stack, endpoint *portainer.Endpoint, forceRecreate bool) error

Up builds, (re)creates and starts containers in the background. Wraps `docker-compose up -d` command

type KubernetesDeployer

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

KubernetesDeployer represents a service to deploy resources inside a Kubernetes environment(endpoint).

func NewKubernetesDeployer

func NewKubernetesDeployer(kubernetesTokenCacheManager *kubernetes.TokenCacheManager, kubernetesClientFactory *cli.ClientFactory, datastore dataservices.DataStore, reverseTunnelService portainer.ReverseTunnelService, signatureService portainer.DigitalSignatureService, proxyManager *proxy.Manager, binaryPath string) *KubernetesDeployer

NewKubernetesDeployer initializes a new KubernetesDeployer service.

func (*KubernetesDeployer) ConvertCompose

func (deployer *KubernetesDeployer) ConvertCompose(data []byte) ([]byte, error)

ConvertCompose leverages the kompose binary to deploy a compose compliant manifest.

func (*KubernetesDeployer) Deploy

func (deployer *KubernetesDeployer) Deploy(userID portainer.UserID, endpoint *portainer.Endpoint, manifestFiles []string, namespace string) (string, error)

Deploy upserts Kubernetes resources defined in manifest(s)

func (*KubernetesDeployer) Remove

func (deployer *KubernetesDeployer) Remove(userID portainer.UserID, endpoint *portainer.Endpoint, manifestFiles []string, namespace string) (string, error)

Remove deletes Kubernetes resources defined in manifest(s)

type StringSet

type StringSet map[string]bool

func NewStringSet

func NewStringSet() StringSet

func (StringSet) Add

func (s StringSet) Add(x string)

func (StringSet) Contains

func (s StringSet) Contains(x string) bool

func (StringSet) Len

func (s StringSet) Len() int

func (StringSet) List

func (s StringSet) List() []string

func (StringSet) Remove

func (s StringSet) Remove(x string)

func (StringSet) Union

func (s StringSet) Union(x StringSet)

type SwarmStackManager

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

SwarmStackManager represents a service for managing stacks.

func NewSwarmStackManager

func NewSwarmStackManager(
	binaryPath, configPath string,
	signatureService portainer.DigitalSignatureService,
	fileService portainer.FileService,
	reverseTunnelService portainer.ReverseTunnelService,
	datastore dataservices.DataStore,
) (*SwarmStackManager, error)

NewSwarmStackManager initializes a new SwarmStackManager service. It also updates the configuration of the Docker CLI binary.

func (*SwarmStackManager) Deploy

func (manager *SwarmStackManager) Deploy(stack *portainer.Stack, prune bool, pullImage bool, endpoint *portainer.Endpoint) error

Deploy executes the docker stack deploy command.

func (*SwarmStackManager) Login

func (manager *SwarmStackManager) Login(registries []portainer.Registry, endpoint *portainer.Endpoint) error

Login executes the docker login command against a list of registries (including DockerHub).

func (*SwarmStackManager) Logout

func (manager *SwarmStackManager) Logout(endpoint *portainer.Endpoint) error

Logout executes the docker logout command.

func (*SwarmStackManager) NormalizeStackName

func (manager *SwarmStackManager) NormalizeStackName(name string) string

func (*SwarmStackManager) Remove

func (manager *SwarmStackManager) Remove(stack *portainer.Stack, endpoint *portainer.Endpoint) error

Remove executes the docker stack rm command.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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