v1alpha1

package
v1.13.1 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the kuik v1alpha1 API group. +kubebuilder:object:generate=true +groupName=kuik.enix.io

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects.
	GroupVersion = schema.GroupVersion{Group: "kuik.enix.io", Version: "v1alpha1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme.
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)
View Source
var RepositoryLabelName = "kuik.enix.io/repository"

Functions

func CachedImageNameFromSourceImage added in v1.12.0

func CachedImageNameFromSourceImage(sourceImage string) (string, error)

Types

type CachedImage

type CachedImage struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   CachedImageSpec   `json:"spec,omitempty"`
	Status CachedImageStatus `json:"status,omitempty"`
}

CachedImage is the Schema for the cachedimages API.

func (*CachedImage) GetPullSecrets

func (r *CachedImage) GetPullSecrets(apiReader client.Reader) ([]corev1.Secret, error)

func (*CachedImage) Repository

func (r *CachedImage) Repository() (reference.Named, error)

func (*CachedImage) Upstream added in v1.12.0

func (r *CachedImage) Upstream() (string, error)

type CachedImageList

type CachedImageList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []CachedImage `json:"items"`
}

CachedImageList contains a list of CachedImage.

type CachedImageSpec

type CachedImageSpec struct {
	// SourceImage is the path of the image to cache
	SourceImage string `json:"sourceImage"`
	// ExpiresAt is the time when the image should be deleted from cache if not in use (unset when the image is used again)
	// +optional
	ExpiresAt *metav1.Time `json:"expiresAt,omitempty"`
	// Retain defines if the image should be retained in cache even when not used (will prevent ExpiresAt to be populated)
	// +optional
	Retain bool `json:"retain,omitempty"`
}

CachedImageSpec defines the desired state of CachedImage.

type CachedImageStatus

type CachedImageStatus struct {
	// IsCached indicate whether the image is already cached or not
	IsCached bool `json:"isCached,omitempty"`
	// Phase is the current phase of the image
	Phase string `json:"phase,omitempty"`
	// UsedBy is the list of pods using this image
	UsedBy UsedBy `json:"usedBy,omitempty"`

	// Digest is the digest of the cached image
	Digest string `json:"digest,omitempty"`
	// UpstreamDigest is the upstream image digest
	UpstreamDigest string `json:"upstreamDigest,omitempty"`
	// UpToDate indicate whether if the cached image is up to date with the upstream one or not
	UpToDate bool `json:"upToDate,omitempty"`
	// LastSync is the last time the remote image digest has been checked
	LastSync metav1.Time `json:"lastSync,omitempty"`
	// LastSuccessfulPull is the last time the upstream image has been successfully cached
	LastSuccessfulPull metav1.Time `json:"lastSuccessfulPull,omitempty"`

	// AvailableUpstream indicate whether if the referenced image is available upstream or not
	AvailableUpstream bool `json:"availableUpstream,omitempty"`
	// LastSeenUpstream is the last time the referenced image has been seen upstream
	LastSeenUpstream metav1.Time `json:"lastSeenUpstream,omitempty"`
}

CachedImageStatus defines the observed state of CachedImage.

type PodReference

type PodReference struct {
	// NamespacedName is the namespaced name of a pod (namespace/name)
	NamespacedName string `json:"namespacedName,omitempty"`
}

type Repository

type Repository struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   RepositorySpec   `json:"spec,omitempty"`
	Status RepositoryStatus `json:"status,omitempty"`
}

Repository is the Schema for the repositories API.

func (*Repository) CompileUpdateFilters

func (r *Repository) CompileUpdateFilters() ([]regexp.Regexp, error)

func (*Repository) GetPullSecrets added in v1.9.2

func (r *Repository) GetPullSecrets(apiReader client.Reader) ([]corev1.Secret, error)

type RepositoryList

type RepositoryList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Repository `json:"items"`
}

RepositoryList contains a list of Repository.

type RepositorySpec

type RepositorySpec struct {
	// Name is the path of the repository (for instance enix/kube-image-keeper)
	Name string `json:"name"`
	// PullSecretNames is the names of pull secret to use to pull CachedImages of this Repository
	PullSecretNames []string `json:"pullSecretNames,omitempty"`
	// PullSecretsNamespace is the namespace where pull secrets can be found for CachedImages of this Repository
	PullSecretsNamespace string `json:"pullSecretsNamespace,omitempty"`
	// UpdateInterval is the interval in human readable format (1m, 1h...) at which matched CachedImages from this Repository are updated (see spec.UpdateFilters)
	UpdateInterval *metav1.Duration `json:"updateInterval,omitempty"`
	// UpdateFilters is a list of regexps that need to match (at least one of them) the .spec.SourceImage of a CachedImage from this Repository to update it at regular interval
	UpdateFilters []string `json:"updateFilters,omitempty"`
}

RepositorySpec defines the desired state of Repository.

type RepositoryStatus

type RepositoryStatus struct {
	// Images is the count of CachedImages that come from this repository
	Images int `json:"images,omitempty"`
	// Phase is the current phase of this repository
	Phase string `json:"phase,omitempty"`
	// LastUpdate is the last time images of this repository has been updated
	LastUpdate metav1.Time `json:"lastUpdate,omitempty"`
	//+listType=map
	//+listMapKey=type
	//+patchStrategy=merge
	//+patchMergeKey=type
	//+optional
	Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
}

RepositoryStatus defines the observed state of Repository.

type UsedBy

type UsedBy struct {
	// Pods is a list of reference to pods using this CachedImage
	Pods []PodReference `json:"pods,omitempty" patchStrategy:"merge" patchMergeKey:"namespacedName"`
	// Count is the number of pods using this image
	//
	// jsonpath function .length() is not implemented, so the count field is required to display pods count in additionalPrinterColumns
	// see https://github.com/kubernetes-sigs/controller-tools/issues/447
	Count int `json:"count,omitempty"`
}

Jump to

Keyboard shortcuts

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