Documentation
¶
Index ¶
- Constants
- func FilterHasWildcard(filter aimv1alpha1.ModelSourceFilter) bool
- func MatchesFilters(img RegistryImage, filters []aimv1alpha1.ModelSourceFilter, ...) bool
- type ClusterModelSourceFetch
- type ClusterModelSourceObservation
- type ClusterModelSourceReconciler
- func (r *ClusterModelSourceReconciler) ComposeState(_ context.Context, ...) ClusterModelSourceObservation
- func (r *ClusterModelSourceReconciler) DecorateStatus(status *aimv1alpha1.AIMClusterModelSourceStatus, ...)
- func (r *ClusterModelSourceReconciler) FetchRemoteState(ctx context.Context, c client.Client, ...) ClusterModelSourceFetch
- func (r *ClusterModelSourceReconciler) PlanResources(ctx context.Context, ...) controllerutils.PlanResult
- type FilterResult
- type RegistryClient
- type RegistryImage
Constants ¶
const ( DockerRegistry = "docker.io" GHCRRegistry = "ghcr.io" )
const (
// LabelKeyModelSource is the label key used to identify the model source that created a cluster model.
LabelKeyModelSource = "aim.eai.amd.com/model-source"
)
Variables ¶
This section is empty.
Functions ¶
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 ClusterModelSourceFetch ¶
type ClusterModelSourceFetch struct {
// contains filtered or unexported fields
}
func (ClusterModelSourceFetch) GetComponentHealth ¶
func (fetch ClusterModelSourceFetch) GetComponentHealth() []controllerutils.ComponentHealth
GetComponentHealth implements ComponentHealthProvider on FetchResult. This follows the aimmodel pattern where fetch results provide health directly.
type ClusterModelSourceObservation ¶
type ClusterModelSourceObservation struct {
ClusterModelSourceFetch
// contains filtered or unexported fields
}
ClusterModelSourceObservation embeds the fetch result. Additional computed fields are added for PlanResources and DecorateStatus.
type ClusterModelSourceReconciler ¶
type ClusterModelSourceReconciler struct {
Clientset kubernetes.Interface
Scheme *runtime.Scheme
OperatorNamespace string
}
ClusterModelSourceReconciler implements domain reconciliation for AIMClusterModelSource.
func (*ClusterModelSourceReconciler) ComposeState ¶
func (r *ClusterModelSourceReconciler) ComposeState( _ context.Context, _ controllerutils.ReconcileContext[*aimv1alpha1.AIMClusterModelSource], fetch ClusterModelSourceFetch, ) ClusterModelSourceObservation
func (*ClusterModelSourceReconciler) DecorateStatus ¶
func (r *ClusterModelSourceReconciler) DecorateStatus( status *aimv1alpha1.AIMClusterModelSourceStatus, cm *controllerutils.ConditionManager, obs ClusterModelSourceObservation, )
func (*ClusterModelSourceReconciler) FetchRemoteState ¶
func (r *ClusterModelSourceReconciler) FetchRemoteState( ctx context.Context, c client.Client, reconcileCtx controllerutils.ReconcileContext[*aimv1alpha1.AIMClusterModelSource], ) ClusterModelSourceFetch
func (*ClusterModelSourceReconciler) PlanResources ¶
func (r *ClusterModelSourceReconciler) PlanResources( ctx context.Context, _ controllerutils.ReconcileContext[*aimv1alpha1.AIMClusterModelSource], obs ClusterModelSourceObservation, ) controllerutils.PlanResult
type FilterResult ¶
type FilterResult struct {
Filter aimv1alpha1.ModelSourceFilter
Images []RegistryImage // Images discovered (may be partial)
Error error // Error encountered (nil = full success)
}
FilterResult captures the result of processing a single filter.
type RegistryClient ¶
type RegistryClient struct {
// contains filtered or unexported fields
}
RegistryClient handles image discovery from container registries.
func NewRegistryClient ¶
func NewRegistryClient(clientset kubernetes.Interface, operatorNamespace string) *RegistryClient
NewRegistryClient creates a new RegistryClient.
func (*RegistryClient) FetchFilter ¶
func (c *RegistryClient) FetchFilter( ctx context.Context, spec aimv1alpha1.AIMClusterModelSourceSpec, filter aimv1alpha1.ModelSourceFilter, ) FilterResult
FetchFilter processes a single filter and returns discovered images. It uses the appropriate strategy based on the filter type: 1. Static images (exact versions, no registry query) 2. Tags list API (exact repos with version ranges) 3. Catalog API (wildcards on Docker Hub/Harbor/etc)
type RegistryImage ¶
RegistryImage represents a discovered image from 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 (RegistryImage) ToImageURI ¶
func (img RegistryImage) ToImageURI() string
ToImageURI returns the full image URI in registry/repository:tag format. Special handling for docker.io which doesn't require the registry prefix.