Documentation

Index

Constants

View Source
const (
	DockerRegistryURL = "docker.io"
	// RestartTimeout in seconds
	RestartTimeout = 5
	// StopTimeout in seconds
	StopTimeout = 5
)

Variables

View Source
var K8sDockerVersions = map[string][]string{
	"1.8":  {"1.11.x", "1.12.x", "1.13.x", "17.03.x"},
	"1.9":  {"1.11.x", "1.12.x", "1.13.x", "17.03.x", "18.06.x", "18.09.x", "19.03.x"},
	"1.10": {"1.11.x", "1.12.x", "1.13.x", "17.03.x", "18.06.x", "18.09.x", "19.03.x"},
	"1.11": {"1.11.x", "1.12.x", "1.13.x", "17.03.x", "18.06.x", "18.09.x", "19.03.x"},
	"1.12": {"1.11.x", "1.12.x", "1.13.x", "17.03.x", "17.06.x", "17.09.x", "18.06.x", "18.09.x", "19.03.x"},
	"1.13": {"1.11.x", "1.12.x", "1.13.x", "17.03.x", "17.06.x", "17.09.x", "18.06.x", "18.09.x", "19.03.x"},
	"1.14": {"1.13.x", "17.03.x", "17.06.x", "17.09.x", "18.06.x", "18.09.x", "19.03.x"},
	"1.15": {"1.13.x", "17.03.x", "17.06.x", "17.09.x", "18.06.x", "18.09.x", "19.03.x"},
}

Functions

func CreateContainer

func CreateContainer(ctx context.Context, dClient *client.Client, hostname string, containerName string, imageCfg *container.Config, hostCfg *container.HostConfig) (container.ContainerCreateCreatedBody, error)

func DoRemoveContainer

func DoRemoveContainer(ctx context.Context, dClient *client.Client, containerName, hostname string) error

func DoRestartContainer

func DoRestartContainer(ctx context.Context, dClient *client.Client, containerName, hostname string) error

func DoRollingUpdateContainer

func DoRollingUpdateContainer(ctx context.Context, dClient *client.Client, imageCfg *container.Config, hostCfg *container.HostConfig, containerName, hostname, plane string, prsMap map[string]v3.PrivateRegistry) error

func DoRunContainer

func DoRunContainer(ctx context.Context, dClient *client.Client, imageCfg *container.Config, hostCfg *container.HostConfig, containerName string, hostname string, plane string, prsMap map[string]v3.PrivateRegistry) error

func DoRunOnetimeContainer

func DoRunOnetimeContainer(ctx context.Context, dClient *client.Client, imageCfg *container.Config, hostCfg *container.HostConfig, containerName string, hostname string, plane string, prsMap map[string]v3.PrivateRegistry) error

func GetContainerLogsStdoutStderr

func GetContainerLogsStdoutStderr(ctx context.Context, dClient *client.Client, containerName, tail string, follow bool) (string, string, error)

func GetContainerOutput

func GetContainerOutput(ctx context.Context, dClient *client.Client, containerName, hostname string) (int64, string, string, error)

func GetImageRegistryConfig

func GetImageRegistryConfig(image string, prsMap map[string]v3.PrivateRegistry) (string, string, error)

func GetKubeletDockerConfig

func GetKubeletDockerConfig(prsMap map[string]v3.PrivateRegistry) (string, error)

func InspectContainer

func InspectContainer(ctx context.Context, dClient *client.Client, hostname string, containerName string) (types.ContainerJSON, error)

func IsContainerRunning

func IsContainerRunning(ctx context.Context, dClient *client.Client, hostname string, containerName string, all bool) (bool, error)

func IsContainerUpgradable

func IsContainerUpgradable(ctx context.Context, dClient *client.Client, imageCfg *container.Config, hostCfg *container.HostConfig, containerName string, hostname string, plane string) (bool, error)

func IsSupportedDockerVersion

func IsSupportedDockerVersion(info types.Info, K8sVersion string) (bool, error)

func ReadContainerLogs

func ReadContainerLogs(ctx context.Context, dClient *client.Client, containerName string, follow bool, tail string) (io.ReadCloser, error)

func ReadFileFromContainer

func ReadFileFromContainer(ctx context.Context, dClient *client.Client, hostname, container, filePath string) (string, error)

func RemoveContainer

func RemoveContainer(ctx context.Context, dClient *client.Client, hostname string, containerName string) error

func RenameContainer

func RenameContainer(ctx context.Context, dClient *client.Client, hostname string, oldContainerName string, newContainerName string) error

func RestartContainer

func RestartContainer(ctx context.Context, dClient *client.Client, hostname, containerName string) error

func StartContainer

func StartContainer(ctx context.Context, dClient *client.Client, hostname string, containerName string) error

func StopContainer

func StopContainer(ctx context.Context, dClient *client.Client, hostname string, containerName string) error

func StopRenameContainer

func StopRenameContainer(ctx context.Context, dClient *client.Client, hostname string, oldContainerName string, newContainerName string) error

func UseLocalOrPull

func UseLocalOrPull(ctx context.Context, dClient *client.Client, hostname string, containerImage string, plane string, prsMap map[string]v3.PrivateRegistry) error

func WaitForContainer

func WaitForContainer(ctx context.Context, dClient *client.Client, hostname string, containerName string) (int64, error)

Types

This section is empty.

Source Files