Documentation
¶
Index ¶
- Constants
- func BuildClusterModel(source *aimv1alpha1.AIMClusterModelSource, img RegistryImage) *aimv1alpha1.AIMClusterModel
- func FilterHasWildcard(filter aimv1alpha1.ModelSourceFilter) bool
- func MatchesFilters(img RegistryImage, filters []aimv1alpha1.ModelSourceFilter, ...) bool
- type RegistryClient
- type RegistryImage
Constants ¶
const (
// DockerRegistry is the canonical docker.io registry name
DockerRegistry = "docker.io"
)
Variables ¶
This section is empty.
Functions ¶
func BuildClusterModel ¶
func BuildClusterModel( source *aimv1alpha1.AIMClusterModelSource, img RegistryImage, ) *aimv1alpha1.AIMClusterModel
buildClusterModel creates an AIMClusterModel resource from a discovered registry image. The model name is generated deterministically using the repository and tag. Labels and annotations track the source and original image details.
func FilterHasWildcard ¶
func FilterHasWildcard(filter aimv1alpha1.ModelSourceFilter) bool
FilterHasWildcard checks if a filter contains wildcard patterns.
func MatchesFilters ¶
func MatchesFilters( img RegistryImage, filters []aimv1alpha1.ModelSourceFilter, globalVersions []string, ) bool
MatchesFilters checks if an image matches any of the provided filters. Filters are combined with OR logic - if any filter matches, the image is included.
Types ¶
type RegistryClient ¶
type RegistryClient struct {
// contains filtered or unexported fields
}
RegistryClient provides methods for listing images from container registries.
func NewRegistryClient ¶
func NewRegistryClient(clientset kubernetes.Interface, secretNamespace string) *RegistryClient
NewRegistryClient creates a new registry client.
func (*RegistryClient) ListImages ¶
func (rc *RegistryClient) ListImages( ctx context.Context, spec aimv1alpha1.AIMClusterModelSourceSpec, ) ([]RegistryImage, error)
ListImages discovers all images matching the spec's filters from the configured registry.
type RegistryImage ¶
RegistryImage represents a container image discovered in a registry.
func ExtractStaticImages ¶
func ExtractStaticImages(spec aimv1alpha1.AIMClusterModelSourceSpec) []RegistryImage
ExtractStaticImages converts filters that are exact image references (no wildcards, with tag) into RegistryImage objects. This allows bypassing registry queries for static image lists. When a filter has no explicit tag but spec.versions are specified, it generates static images for each version. This is especially useful for registries like ghcr.io that don't support catalog API. Returns only the filters that can be converted to static references.
func FetchImagesUsingTagsList ¶
func FetchImagesUsingTagsList(ctx context.Context, client *RegistryClient, spec aimv1alpha1.AIMClusterModelSourceSpec) []RegistryImage
FetchImagesUsingTagsList queries specific repositories using the tags list API when: - Filters have exact repository names (no wildcards) - Version constraints are specified (can be ranges) This allows version ranges to work on registries like ghcr.io that don't support catalog API.
func (RegistryImage) ToImageURI ¶
func (ri RegistryImage) ToImageURI() string
ToImageURI converts a RegistryImage to a full image URI. Special handling for docker.io which doesn't require the registry prefix.