Documentation
¶
Index ¶
- func GetKitfileForRef(ctx context.Context, configHome string, ref *registry.Reference) (*artifact.KitFile, error)
- func GetKitfileForRefString(ctx context.Context, configHome string, ref string) (*artifact.KitFile, error)
- func KitfileContainsMatchingLayer(kf *artifact.KitFile, filters []FilterConf) bool
- func LayerMatchesAnyFilter(layer any, filters []FilterConf) bool
- func ResolveKitfile(ctx context.Context, configHome, kitfileRef, baseRef string) (*artifact.KitFile, error)
- type FilterConf
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetKitfileForRef ¶
func GetKitfileForRefString ¶
func KitfileContainsMatchingLayer ¶ added in v1.12.0
func KitfileContainsMatchingLayer(kf *artifact.KitFile, filters []FilterConf) bool
KitfileContainsMatchingLayer returns true if the given Kitfile contains at least one layer that matches any of the provided filters. If filters is empty, returns true. This reuses shouldUnpackLayer to ensure identical matching semantics.
func LayerMatchesAnyFilter ¶ added in v1.12.0
func LayerMatchesAnyFilter(layer any, filters []FilterConf) bool
LayerMatchesAnyFilter determines if we should unpack a layer in a Kitfile by matching fields against the filters. Matching is done against path and name (if present). If filters is empty, we assume everything should be unpacked
func ResolveKitfile ¶
func ResolveKitfile(ctx context.Context, configHome, kitfileRef, baseRef string) (*artifact.KitFile, error)
ResolveKitfile returns the Kitfile for a reference. Any references to other modelkits are fetched and included in the resolved Kitfile, giving the equivalent Kitfile including the model, datasets, and code from those referenced modelkits.
Types ¶
type FilterConf ¶ added in v1.12.0
func FiltersFromUnpackConf ¶ added in v1.12.0
func FiltersFromUnpackConf(unpackKitfile, unpackModels, unpackCode, unpackDatasets, unpackDocs bool) []FilterConf
FiltersFromUnpackConf converts a (deprecated) unpackConf to a set of filters to enable supporting the old flags
func ParseFilter ¶ added in v1.12.0
func ParseFilter(filter string) (*FilterConf, error)
ParseFilter parses a filter string and returns a FilterConf.
func (*FilterConf) Matches ¶ added in v1.12.0
func (fc *FilterConf) Matches(baseType, field string) bool
func (*FilterConf) MatchesBaseType ¶ added in v1.12.0
func (fc *FilterConf) MatchesBaseType(baseType string) bool
func (*FilterConf) MatchesField ¶ added in v1.12.0
func (fc *FilterConf) MatchesField(field string) bool