quay_io_ci_images_distributor

package
v0.0.0-...-257a958 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const ControllerName = "quay_io_ci_images_distributor"

Variables

This section is empty.

Functions

func AddToManager

func AddToManager(manager manager.Manager,
	configAgent agents.ConfigAgent,
	resolver registryResolver,
	additionalImageStreamTags, additionalImageStreams, additionalImageStreamNamespaces, ignoreImageStreamTags sets.Set[string],
	quayIOImageHelper QuayIOImageHelper,
	mirrorStore MirrorStore,
	registryConfig string,
	onlyValidManifestV2Images bool) error

func NewClientFactory

func NewClientFactory(opts ...ClientFactoryOpt) clientFactory

NewClientFactory return a client factory for the images from quay.io

func ObserveMirroringDuration

func ObserveMirroringDuration(state string, value float64)

ObserveMirroringDuration observe the mirroring duration

func RegisterMetrics

func RegisterMetrics() error

RegisterMetrics Registers metrics

func SetMirrorQueueDepth

func SetMirrorQueueDepth(value float64)

SetMirrorQueueDepth sets the mirroring mirror queue's depth

Types

type CIImagesMirrorConfig

type CIImagesMirrorConfig struct {
	SupplementalCIImages map[string]Source `json:"supplementalCIImages"`
	IgnoredSources       []IgnoredSource   `json:"ignoredSources"`
}

func LoadConfig

func LoadConfig(file string) (*CIImagesMirrorConfig, error)

type ClientFactoryOpt

type ClientFactoryOpt func(*ClientFactoryOpts)

type ClientFactoryOpts

type ClientFactoryOpts struct {
	// contains filtered or unexported fields
}

type Config

type Config struct {
	Architecture string `json:"architecture"`
	// "created": "2023-09-14T15:13:32.640956126Z",
	Created time.Time `json:"created"`
}

type IgnoredSource

type IgnoredSource struct {
	Source `json:",inline"`
	Reason string `json:"reason"`
}

type ImageInfo

type ImageInfo struct {
	Name string `json:"name"`
	// Digest is the digest of the image, e.g., sha256:b24f782bee7dfddcc36b962f663aeabb16d6fa56a64a7cd0639ebfb1e5fa73f4
	Digest string `json:"digest"`
	Config Config `json:"config"`
}

type MirrorConsumerController

type MirrorConsumerController struct {
	// contains filtered or unexported fields
}

func NewMirrorConsumer

func NewMirrorConsumer(mirrorStore MirrorStore, quayIOImageHelper QuayIOImageHelper, registryConfig string, dryRun bool) *MirrorConsumerController

func (*MirrorConsumerController) Run

type MirrorStore

type MirrorStore interface {
	Put(t ...MirrorTask) error
	Take(n int) ([]MirrorTask, error)
	Show(n int) ([]MirrorTask, int, error)
	Summarize() (map[string]any, error)
}

func NewMirrorStore

func NewMirrorStore() MirrorStore

NewMirrorStore returns a mirror store

type MirrorTask

type MirrorTask struct {
	SourceTagRef      cioperatorapi.ImageStreamTagReference `json:"source_tag_ref"`
	Source            string                                `json:"source"`
	Destination       string                                `json:"destination"`
	CurrentQuayDigest string                                `json:"current_quay_digest"`
	CreatedAt         time.Time                             `json:"created_at"`
	Stale             bool                                  `json:"stale"`
	Owner             string                                `json:"owner"`
}

type OCClient

type OCClient interface {
	ImageInfo(image string, options OCImageInfoOptions) (ImageInfo, error)
	ImageMirror(pairs []string, options OCImageMirrorOptions) error
}

type OCImageInfoOptions

type OCImageInfoOptions struct {
	RegistryConfig string
	FilterByOS     string
}

type OCImageMirrorOptions

type OCImageMirrorOptions struct {
	RegistryConfig  string
	ContinueOnError bool
	MaxPerRegistry  int
	BatchSize       int
	DryRun          bool
}

type QuayIOImageHelper

type QuayIOImageHelper interface {
	ImageInfo(image string, options OCImageInfoOptions) (ImageInfo, error)
	ImageMirror(pairs []string, options OCImageMirrorOptions) error
}

type Source

type Source struct {
	api.ImageStreamTagReference `json:",inline"`
	// Image is an image that can be pulled in either form of tag or digest.
	// When image is set, Tag will be ignored.
	Image string `json:"image"`
}

Jump to

Keyboard shortcuts

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