buildcontrol

package
v0.13.6 Latest Latest
Warning

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

Go to latest
Published: May 14, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func EarliestPendingAutoTriggerTarget

func EarliestPendingAutoTriggerTarget(targets []*store.ManifestTarget) *store.ManifestTarget

Go through all the manifests, and check: 1) all pending file changes, and 2) all pending manifest changes The earliest one is the one we want.

If no targets are pending, return nil

func FindDeployOnlyK8sManifestTargets

func FindDeployOnlyK8sManifestTargets(targets []*store.ManifestTarget) []*store.ManifestTarget

func FindLocalTargets

func FindLocalTargets(targets []*store.ManifestTarget) []*store.ManifestTarget

func FindTargetsNeedingInitialBuild added in v0.10.18

func FindTargetsNeedingInitialBuild(targets []*store.ManifestTarget) []*store.ManifestTarget

func FindUnresourcedYAML

func FindUnresourcedYAML(targets []*store.ManifestTarget) *store.ManifestTarget

func IsBuildingAnything added in v0.11.4

func IsBuildingAnything(state store.EngineState) bool

func IsBuildingLocalTarget added in v0.11.4

func IsBuildingLocalTarget(state store.EngineState) bool

func IsDontFallBackError added in v0.10.25

func IsDontFallBackError(err error) bool

func IsFatalError added in v0.10.25

func IsFatalError(err error) bool

A permanent error indicates that the whole build pipeline needs to stop. It will never recover, even on subsequent rebuilds.

func NextManifestNameToBuild

func NextManifestNameToBuild(state store.EngineState) model.ManifestName

func NextTargetToBuild

func NextTargetToBuild(state store.EngineState) *store.ManifestTarget

Algorithm to choose a manifest to build next.

func NextUnbuiltTargetToBuild

func NextUnbuiltTargetToBuild(unbuilt []*store.ManifestTarget) *store.ManifestTarget

Helper function for ordering targets that have never been built before.

func RemoveLocalTargets added in v0.11.4

func RemoveLocalTargets(targets []*store.ManifestTarget) []*store.ManifestTarget

func RemoveTargetsWaitingOnDependencies added in v0.10.15

func RemoveTargetsWaitingOnDependencies(state store.EngineState, mts []*store.ManifestTarget) []*store.ManifestTarget

func RemoveTargetsWithBuildingComponents added in v0.12.5

func RemoveTargetsWithBuildingComponents(mts []*store.ManifestTarget) []*store.ManifestTarget

func ShouldFallBackForErr added in v0.10.25

func ShouldFallBackForErr(err error) bool

func WrapDontFallBackError added in v0.10.25

func WrapDontFallBackError(err error) error

Types

type BuildCompleteAction added in v0.10.25

type BuildCompleteAction struct {
	ManifestName model.ManifestName
	SpanID       logstore.SpanID
	Result       store.BuildResultSet
	FinishTime   time.Time
	Error        error
}

func NewBuildCompleteAction added in v0.10.25

func NewBuildCompleteAction(mn model.ManifestName, spanID logstore.SpanID, result store.BuildResultSet, err error) BuildCompleteAction

func (BuildCompleteAction) Action added in v0.10.25

func (BuildCompleteAction) Action()

type BuildHandler added in v0.11.2

type BuildHandler func(
	target model.TargetSpec,
	state store.BuildState,
	depResults []store.BuildResult) (store.BuildResult, error)

Allows the caller to inject its own build strategy for dirty targets.

type BuildStartedAction added in v0.10.25

type BuildStartedAction struct {
	ManifestName model.ManifestName
	StartTime    time.Time
	FilesChanged []string
	Reason       model.BuildReason
	SpanID       logstore.SpanID
}

func (BuildStartedAction) Action added in v0.10.25

func (BuildStartedAction) Action()

type DontFallBackError added in v0.10.25

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

Something is wrong enough that we shouldn't bother falling back to other BaD's -- they won't work.

func DontFallBackErrorf added in v0.10.25

func DontFallBackErrorf(msg string, a ...interface{}) DontFallBackError

type ImageExistsChecker added in v0.11.2

type ImageExistsChecker func(ctx context.Context, namedTagged reference.NamedTagged) (bool, error)

type RedirectToNextBuilder added in v0.10.25

type RedirectToNextBuilder struct {
	Level logger.Level
	// contains filtered or unexported fields
}

Nothing is on fire, this is an expected case like a container builder being passed a build with no attached container. `level` indicates at what log level this error should be shown to the user

func RedirectToNextBuilderInfof added in v0.10.25

func RedirectToNextBuilderInfof(msg string, a ...interface{}) RedirectToNextBuilder

func SilentRedirectToNextBuilderf added in v0.10.25

func SilentRedirectToNextBuilderf(msg string, a ...interface{}) RedirectToNextBuilder

func WrapRedirectToNextBuilder added in v0.10.25

func WrapRedirectToNextBuilder(err error, level logger.Level) RedirectToNextBuilder

func (RedirectToNextBuilder) UserFacing added in v0.12.2

func (redir RedirectToNextBuilder) UserFacing() bool

UserFacing indicates whether this error should be messaged to the user by default. Should be `true` for messages we always want the user to read, e.g. "couldn't Live Update because we matched a fall_back_on file".

type TargetQueue added in v0.11.2

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

A little data structure to help iterate through dirty targets in dependency order.

func NewImageTargetQueue added in v0.11.2

func NewImageTargetQueue(ctx context.Context, iTargets []model.ImageTarget, state store.BuildStateSet, imageExists ImageExistsChecker) (*TargetQueue, error)

func (*TargetQueue) CountDirty added in v0.11.2

func (q *TargetQueue) CountDirty() int

func (*TargetQueue) Results added in v0.11.2

func (q *TargetQueue) Results() store.BuildResultSet

func (*TargetQueue) RunBuilds added in v0.11.2

func (q *TargetQueue) RunBuilds(handler BuildHandler) error

type UpdateMode added in v0.10.25

type UpdateMode string
var (
	// Auto-pick the build mode based on
	UpdateModeAuto UpdateMode = "auto"

	// Only do image builds
	UpdateModeImage UpdateMode = "image"

	// Only do image builds from scratch
	UpdateModeNaive UpdateMode = "naive"

	// Deploy a synclet to make container updates faster
	UpdateModeSynclet UpdateMode = "synclet"

	// 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 added in v0.10.25

func ProvideUpdateMode(flag UpdateModeFlag, env k8s.Env, runtime container.Runtime) (UpdateMode, error)

type UpdateModeFlag added in v0.10.25

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