Documentation ¶
Index ¶
- Constants
- Variables
- func IsDontFallBackError(err error) bool
- func NewErrorAction(err error) store.ErrorAction
- func NewImageAndCacheBuilder(ib build.ImageBuilder, cb build.CacheBuilder, custb build.CustomBuilder, ...) *imageAndCacheBuilder
- func ParseYAMLFromManifests(manifests ...model.Manifest) ([]k8s.K8sEntity, error)
- func ProvideSubscribers(hud hud.HeadsUpDisplay, pw *k8swatch.PodWatcher, sw *k8swatch.ServiceWatcher, ...) []store.Subscriber
- func ProvideTimerMaker() timerMaker
- func WrapDontFallBackError(err error) error
- type BuildAndDeployer
- type BuildCompleteAction
- type BuildController
- type BuildHandler
- type BuildLogAction
- type BuildLogActionWriter
- type BuildOrder
- type BuildStartedAction
- type CompositeBuildAndDeployer
- type DockerComposeBuildAndDeployer
- type DockerComposeEventAction
- type DockerComposeEventWatcher
- type DontFallBackError
- type FallbackTester
- type FsWatcherMaker
- type GithubClientFactory
- type HudStoppedAction
- type ImageBuildAndDeployer
- type ImageExistsChecker
- type InitAction
- type KINDPusher
- type LatestVersionAction
- type LiveUpdateBuildAndDeployer
- type LocalTargetBuildAndDeployer
- type ManifestReloadedAction
- type PodWatcherMaker
- type PortForwardController
- type ProfilerManager
- type RedirectToNextBuilder
- type ServiceWatcherMaker
- type TargetQueue
- type TiltVersionChecker
- type UIDUpdateAction
- type UpdateMode
- type UpdateModeFlag
- type Upper
- type WatchManager
- type WatchableTarget
Constants ¶
const DetectedOverflowErrMsg = `` /* 194-byte string literal not displayed */
Variables ¶
var AllUpdateModes = []UpdateMode{ UpdateModeAuto, UpdateModeImage, UpdateModeNaive, UpdateModeSynclet, UpdateModeContainer, UpdateModeKubectlExec, }
var ConfigsTargetID = model.TargetID{ Type: model.TargetTypeConfigs, Name: "singleton", }
var DeployerBaseWireSet = wire.NewSet(wire.Value(dockerfile.Labels{}), wire.Value(UpperReducer), sidecar.WireSet, minikube.ProvideMinikubeClient, build.DefaultImageBuilder, build.NewCacheBuilder, build.NewDockerImageBuilder, build.NewExecCustomBuilder, wire.Bind(new(build.CustomBuilder), new(*build.ExecCustomBuilder)), NewLocalTargetBuildAndDeployer, NewImageBuildAndDeployer, containerupdate.NewDockerContainerUpdater, containerupdate.NewSyncletUpdater, containerupdate.NewExecUpdater, NewLiveUpdateBuildAndDeployer, NewDockerComposeBuildAndDeployer, NewImageAndCacheBuilder, DefaultBuildOrder, wire.Bind(new(BuildAndDeployer), new(*CompositeBuildAndDeployer)), NewCompositeBuildAndDeployer, ProvideUpdateMode, )
var DeployerWireSet = wire.NewSet( DeployerBaseWireSet, containerupdate.NewSyncletManager, )
var DeployerWireSetTest = wire.NewSet( DeployerBaseWireSet, containerupdate.NewSyncletManagerForTests, synclet.FakeGRPCWrapper, )
var UpperReducer = store.Reducer(upperReducerFn)
Functions ¶
func IsDontFallBackError ¶ added in v0.10.0
func NewErrorAction ¶
func NewErrorAction(err error) store.ErrorAction
func NewImageAndCacheBuilder ¶ added in v0.6.0
func NewImageAndCacheBuilder(ib build.ImageBuilder, cb build.CacheBuilder, custb build.CustomBuilder, updateMode UpdateMode) *imageAndCacheBuilder
func ParseYAMLFromManifests ¶
func ProvideSubscribers ¶ added in v0.8.0
func ProvideSubscribers( hud hud.HeadsUpDisplay, pw *k8swatch.PodWatcher, sw *k8swatch.ServiceWatcher, plm *runtimelog.PodLogManager, pfc *PortForwardController, fwm *WatchManager, bc *BuildController, cc *configs.ConfigsController, dcw *DockerComposeEventWatcher, dclm *runtimelog.DockerComposeLogManager, pm *ProfilerManager, sm containerupdate.SyncletManager, ar *analytics.AnalyticsReporter, hudsc *server.HeadsUpServerController, tvc *TiltVersionChecker, au *analytics.AnalyticsUpdater, ewm *k8swatch.EventWatchManager, tcum *cloud.CloudUsernameManager, cuu *cloud.UpdateUploader, dp *dockerprune.DockerPruner) []store.Subscriber
func ProvideTimerMaker ¶
func ProvideTimerMaker() timerMaker
func WrapDontFallBackError ¶ added in v0.2.0
Types ¶
type BuildAndDeployer ¶
type BuildAndDeployer interface { // BuildAndDeploy builds and deployed the specified target specs. // // Returns a BuildResult that expresses the outputs(s) of the build. // // BuildResult can be used to construct a set of BuildStates, which contain // the last successful builds of each target and the files changed since that build. BuildAndDeploy(ctx context.Context, st store.RStore, specs []model.TargetSpec, currentState store.BuildStateSet) (store.BuildResultSet, error) }
type BuildCompleteAction ¶
type BuildCompleteAction struct { Result store.BuildResultSet Error error }
func NewBuildCompleteAction ¶
func NewBuildCompleteAction(result store.BuildResultSet, err error) BuildCompleteAction
func (BuildCompleteAction) Action ¶
func (BuildCompleteAction) Action()
type BuildController ¶
type BuildController struct {
// contains filtered or unexported fields
}
func NewBuildController ¶
func NewBuildController(b BuildAndDeployer) *BuildController
func (*BuildController) DisableForTesting ¶ added in v0.1.0
func (c *BuildController) DisableForTesting()
type BuildHandler ¶ added in v0.7.11
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 BuildLogAction ¶ added in v0.2.0
func (BuildLogAction) Action ¶ added in v0.2.0
func (BuildLogAction) Action()
type BuildLogActionWriter ¶ added in v0.2.0
type BuildLogActionWriter struct {
// contains filtered or unexported fields
}
type BuildOrder ¶
type BuildOrder []BuildAndDeployer
func DefaultBuildOrder ¶
func DefaultBuildOrder(lubad *LiveUpdateBuildAndDeployer, ibad *ImageBuildAndDeployer, dcbad *DockerComposeBuildAndDeployer, ltbad *LocalTargetBuildAndDeployer, updMode UpdateMode, env k8s.Env, runtime container.Runtime) BuildOrder
func (BuildOrder) String ¶ added in v0.7.11
func (bo BuildOrder) String() string
type BuildStartedAction ¶
type BuildStartedAction struct { ManifestName model.ManifestName StartTime time.Time FilesChanged []string Reason model.BuildReason }
func (BuildStartedAction) Action ¶
func (BuildStartedAction) Action()
type CompositeBuildAndDeployer ¶
type CompositeBuildAndDeployer struct {
// contains filtered or unexported fields
}
CompositeBuildAndDeployer tries to run each builder in order. If a builder emits an error, it uses the FallbackTester to determine whether the error is critical enough to stop the whole pipeline, or to fallback to the next builder.
func NewCompositeBuildAndDeployer ¶
func NewCompositeBuildAndDeployer(builders BuildOrder) *CompositeBuildAndDeployer
func (*CompositeBuildAndDeployer) BuildAndDeploy ¶
func (composite *CompositeBuildAndDeployer) BuildAndDeploy(ctx context.Context, st store.RStore, specs []model.TargetSpec, currentState store.BuildStateSet) (store.BuildResultSet, error)
type DockerComposeBuildAndDeployer ¶ added in v0.4.1
type DockerComposeBuildAndDeployer struct {
// contains filtered or unexported fields
}
func NewDockerComposeBuildAndDeployer ¶ added in v0.4.1
func NewDockerComposeBuildAndDeployer(dcc dockercompose.DockerComposeClient, dc docker.Client, icb *imageAndCacheBuilder, c build.Clock) *DockerComposeBuildAndDeployer
func (*DockerComposeBuildAndDeployer) BuildAndDeploy ¶ added in v0.4.1
func (bd *DockerComposeBuildAndDeployer) BuildAndDeploy(ctx context.Context, st store.RStore, specs []model.TargetSpec, currentState store.BuildStateSet) (store.BuildResultSet, error)
type DockerComposeEventAction ¶ added in v0.4.1
type DockerComposeEventAction struct {
Event dockercompose.Event
}
func (DockerComposeEventAction) Action ¶ added in v0.4.1
func (DockerComposeEventAction) Action()
type DockerComposeEventWatcher ¶ added in v0.4.1
type DockerComposeEventWatcher struct {
// contains filtered or unexported fields
}
func NewDockerComposeEventWatcher ¶ added in v0.4.1
func NewDockerComposeEventWatcher(dcc dockercompose.DockerComposeClient) *DockerComposeEventWatcher
type DontFallBackError ¶ added in v0.2.0
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.2.0
func DontFallBackErrorf(msg string, a ...interface{}) DontFallBackError
type FallbackTester ¶
type FsWatcherMaker ¶
type FsWatcherMaker func(paths []string, ignore watch.PathMatcher, l logger.Logger) (watch.Notify, error)
func ProvideFsWatcherMaker ¶
func ProvideFsWatcherMaker() FsWatcherMaker
type GithubClientFactory ¶ added in v0.8.4
func NewGithubClientFactory ¶ added in v0.8.4
func NewGithubClientFactory() GithubClientFactory
type HudStoppedAction ¶ added in v0.1.0
type HudStoppedAction struct {
// contains filtered or unexported fields
}
func NewHudStoppedAction ¶ added in v0.1.0
func NewHudStoppedAction(err error) HudStoppedAction
func (HudStoppedAction) Action ¶ added in v0.1.0
func (HudStoppedAction) Action()
type ImageBuildAndDeployer ¶
type ImageBuildAndDeployer struct {
// contains filtered or unexported fields
}
func NewImageBuildAndDeployer ¶
func NewImageBuildAndDeployer( b build.ImageBuilder, cacheBuilder build.CacheBuilder, customBuilder build.CustomBuilder, k8sClient k8s.Client, env k8s.Env, analytics *analytics.TiltAnalytics, updMode UpdateMode, c build.Clock, runtime container.Runtime, kp KINDPusher, syncletContainer sidecar.SyncletContainer, ) *ImageBuildAndDeployer
func (*ImageBuildAndDeployer) BuildAndDeploy ¶
func (ibd *ImageBuildAndDeployer) BuildAndDeploy(ctx context.Context, st store.RStore, specs []model.TargetSpec, stateSet store.BuildStateSet) (resultSet store.BuildResultSet, err error)
func (*ImageBuildAndDeployer) SetInjectSynclet ¶
func (ibd *ImageBuildAndDeployer) SetInjectSynclet(inject bool)
Turn on synclet injection. Should be called before any builds.
type ImageExistsChecker ¶ added in v0.9.2
type InitAction ¶
type InitAction struct { WatchFiles bool TiltfilePath string ConfigFiles []string UserArgs []string TiltBuild model.TiltBuild StartTime time.Time AnalyticsUserOpt analytics.Opt CloudAddress string Token token.Token HUDEnabled bool }
func (InitAction) Action ¶
func (InitAction) Action()
type KINDPusher ¶ added in v0.7.11
type KINDPusher interface {
PushToKIND(ctx context.Context, ref reference.NamedTagged, w io.Writer) error
}
func NewKINDPusher ¶ added in v0.7.11
func NewKINDPusher(clusterName k8s.ClusterName) KINDPusher
type LatestVersionAction ¶ added in v0.8.4
func (LatestVersionAction) Action ¶ added in v0.8.4
func (LatestVersionAction) Action()
type LiveUpdateBuildAndDeployer ¶ added in v0.9.5
type LiveUpdateBuildAndDeployer struct {
// contains filtered or unexported fields
}
func NewLiveUpdateBuildAndDeployer ¶ added in v0.9.5
func NewLiveUpdateBuildAndDeployer(dcu *containerupdate.DockerContainerUpdater, scu *containerupdate.SyncletUpdater, ecu *containerupdate.ExecUpdater, updMode UpdateMode, env k8s.Env, runtime container.Runtime, c build.Clock) *LiveUpdateBuildAndDeployer
func (*LiveUpdateBuildAndDeployer) BuildAndDeploy ¶ added in v0.9.5
func (lubad *LiveUpdateBuildAndDeployer) BuildAndDeploy(ctx context.Context, st store.RStore, specs []model.TargetSpec, stateSet store.BuildStateSet) (store.BuildResultSet, error)
type LocalTargetBuildAndDeployer ¶ added in v0.10.8
type LocalTargetBuildAndDeployer struct {
// contains filtered or unexported fields
}
TODO(maia): CommandRunner interface for testability
func NewLocalTargetBuildAndDeployer ¶ added in v0.10.8
func NewLocalTargetBuildAndDeployer(c build.Clock) *LocalTargetBuildAndDeployer
func (*LocalTargetBuildAndDeployer) BuildAndDeploy ¶ added in v0.10.8
func (bd *LocalTargetBuildAndDeployer) BuildAndDeploy(ctx context.Context, st store.RStore, specs []model.TargetSpec, stateSet store.BuildStateSet) (resultSet store.BuildResultSet, err error)
type ManifestReloadedAction ¶
type ManifestReloadedAction struct { OldManifest model.Manifest NewManifest model.Manifest Error error }
func (ManifestReloadedAction) Action ¶
func (ManifestReloadedAction) Action()
type PortForwardController ¶
type PortForwardController struct {
// contains filtered or unexported fields
}
func NewPortForwardController ¶
func NewPortForwardController(kClient k8s.Client) *PortForwardController
type ProfilerManager ¶ added in v0.4.2
type ProfilerManager struct {
// contains filtered or unexported fields
}
func NewProfilerManager ¶ added in v0.4.2
func NewProfilerManager() *ProfilerManager
func (*ProfilerManager) OnChange ¶ added in v0.4.2
func (p *ProfilerManager) OnChange(ctx context.Context, st store.RStore)
type RedirectToNextBuilder ¶ added in v0.2.0
type RedirectToNextBuilder struct {
// 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.7.12
func RedirectToNextBuilderInfof(msg string, a ...interface{}) RedirectToNextBuilder
func SilentRedirectToNextBuilderf ¶ added in v0.7.12
func SilentRedirectToNextBuilderf(msg string, a ...interface{}) RedirectToNextBuilder
func WrapRedirectToNextBuilder ¶ added in v0.2.0
func WrapRedirectToNextBuilder(err error, level logger.Level) RedirectToNextBuilder
type TargetQueue ¶ added in v0.7.11
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.7.11
func NewImageTargetQueue(ctx context.Context, iTargets []model.ImageTarget, state store.BuildStateSet, imageExists ImageExistsChecker) (*TargetQueue, error)
func (*TargetQueue) CountDirty ¶ added in v0.7.11
func (q *TargetQueue) CountDirty() int
func (*TargetQueue) RunBuilds ¶ added in v0.7.11
func (q *TargetQueue) RunBuilds(handler BuildHandler) error
type TiltVersionChecker ¶ added in v0.8.4
type TiltVersionChecker struct {
// contains filtered or unexported fields
}
func NewTiltVersionChecker ¶ added in v0.8.4
func NewTiltVersionChecker(ghcf GithubClientFactory, timerMaker timerMaker) *TiltVersionChecker
type UIDUpdateAction ¶ added in v0.8.9
type UIDUpdateAction struct { UID types.UID EventType watch.EventType ManifestName model.ManifestName Entity k8s.K8sEntity }
func (UIDUpdateAction) Action ¶ added in v0.8.9
func (UIDUpdateAction) Action()
type UpdateMode ¶
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 ¶
func ProvideUpdateMode(flag UpdateModeFlag, env k8s.Env, runtime container.Runtime) (UpdateMode, error)
type UpdateModeFlag ¶
type UpdateModeFlag UpdateMode
A type to bind to flag values that need validation.
type Upper ¶
type Upper struct {
// contains filtered or unexported fields
}
TODO(nick): maybe this should be called 'BuildEngine' or something? Upper seems like a poor and undescriptive name.
type WatchManager ¶
type WatchManager struct {
// contains filtered or unexported fields
}
func NewWatchManager ¶
func NewWatchManager(watcherMaker FsWatcherMaker, timerMaker timerMaker) *WatchManager
func (*WatchManager) DisableForTesting ¶ added in v0.2.0
func (w *WatchManager) DisableForTesting()
type WatchableTarget ¶ added in v0.5.1
type WatchableTarget interface { ignore.IgnorableTarget Dependencies() []string ID() model.TargetID }
If you modify this interface, you might also need to update the watchRulesMatch function below.
Source Files ¶
- actions.go
- build_and_deployer.go
- build_errors.go
- buildcontroller.go
- docker_compose_build_and_deployer.go
- docker_compose_event_watcher.go
- extractors.go
- image_and_cache_builder.go
- image_build_and_deployer.go
- live_update_build_and_deployer.go
- live_update_state_tree.go
- local_target_build_and_deployer.go
- parse.go
- pod.go
- portforwardcontroller.go
- profiler.go
- subscribers.go
- target_queue.go
- update_mode.go
- upper.go
- version_checker.go
- watchmanager.go
- wire_gen.go