mirror of
https://github.com/moby/buildkit.git
synced 2026-08-09 01:01:08 +00:00
Render parsed source identifiers back to their canonical SourceOp form before source policy evaluation. This lets Git subdir cleanup use the existing source parser and avoids policy-specific Git parsing. Add String methods for source identifiers and cover them with unit tests, plus a client integration regression for canonical Git subdir policy matching. Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
24 lines
537 B
Go
24 lines
537 B
Go
package source
|
|
|
|
import (
|
|
"github.com/moby/buildkit/solver/llbsolver/provenance"
|
|
"github.com/pkg/errors"
|
|
)
|
|
|
|
var (
|
|
errInvalid = errors.New("invalid")
|
|
errNotFound = errors.New("not found")
|
|
)
|
|
|
|
type Identifier interface {
|
|
// String returns the canonical source operation identifier.
|
|
String() string
|
|
|
|
// Scheme returns the scheme of the identifier so that it can be routed back
|
|
// to an appropriate Source.
|
|
Scheme() string
|
|
|
|
// Capture records the provenance of the identifier.
|
|
Capture(dest *provenance.Capture, pin string) error
|
|
}
|