tiltfile

package
v0.22.12 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2021 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

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:

  1. If a data structure supports merging (like the Manifest map), do a merge.
  2. If merging fails (like if two Tiltfiles define the same Manifest), log an Error and try to do something resonable.
  3. If a data structure does not support merging (like UpdateSettings), only accept that data structure from the "main" tiltfile.

func NewTiltfileLogWriter added in v0.22.4

func NewTiltfileLogWriter(mn model.ManifestName, s store.RStore, loadCount int) *tiltfileLogWriter

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[string]*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
	UserConfigState       model.UserConfigState
	TiltfilePath          string
	CheckpointAtExecStart logstore.Checkpoint
	LoadCount             int
}

BuildEntry is vestigial, but currently used to help manage state about a tiltfile build.

func (*BuildEntry) WithLogger added in v0.22.4

func (be *BuildEntry) WithLogger(ctx context.Context, st store.RStore) context.Context

type BuildSource added in v0.22.4

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

BuildSource is vestigial, but currently used to help re-run the reconciler.

func NewBuildSource added in v0.22.4

func NewBuildSource() *BuildSource

func (*BuildSource) Add added in v0.22.4

func (s *BuildSource) Add(nn types.NamespacedName)

func (*BuildSource) Start 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, dockerClient docker.Client,
	ctrlClient ctrlclient.Client, scheme *runtime.Scheme,
	buildSource *BuildSource, engineMode store.EngineMode) *Reconciler

func (*Reconciler) CreateBuilder

func (r *Reconciler) CreateBuilder(mgr ctrl.Manager) (*builder.Builder, error)

func (*Reconciler) Reconcile

func (r *Reconciler) Reconcile(ctx context.Context, request reconcile.Request) (reconcile.Result, error)

Reconcile manages Tiltfile execution.

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
}

Jump to

Keyboard shortcuts

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