aimclustermodelsource

package
v0.2.0-rc9 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DockerRegistry is the canonical docker.io registry name
	DockerRegistry = "docker.io"
)

Variables

This section is empty.

Functions

func BuildClusterModel

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

ListImages discovers all images matching the spec's filters from the configured registry.

type RegistryImage

type RegistryImage struct {
	Registry   string
	Repository string
	Tag        string
	Digest     string
}

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.

Jump to

Keyboard shortcuts

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