Documentation
¶
Index ¶
- Variables
- func CheckForContainerCrash(state *store.EngineState, name string)
- func FakeKubernetesDiscovery(image string, containers []Container) *v1alpha1.KubernetesDiscovery
- func FakeKubernetesResource(image string, containers []Container) *k8sconv.KubernetesResource
- func IDsForContainers(infos []Container) []container.ID
- func WithFakeDCContainer(s store.BuildState, container Container) store.BuildState
- func WithFakeK8sContainers(s store.BuildState, imageName string, containers []Container) store.BuildState
- type Container
- func AllRunningContainers(mt *store.ManifestTarget, state *store.EngineState) []Container
- func RunningContainers(selector *v1alpha1.LiveUpdateKubernetesSelector, ...) ([]Container, error)
- func RunningContainersForDC(dr *dcconv.DockerResource) []Container
- func RunningContainersForOnePod(selector *v1alpha1.LiveUpdateKubernetesSelector, ...) ([]Container, error)
- type UpdateMode
- type UpdateModeFlag
Constants ¶
This section is empty.
Variables ¶
View Source
var AllUpdateModes = []UpdateMode{ UpdateModeAuto, UpdateModeImage, UpdateModeContainer, UpdateModeKubectlExec, }
Functions ¶
func CheckForContainerCrash ¶
func CheckForContainerCrash(state *store.EngineState, name string)
If a container crashes, and it's been live-updated in the past, then it needs to enter a special state to indicate that it needs to be rebuilt (because the file system has been reset to the original image).
Eventually, this will be represented by a special state on the LiveUpdateStatus.
func FakeKubernetesDiscovery ¶
func FakeKubernetesDiscovery(image string, containers []Container) *v1alpha1.KubernetesDiscovery
Given the set of containers we want, create a fake KubernetesDiscovery with those containers running.
func FakeKubernetesResource ¶
func FakeKubernetesResource(image string, containers []Container) *k8sconv.KubernetesResource
func IDsForContainers ¶
func WithFakeDCContainer ¶
func WithFakeDCContainer(s store.BuildState, container Container) store.BuildState
func WithFakeK8sContainers ¶
func WithFakeK8sContainers(s store.BuildState, imageName string, containers []Container) store.BuildState
Types ¶
type Container ¶
type Container struct {
PodID k8s.PodID
ContainerID container.ID
ContainerName container.Name
Namespace k8s.Namespace
}
Information describing a single running & ready container
func AllRunningContainers ¶
func AllRunningContainers(mt *store.ManifestTarget, state *store.EngineState) []Container
func RunningContainers ¶
func RunningContainers(selector *v1alpha1.LiveUpdateKubernetesSelector, k8sResource *k8sconv.KubernetesResource, dResource *dcconv.DockerResource) ([]Container, error)
func RunningContainersForDC ¶
func RunningContainersForDC(dr *dcconv.DockerResource) []Container
func RunningContainersForOnePod ¶
func RunningContainersForOnePod(selector *v1alpha1.LiveUpdateKubernetesSelector, resource *k8sconv.KubernetesResource) ([]Container, error)
If all containers running the given image are ready, returns info for them. (If this image is running on multiple pods, return an error.)
type UpdateMode ¶
type UpdateMode string
var ( // Auto-pick the build mode based on UpdateModeAuto UpdateMode = "auto" // Only do image builds UpdateModeImage UpdateMode = "image" // Update containers in-place. This mode only works with DockerForDesktop and Minikube. // If you try to use this mode with a different K8s cluster type, we will return an error UpdateModeContainer UpdateMode = "container" // Use `kubectl exec` UpdateModeKubectlExec UpdateMode = "exec" )
func ProvideUpdateMode ¶
func ProvideUpdateMode(flag UpdateModeFlag, kubeContext k8s.KubeContext, env docker.ClusterEnv) (UpdateMode, error)
type UpdateModeFlag ¶
type UpdateModeFlag UpdateMode
A type to bind to flag values that need validation.
Click to show internal directories.
Click to hide internal directories.