kitfile

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetKitfileForRef

func GetKitfileForRef(ctx context.Context, configHome string, ref *registry.Reference) (*artifact.KitFile, error)

func GetKitfileForRefString

func GetKitfileForRefString(ctx context.Context, configHome string, ref string) (*artifact.KitFile, error)

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

type FilterConf struct {
	BaseTypes []string
	Filters   []string
}

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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