Documentation
¶
Index ¶
- Constants
- func Checkout(ctx context.Context, repo *git.Repository, ref string, ...) error
- func CleanRoot(root string) string
- func Equivalent(before, after *Identity) bool
- func Hash(value any) string
- func InputEntry(entry string, stat bool) string
- func IsCommit(ref string) bool
- func Matches(expected, actual *Identity) bool
- func TerraformVersion(version string) string
- func ValidInputPath(name string) bool
- func ValidateTransition(expected, actual *Identity, allowCapture bool) error
- func Verify(source *sourcefs.FS, expected *Identity) error
- type File
- type Identity
- func (i *Identity) EligibleChecksum() string
- func (i *Identity) MarkUnknown(reason string)
- func (i *Identity) OverInputLimit() (*Identity, error)
- func (i *Identity) Seal()
- func (i *Identity) Validate() error
- func (i *Identity) WithInputs(inputs []Input) (*Identity, error)
- func (i *Identity) WithoutInputs() *Identity
- type Input
- type Reads
Constants ¶
const ( ResolvedFromCommit = "commit" ResolvedFromBranchRun = "branch_run" ResolvedFromLookup = "lookup" )
How a Git source's commit was chosen. Provenance is recorded for display and is not part of the checksum.
const Complete = "complete"
const DefaultTerraformVersion = "1.7.5"
const InputsOverLimit = "source_inputs_over_limit"
const MaxInputs = 1000
const Unknown = "unknown"
const Version = 1
Variables ¶
This section is empty.
Functions ¶
func Checkout ¶
func Checkout(ctx context.Context, repo *git.Repository, ref string, auth transport.AuthMethod) error
func Equivalent ¶
func InputEntry ¶
InputEntry reduces a Git entry to what a stat observes: the mode, plus the object for symlinks and submodules.
func TerraformVersion ¶
func ValidInputPath ¶
func ValidateTransition ¶
Types ¶
type Identity ¶
type Identity struct {
Version int `json:"version"`
Checksum string `json:"checksum"`
Coverage string `json:"coverage"`
Reasons []string `json:"reasons,omitempty"`
ConfigChecksum string `json:"config_checksum"`
Kind string `json:"kind"`
Root string `json:"root,omitempty"`
Repository string `json:"repository,omitempty"`
Commit string `json:"commit,omitempty"`
Digest string `json:"digest,omitempty"`
ChartVersion string `json:"chart_version,omitempty"`
Files []File `json:"files,omitempty"`
Captured bool `json:"captured"`
Inputs []Input `json:"inputs,omitempty"`
InputsRecorded bool `json:"inputs_recorded,omitempty"`
Ref string `json:"ref,omitempty"`
ResolvedFrom string `json:"resolved_from,omitempty"`
ResolvedAt *time.Time `json:"resolved_at,omitempty"`
}
func (*Identity) EligibleChecksum ¶
func (*Identity) MarkUnknown ¶
func (*Identity) OverInputLimit ¶
OverInputLimit records that the build read more than MaxInputs paths outside Root, so it can never be reused.
func (*Identity) WithInputs ¶
WithInputs records the entries a build read outside Root.
func (*Identity) WithoutInputs ¶
type Input ¶
type Input struct {
Path string `json:"path"`
Stat bool `json:"stat,omitempty"`
Entry string `json:"entry,omitempty"`
}
Input is a repository path outside Root that the build read (or only statted, when Stat is set), with its Git entry at Commit. Entry is empty when the path is absent; stat inputs keep only the mode unless the entry is a symlink or submodule.
type Reads ¶
func ExternalReads ¶
ExternalReads keeps the paths outside root, dropping any path covered by a directory or file whose contents were read. When root's digest is a directory, stats of root's ancestors are dropped too, because that digest already pins each of them as a directory. A symlink digest holds only the link target, not which ancestor is the link, so those stats are kept.