utils

package
v0.0.0-...-d99d806 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2022 License: Apache-2.0 Imports: 34 Imported by: 1

Documentation

Overview

traefik functions related to deployment

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckContainer

func CheckContainer(_, containerName string) (string, error)

func CopyToContainer

func CopyToContainer(ctx context.Context, name string, meta v1.UploadFileData, fileHeader *multipart.FileHeader) error

func CreateNetwork

func CreateNetwork(ctx context.Context, name, driver string) error

func DeleteContainer

func DeleteContainer(containerName string) error

func DeleteContainerByName

func DeleteContainerByName(ctx context.Context, preName, name string) error

func DeployImage

func DeployImage(ctx context.Context,
	dog *dogger.DeploymentLogger,
	deployImageRequest *v1.DeployImageRequest,
	versionData *v1.VersionData) error

func DraftRelease

func DraftRelease(instance string, versionData v1.VersionData, deployResponse v1.DeployVersionResponse, cfg *config.Configuration)

DraftRelease writes release information to disk Into the instance folder @release directory, file with a release name yml extension the file containing release data

func EnvMapToSlice

func EnvMapToSlice(envs map[string]string) []string

EnvMapToSlice converts key:value map into ["key=value"] array

func EnvPipeSeparatedToStringMap

func EnvPipeSeparatedToStringMap(envIn *[]string) map[string]string

TODO(nandor-magyar): refactor this into unmarshalling `[]"VARIABLE|value"` pair mapped into a string keyed map, collision is ignored, the latter value is used

func ExecTraefik

func ExecTraefik(ctx context.Context, traefikDeployReq model.TraefikDeployRequest, cfg *config.Configuration) error

func ExecWatchtowerOneShot

func ExecWatchtowerOneShot(ctx context.Context, cfg *config.Configuration) error

func ExecWatchtowerPoll

func ExecWatchtowerPoll(ctx context.Context, cfg *config.Configuration) error

func FilterContainerByName

func FilterContainerByName(containers []types.Container, name string) (ret []types.Container)

func GetContainer

func GetContainer(name string) []types.Container

func GetContainerLogs

func GetContainerLogs(name string, skip, take uint) []string

func GetContainersByName

func GetContainersByName(name string) []types.Container

func GetContainersByNameCrux

func GetContainersByNameCrux(ctx context.Context, name string) []*common.ContainerStateItem

func GetImageLabels

func GetImageLabels(fullyQualifiedImageName string) (map[string]string, error)

func GetNetworks

func GetNetworks() ([]types.NetworkResource, error)

func GetOrganizationLabel

func GetOrganizationLabel(labels map[string]string, key string) (string, bool)

func GetServiceName

func GetServiceName(instanceConfig *v1.InstanceConfig, containerConfig *v1.ContainerConfig, cfg *config.Configuration) string

serviceName container-name.container-pre-name.ingress.host is default

func GetTraefikGoTemplate

func GetTraefikGoTemplate() string

keeping the template like this solves builds/asset management issues dev environment <-> containerization differences TODO(nandor-magyar): solve assets' relative directory issues

func GetTraefikLabels

func GetTraefikLabels(instanceConfig *v1.InstanceConfig, containerConfig *v1.ContainerConfig, cfg *config.Configuration) map[string]string

generating container labels for traefik if Expose is provided we bind 80 and the given ingressName + ingressHost

func InspectContainer

func InspectContainer(name string) types.ContainerJSON

func ListContainers

func ListContainers() ([]types.Container, error)

func MergeStringMapToUniqueSlice

func MergeStringMapToUniqueSlice(src, dest map[string]string) []string

Merging map `a` to map `b`. Keys in map `b` has precedence, if key occurs in both.

func MergeStringMapUnique

func MergeStringMapUnique(src, dest map[string]string) map[string]string

func PreflightChecks

func PreflightChecks(cfg *config.Configuration)

func ReadDockerLogsFromReadCloser

func ReadDockerLogsFromReadCloser(logs io.ReadCloser, skip, take int) []string

func SecretList

func SecretList(ctx context.Context, prefix, name string) ([]string, error)

func SetOrganizationLabel

func SetOrganizationLabel(key, value string) (map[string]string, error)

generating dyrector.io specific labels for containers org.dyrectorio is our official label prefix

func WriteContainerFile

func WriteContainerFile(ctx context.Context, cli *client.Client,
	container, filename string, meta v1.UploadFileData, fileSize int64, data io.Reader) error

Types

type DockerVersion

type DockerVersion struct {
	ServerVersion string
	ClientVersion string
}

func GetServerInformation

func GetServerInformation() (DockerVersion, error)

type ReleaseContainer

type ReleaseContainer struct {
	Image      string
	Tag        string
	Successful bool
}

type ReleaseDoc

type ReleaseDoc struct {
	Version      string
	ReleaseNotes string
	Date         time.Time
	Containers   []ReleaseContainer
}

func GetVersions

func GetVersions(instance string, cfg *config.Configuration) ([]ReleaseDoc, error)

Jump to

Keyboard shortcuts

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