pod

package
v0.0.0-...-44ee509 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2018 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OUTPUT_DELIMITER        = ","
	PORT_SEPARATOR          = ":"
	PRIM_INSPECT_RESULT_LEN = 7
	INSPECT_RESULT_LEN      = 6
)

Variables

View Source
var ComposeExecutorDriver executor.ExecutorDriver
View Source
var ComposeFiles []string
View Source
var ComposeTaskInfo *mesos.TaskInfo
View Source
var CurPodStatus = &Status{
	Status: types.POD_STAGING,
}
View Source
var HealthCheckListId = make(map[string]bool)
View Source
var IsPodLaunched = false
View Source
var MonitorContainerList []string
View Source
var PluginOrder []string
View Source
var SinglePort bool

Functions

func CheckContainer

func CheckContainer(containerId string, healthCheck bool) (types.HealthStatus, bool, int, error)

CheckContainer does check container details return healthy,run,err

func CheckPodExitCode

func CheckPodExitCode(files []string) (int, error)

Check exit code of all the containers in the pod. If all the exit codes are zero, then assign zero as pod's exit code, otherwise assign the first non zero exit code to pod

func DockerDump

func DockerDump()

DockerDump does dump docker.pid and docker-containerd.pid and docker log if docker dump is enabled in config

func ForceKill

func ForceKill(files []string) error

Force kill pod docker kill -f

func GenerateCmdParts

func GenerateCmdParts(files []string, cmd string) ([]string, error)

Generate cmd parts docker-compose parts example : docker-compose -f compose.yaml up "docker-compose" will be the main cmd, "-f compose.yaml up" will be parts and return as an array

func GetAndRemoveLabel

func GetAndRemoveLabel(key string, taskInfo *mesos.TaskInfo) string

GetAndRemoveLabel will fetch the value for the key and removes it from the list

func GetContainerIdByService

func GetContainerIdByService(files []string, service string) (string, error)

GetContainerIdByService does query container id by service name

func GetContainerIdsByServices

func GetContainerIdsByServices(files, services []string) ([]string, error)

GetContainerIdsByServices get container ids by a list of services

func GetContainerNetwork

func GetContainerNetwork(id string) (string, error)

func GetDockerPorts

func GetDockerPorts(containerId string, privatePort string) (string, error)

func GetLabel

func GetLabel(key string, taskInfo *mesos.TaskInfo) string

get label by name

func GetPodContainerIds

func GetPodContainerIds(files []string) ([]string, error)

Get set of containers id in pod docker-compose -f docker-compose.yaml ps -q

func GetPodDetail

func GetPodDetail(files []string, primaryContainerId string, healthcheck bool)

docker-compose -f docker-compose.yaml ps

func GetPodStatus

func GetPodStatus() types.PodStatus

Read pod status

func GetPorts

func GetPorts(taskInfo *mesos.TaskInfo) *list.Element

Get port range assigned by mesos

func HealthCheck

func HealthCheck(files []string, podServices map[string]bool, out chan<- string)

healthCheck includes health checking for primary container and exit code checking for other containers

func InspectContainerDetails

func InspectContainerDetails(containerId string, healthcheck bool) (types.ContainerStatusDetails, error)

docker inspect

func IsService

func IsService(taskInfo *mesos.TaskInfo) bool

func KillContainer

func KillContainer(sig string, containerId string) error

func LaunchPod

func LaunchPod(files []string) types.PodStatus

Launch pod docker-compose up

func ParseToContainerDetail

func ParseToContainerDetail(output string, healthcheck bool) (types.ContainerStatusDetails, error)

func PullImage

func PullImage(files []string) error

pull image docker-compose pull

func RemoveNetwork

func RemoveNetwork(name string) error

func RemovePodImage

func RemovePodImage(files []string) error

remove pod images docker-compose down --rmi

func RemovePodVolume

func RemovePodVolume(files []string) error

remove pod volume docker-compose down -v

func SendMesosStatus

func SendMesosStatus(driver executor.ExecutorDriver, taskId *mesos.TaskID, state *mesos.TaskState) error

Update mesos and pod status

func SendPodStatus

func SendPodStatus(status types.PodStatus)

func SetPodStatus

func SetPodStatus(status types.PodStatus)

Set pod status

func StopPod

func StopPod(files []string) error

Stop pod docker-compose stop

func WaitOnPod

func WaitOnPod(ctx *context.Context)

Wait for pod running/finished until timeout or failed

Types

type Status

type Status struct {
	sync.RWMutex
	Status types.PodStatus
}

Jump to

Keyboard shortcuts

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