Documentation ¶
Index ¶
- Variables
- func EarliestPendingAutoTriggerTarget(targets []*store.ManifestTarget) *store.ManifestTarget
- func FindDeployOnlyK8sManifestTargets(targets []*store.ManifestTarget) []*store.ManifestTarget
- func FindLocalTargets(targets []*store.ManifestTarget) []*store.ManifestTarget
- func FindTargetsNeedingInitialBuild(targets []*store.ManifestTarget) []*store.ManifestTarget
- func FindUnresourcedYAML(targets []*store.ManifestTarget) *store.ManifestTarget
- func HoldK8sTargets(targets []*store.ManifestTarget, holds HoldSet)
- func HoldLiveUpdateTargetsWaitingOnDeploy(state store.EngineState, mts []*store.ManifestTarget, holds HoldSet)
- func HoldTargetsWaitingOnDependencies(state store.EngineState, mts []*store.ManifestTarget, holds HoldSet)
- func HoldTargetsWithBuildingComponents(mts []*store.ManifestTarget, holds HoldSet)
- func HoldUnparallelizableLocalTargets(targets []*store.ManifestTarget, holds map[model.ManifestName]store.Hold)
- func IsBuildingAnything(state store.EngineState) bool
- func IsBuildingUncategorizedYAML(state store.EngineState) bool
- func IsBuildingUnparallelizableLocalTarget(state store.EngineState) bool
- func IsDontFallBackError(err error) bool
- func IsFatalError(err error) bool
- func IsLiveUpdateTargetWaitingOnDeploy(state store.EngineState, mt *store.ManifestTarget) bool
- func LogBuildEntry(ctx context.Context, entry BuildEntry)
- func NextManifestNameToBuild(state store.EngineState) model.ManifestName
- func NextUnbuiltTargetToBuild(unbuilt []*store.ManifestTarget) *store.ManifestTarget
- func ShouldFallBackForErr(err error) bool
- func WrapDontFallBackError(err error) error
- type BuildCompleteAction
- type BuildEntry
- type BuildHandler
- type BuildStartedAction
- type DontFallBackError
- type HoldSet
- type RedirectToNextBuilder
- type ReuseRefChecker
- type TargetQueue
- type UpdateMode
- type UpdateModeFlag
Constants ¶
This section is empty.
Variables ¶
var AllUpdateModes = []UpdateMode{ UpdateModeAuto, UpdateModeImage, UpdateModeContainer, UpdateModeKubectlExec, }
Functions ¶
func EarliestPendingAutoTriggerTarget ¶
func EarliestPendingAutoTriggerTarget(targets []*store.ManifestTarget) *store.ManifestTarget
Go through all the manifests, and check: 1) all pending file changes 2) all pending dependency changes (where an image has been rebuilt by another manifest), and 3) 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 HoldK8sTargets ¶ added in v0.17.5
func HoldK8sTargets(targets []*store.ManifestTarget, holds HoldSet)
func HoldLiveUpdateTargetsWaitingOnDeploy ¶ added in v0.17.5
func HoldLiveUpdateTargetsWaitingOnDeploy(state store.EngineState, mts []*store.ManifestTarget, holds HoldSet)
func HoldTargetsWaitingOnDependencies ¶ added in v0.17.5
func HoldTargetsWaitingOnDependencies(state store.EngineState, mts []*store.ManifestTarget, holds HoldSet)
func HoldTargetsWithBuildingComponents ¶ added in v0.17.5
func HoldTargetsWithBuildingComponents(mts []*store.ManifestTarget, holds HoldSet)
func HoldUnparallelizableLocalTargets ¶ added in v0.17.5
func HoldUnparallelizableLocalTargets(targets []*store.ManifestTarget, holds map[model.ManifestName]store.Hold)
func IsBuildingAnything ¶ added in v0.14.0
func IsBuildingAnything(state store.EngineState) bool
func IsBuildingUncategorizedYAML ¶ added in v0.16.0
func IsBuildingUncategorizedYAML(state store.EngineState) bool
func IsBuildingUnparallelizableLocalTarget ¶ added in v0.17.2
func IsBuildingUnparallelizableLocalTarget(state store.EngineState) bool
func IsDontFallBackError ¶ added in v0.10.25
func IsFatalError ¶ added in v0.10.25
A permanent error indicates that the whole build pipeline needs to stop. It will never recover, even on subsequent rebuilds.
func IsLiveUpdateTargetWaitingOnDeploy ¶ added in v0.17.5
func IsLiveUpdateTargetWaitingOnDeploy(state store.EngineState, mt *store.ManifestTarget) bool
func LogBuildEntry ¶ added in v0.14.2
func LogBuildEntry(ctx context.Context, entry BuildEntry)
func NextManifestNameToBuild ¶
func NextManifestNameToBuild(state store.EngineState) model.ManifestName
func NextUnbuiltTargetToBuild ¶
func NextUnbuiltTargetToBuild(unbuilt []*store.ManifestTarget) *store.ManifestTarget
Helper function for ordering targets that have never been built before.
func ShouldFallBackForErr ¶ added in v0.10.25
func WrapDontFallBackError ¶ added in v0.10.25
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 BuildEntry ¶ added in v0.14.2
type BuildEntry interface { Name() model.ManifestName BuildReason() model.BuildReason FilesChanged() []string }
type BuildHandler ¶ added in v0.14.0
type BuildHandler func( target model.TargetSpec, 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 FullBuildTriggered bool }
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 HoldSet ¶ added in v0.17.5
type HoldSet map[model.ManifestName]store.Hold
func NextTargetToBuild ¶
func NextTargetToBuild(state store.EngineState) (*store.ManifestTarget, HoldSet)
Algorithm to choose a manifest to build next.
func (HoldSet) AddHold ¶ added in v0.17.5
func (s HoldSet) AddHold(target *store.ManifestTarget, hold store.Hold)
func (HoldSet) Fill ¶ added in v0.17.5
func (s HoldSet) Fill(targets []*store.ManifestTarget, hold store.Hold)
For all the targets that should have built and don't have a prior Hold, add the given Hold.
func (HoldSet) RemoveIneligibleTargets ¶ added in v0.17.5
func (s HoldSet) RemoveIneligibleTargets(targets []*store.ManifestTarget) []*store.ManifestTarget
type RedirectToNextBuilder ¶ added in v0.10.25
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.14.0
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 ReuseRefChecker ¶ added in v0.16.0
type ReuseRefChecker func(ctx context.Context, iTarget model.ImageTarget, namedTagged reference.NamedTagged) (bool, error)
type TargetQueue ¶ added in v0.14.0
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.14.0
func NewImageTargetQueue(ctx context.Context, iTargets []model.ImageTarget, state store.BuildStateSet, canReuseRef ReuseRefChecker) (*TargetQueue, error)
func (*TargetQueue) AllResults ¶ added in v0.14.1
func (q *TargetQueue) AllResults() store.BuildResultSet
All results for targets in the current queue.
func (*TargetQueue) CountBuilds ¶ added in v0.14.1
func (q *TargetQueue) CountBuilds() int
func (*TargetQueue) NewResults ¶ added in v0.14.1
func (q *TargetQueue) NewResults() store.BuildResultSet
New results that were built with the current queue. Omits results that were re-used previous builds.
Returns results that the BuildAndDeploy contract expects.
func (*TargetQueue) ReusedResults ¶ added in v0.14.1
func (q *TargetQueue) ReusedResults() store.BuildResultSet
Reused results that were not built with the current queue.
Used for printing out which builds are cached from previous builds.
func (*TargetQueue) RunBuilds ¶ added in v0.14.0
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" // 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.