container

package
v0.0.49 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2024 License: GPL-3.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const CHECKING = 0
View Source
const FAILED = 2
View Source
const SUCCESS = 1

Variables

This section is empty.

Functions

func GetAuth

func GetAuth(image string, environment *configuration.Environment) string

func IsDockerRunning added in v0.0.2

func IsDockerRunning()

func SolveReadiness added in v0.0.2

func SolveReadiness(client *client.Http, user *authentication.User, container *Container, logger *zap.Logger, readiness *Readiness, channel chan *ReadinessState) error

func UnpackSecretsEnvs added in v0.0.2

func UnpackSecretsEnvs(client *client.Http, user *authentication.User, envs []string) ([]string, error)

func UnpackSecretsReadiness added in v0.0.2

func UnpackSecretsReadiness(client *client.Http, user *authentication.User, body map[string]string) (map[string]string, error)

func UnpackSecretsResources added in v0.0.2

func UnpackSecretsResources(client *client.Http, user *authentication.User, resource string) (string, error)

Types

type ByDepenendecies

type ByDepenendecies []*Container

func (ByDepenendecies) Len

func (d ByDepenendecies) Len() int

func (ByDepenendecies) Less

func (d ByDepenendecies) Less(i, j int) bool

func (ByDepenendecies) Swap

func (d ByDepenendecies) Swap(i, j int)

type Container

type Container struct {
	Static  Static
	Runtime Runtime
	Exports Exports
	Status  status.Status
}

func Existing

func Existing(name string) *Container

func NewContainerFromDefinition

func NewContainerFromDefinition(config *configuration.Configuration, name string, definition v1.ContainerDefinition) (*Container, error)

func (*Container) AddNetworkInfoTS

func (container *Container) AddNetworkInfoTS(networkId string, ipAddress string, networkName string)

func (*Container) CheckIfImagePresent

func (container *Container) CheckIfImagePresent(ctx context.Context, cli *client.Client) bool

func (*Container) CopyFromContainer

func (container *Container) CopyFromContainer(pathContainer string, pathHost string) error

func (*Container) CopyToContainer

func (container *Container) CopyToContainer(reader io.Reader, pathContainer string) error

func (*Container) Delete

func (container *Container) Delete() error

func (*Container) Exec

func (container *Container) Exec(command []string) ExecResult

func (*Container) GenerateLabels

func (container *Container) GenerateLabels() map[string]string

func (*Container) Get

func (container *Container) Get() (*types.Container, error)

func (*Container) GetDockerAuth

func (container *Container) GetDockerAuth() types.ImagePullOptions

func (*Container) GetDomain

func (container *Container) GetDomain(networkName string) string

func (*Container) GetFromId

func (container *Container) GetFromId(runtimeId string) *types.Container

func (*Container) GetGroupIdentifier

func (container *Container) GetGroupIdentifier() string

func (*Container) GetHeadlessDomain

func (container *Container) GetHeadlessDomain(networkName string) string

func (*Container) GetNetwork

func (container *Container) GetNetwork() *network.NetworkingConfig

func (*Container) GetNetworkInfoTS

func (container *Container) GetNetworkInfoTS() *internal.Networks

func (*Container) HasDependencyOn

func (container *Container) HasDependencyOn(kind string, group string, identifier string) bool

func (*Container) Prepare

func (container *Container) Prepare(client *client.Http, user *authentication.User) error

func (*Container) PrepareConfiguration added in v0.0.2

func (container *Container) PrepareConfiguration(client *client.Http, user *authentication.User) error

func (*Container) PrepareEnvs added in v0.0.2

func (container *Container) PrepareEnvs()

func (*Container) PrepareLabels added in v0.0.2

func (container *Container) PrepareLabels()

func (*Container) PrepareNetwork added in v0.0.2

func (container *Container) PrepareNetwork(client *client.Http, user *authentication.User) error

func (*Container) PrepareReadiness added in v0.0.2

func (container *Container) PrepareReadiness()

func (*Container) PrepareResources added in v0.0.2

func (container *Container) PrepareResources(client *client.Http, user *authentication.User) error

func (*Container) PullImage

func (container *Container) PullImage(ctx context.Context, cli *client.Client) error

func (*Container) Ready

func (container *Container) Ready(client *client.Http, user *authentication.User, channel chan *ReadinessState, logger *zap.Logger) (bool, error)

func (*Container) Rename

func (container *Container) Rename(newName string) error

func (*Container) Restart

func (container *Container) Restart() bool

func (*Container) Run

func (container *Container) Run(environment *configuration.Environment, client *client.Http, dnsCache *dns.Records, user *authentication.User) (*types.Container, error)

func (*Container) SetOwner

func (container *Container) SetOwner(owner string)

func (*Container) SolveAgentNetworking added in v0.0.41

func (container *Container) SolveAgentNetworking() error

func (*Container) Start

func (container *Container) Start() bool

func (*Container) Stop

func (container *Container) Stop() bool

func (*Container) UpdateDns added in v0.0.2

func (container *Container) UpdateDns(dnsCache *dns.Records)

type Dependency added in v0.0.2

type Dependency struct {
	Name     string
	Timeout  string
	Ctx      context.Context
	Function func() error
	Cancel   context.CancelFunc
}

type DependencyState added in v0.0.2

type DependencyState struct {
	State int8
}

type ExecResult

type ExecResult struct {
	Stdout string
	Stderr string
	Exit   int
}

type Exports

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

type Network

type Network struct {
	NetworkId   string
	NetworkName string
	IP          string
}

type Owner

type Owner struct {
	Kind            string
	GroupIdentifier string
}

type Port added in v0.0.28

type Port struct {
	Container string
	Host      string
}

type Readiness

type Readiness struct {
	Name       string
	Operator   string
	Timeout    string
	Body       map[string]string
	Solved     bool
	BodyUnpack map[string]string  `json:"-"`
	Function   func() error       `json:"-"`
	Ctx        context.Context    `json:"-"`
	Cancel     context.CancelFunc `json:"-"`
}

func NewReadinessFromDefinition added in v0.0.2

func NewReadinessFromDefinition(client *client.Http, user *authentication.User, container *Container, readiness v1.ContainerReadiness) (*Readiness, error)

type ReadinessResult

type ReadinessResult struct {
	Data string
}

type ReadinessState

type ReadinessState struct {
	State int8
}

type Resource

type Resource struct {
	Group      string
	Name       string
	Key        string
	Data       map[string]string
	MountPoint string
}

type Result added in v0.0.2

type Result struct {
	Data string
}

type Runtime

type Runtime struct {
	Auth               string
	Id                 string
	Networks           *internal.Networks
	NetworkLock        sync.RWMutex
	State              string
	FoundRunning       bool
	FirstObserved      bool
	Ready              bool
	Configuration      map[string]string
	Owner              Owner
	ObjectDependencies []*f.Format
}

type Static

type Static struct {
	Name                   string
	GeneratedName          string
	GeneratedNameNoProject string
	Labels                 map[string]string
	Group                  string
	Image                  string
	Tag                    string
	Replicas               int
	Env                    []string
	Entrypoint             []string
	Args                   []string
	Privileged             bool
	NetworkMode            string
	Networks               *internal.Networks
	Ports                  *internal.Ports
	Volumes                *internal.Volumes
	Readiness              *internal.Readinesses
	Resources              *internal.Resources
	Capabilities           []string
	Definition             v1.ContainerDefinition
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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