Documentation ¶
Index ¶
- Constants
- Variables
- func DecideRegistry(ctx context.Context, kCli k8s.Client, tlr *tiltfile.TiltfileLoadResult) container.Registry
- func HandleConfigsReloadStarted(ctx context.Context, state *store.EngineState, ...)
- func HandleConfigsReloaded(ctx context.Context, state *store.EngineState, event ConfigsReloadedAction)
- func SpanIDForLoadCount(mn model.ManifestName, loadCount int) logstore.SpanID
- func ToFileWatchObjects(watchInputs WatchInputs, ...) apiset.TypedObjectSet
- type BuildEntry
- type ConfigsReloadStartedAction
- type ConfigsReloadedAction
- type Reconciler
- type WatchInputs
- type WatchableTarget
Constants ¶
const TiltfileBuildSource = "tiltfile"
Variables ¶
var WireSet = wire.NewSet( NewReconciler, )
Functions ¶
func DecideRegistry ¶ added in v0.23.7
func DecideRegistry(ctx context.Context, kCli k8s.Client, tlr *tiltfile.TiltfileLoadResult) container.Registry
DecideRegistry returns the image registry we should use; if detected, a pre-configured local registry; otherwise, the registry specified by the user via default_registry. Otherwise, we'll return the zero value of `s.defaultReg`, which is an empty registry. It has side-effects (a log line) and so should only be called once.
func HandleConfigsReloadStarted ¶ added in v0.22.6
func HandleConfigsReloadStarted( ctx context.Context, state *store.EngineState, event ConfigsReloadStartedAction, )
func HandleConfigsReloaded ¶ added in v0.22.6
func HandleConfigsReloaded( ctx context.Context, state *store.EngineState, event ConfigsReloadedAction, )
In the original Tilt architecture, the Tiltfile contained the whole engine state. Reloading the tiltfile re-created that state from scratch.
We've moved towards a more modular architecture, but many of the tilt data models aren't modular. For example, if two Tiltfiles set UpdateSettings, it's not clear which one "wins" or how their preferences combine.
In the long-term, Tiltfile settings should only take affect in objects created by that Tiltfile. (e.g., WatchSettings only affects FileWatches created by that Tiltfile.)
In the medium-term, we resolve this in the EngineState in three different ways:
- If a data structure supports merging (like the Manifest map), do a merge.
- If merging fails (like if two Tiltfiles define the same Manifest), log an Error and try to do something resonable.
- If a data structure does not support merging (like UpdateSettings), only accept that data structure from the "main" tiltfile.
func SpanIDForLoadCount ¶ added in v0.22.4
func SpanIDForLoadCount(mn model.ManifestName, loadCount int) logstore.SpanID
func ToFileWatchObjects ¶ added in v0.22.4
func ToFileWatchObjects(watchInputs WatchInputs, disableSources map[model.ManifestName]*v1alpha1.DisableSource) apiset.TypedObjectSet
FileWatchesFromManifests creates FileWatch specs from Tilt manifests in the engine state.
Types ¶
type BuildEntry ¶ added in v0.22.4
type BuildEntry struct { Name model.ManifestName FilesChanged []string BuildReason model.BuildReason Args []string TiltfilePath string CheckpointAtExecStart logstore.Checkpoint LoadCount int ArgsChanged bool }
BuildEntry is vestigial, but currently used to help manage state about a tiltfile build.
func (*BuildEntry) WithLogger ¶ added in v0.22.4
type ConfigsReloadStartedAction ¶ added in v0.22.4
type ConfigsReloadStartedAction struct { Name model.ManifestName FilesChanged []string StartTime time.Time SpanID logstore.SpanID Reason model.BuildReason }
func (ConfigsReloadStartedAction) Action ¶ added in v0.22.4
func (ConfigsReloadStartedAction) Action()
type ConfigsReloadedAction ¶ added in v0.22.4
type ConfigsReloadedAction struct { Name model.ManifestName // TODO(nick): Embed TiltfileLoadResult instead of copying fields. Manifests []model.Manifest Tiltignore model.Dockerignore ConfigFiles []string FinishTime time.Time Err error Warnings []string Features map[string]bool TeamID string TelemetrySettings model.TelemetrySettings Secrets model.SecretSet DockerPruneSettings model.DockerPruneSettings AnalyticsTiltfileOpt analytics.Opt VersionSettings model.VersionSettings UpdateSettings model.UpdateSettings WatchSettings model.WatchSettings // A checkpoint into the logstore when Tiltfile execution started. // Useful for knowing how far back in time we have to scrub secrets. CheckpointAtExecStart logstore.Checkpoint }
func (ConfigsReloadedAction) Action ¶ added in v0.22.4
func (ConfigsReloadedAction) Action()
type Reconciler ¶
type Reconciler struct {
// contains filtered or unexported fields
}
func NewReconciler ¶
func NewReconciler(st store.RStore, tfl tiltfile.TiltfileLoader, k8sClient k8s.Client, dockerClient docker.Client, ctrlClient ctrlclient.Client, scheme *runtime.Scheme, engineMode store.EngineMode, k8sContextOverride k8s.KubeContextOverride, k8sNamespaceOverride k8s.NamespaceOverride) *Reconciler
func (*Reconciler) CreateBuilder ¶
type WatchInputs ¶ added in v0.22.4
type WatchInputs struct { TiltfileManifestName model.ManifestName TiltfilePath string Manifests []model.Manifest ConfigFiles []string WatchSettings model.WatchSettings Tiltignore model.Dockerignore EngineMode store.EngineMode }
type WatchableTarget ¶ added in v0.22.4
type WatchableTarget interface { ignore.IgnorableTarget Dependencies() []string ID() model.TargetID }