liveupdates

package
v0.23.2 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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 ContainerDisplayNames added in v0.23.0

func ContainerDisplayNames(containers []Container) []string

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 HandleLiveUpdateDeleteAction added in v0.22.14

func HandleLiveUpdateDeleteAction(state *store.EngineState, action LiveUpdateDeleteAction)

func HandleLiveUpdateUpsertAction added in v0.22.14

func HandleLiveUpdateUpsertAction(state *store.EngineState, action LiveUpdateUpsertAction)

func IDsForContainers

func IDsForContainers(infos []Container) []container.ID

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.)

func (Container) DisplayName added in v0.23.0

func (c Container) DisplayName() string

func (Container) Empty

func (c Container) Empty() bool

type LiveUpdateDeleteAction added in v0.22.14

type LiveUpdateDeleteAction struct {
	Name string
}

func NewLiveUpdateDeleteAction added in v0.22.14

func NewLiveUpdateDeleteAction(n string) LiveUpdateDeleteAction

func (LiveUpdateDeleteAction) Action added in v0.22.14

func (LiveUpdateDeleteAction) Action()

type LiveUpdatePlan added in v0.22.14

type LiveUpdatePlan struct {
	// SyncPaths are changed (local) paths and their corresponding container paths to be synced.
	SyncPaths []build.PathMapping
	// NoMatchPaths are changed (local) paths that do not match any Live Update rules.
	NoMatchPaths []string
	// StopPaths are changed (local) paths that should halt Live Update and result in a full rebuild.
	//
	// These are often referred to as "fallback" paths, particularly in the Tiltfile API.
	StopPaths []string
}

LiveUpdatePlan is the result of evaluating a list of changed files against the rules in the spec.

TODO(milas): we should probably canonicalize all the local paths here using .spec.basePath

func NewLiveUpdatePlan added in v0.22.14

func NewLiveUpdatePlan(luSpec v1alpha1.LiveUpdateSpec, filesChanged []string) (LiveUpdatePlan, error)

NewLiveUpdatePlan evaluates a set of changed files against a LiveUpdateSpec.

type LiveUpdateUpsertAction added in v0.22.14

type LiveUpdateUpsertAction struct {
	LiveUpdate *v1alpha1.LiveUpdate
}

func NewLiveUpdateUpsertAction added in v0.22.14

func NewLiveUpdateUpsertAction(obj *v1alpha1.LiveUpdate) LiveUpdateUpsertAction

func (LiveUpdateUpsertAction) Action added in v0.22.14

func (LiveUpdateUpsertAction) Action()

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.

Jump to

Keyboard shortcuts

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