Files
buildkit/source/identifier.go
Tonis Tiigi 93999f4071 sourcepolicy: normalize parsed source identifiers
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>
2026-07-22 11:36:47 +02:00

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
}