Documentation ¶
Overview ¶
The central package for container-image-mirror controls
Index ¶
- Variables
- func MirrorConfigFromFile(path string) (*cimapi.MirrorConfig, error)
- func Run(config *cimapi.MirrorConfig, ctx context.Context, log logr.Logger) error
- func WrapStdLogger(logger logr.InfoLogger) *log.Logger
- type CounterType
- type Event
- type EventHandler
- type EventType
- type InterleaveBuffer
- type ObjectType
- type Runner
- type StatusEventData
- type StatusType
- type StdLogWriter
- type Summary
- type TagInfo
Constants ¶
This section is empty.
Variables ¶
var ( ConfigGlobalTagLimit uint = 1024 ConfigResolveImagesTimeout time.Duration = 3 * time.Minute ConfigResolveTagsTimeout time.Duration = 3 * time.Minute ConfigCopyImageDefaultTimeout time.Duration = 60 * time.Minute ConfigCopyImageTimeout time.Duration = ConfigCopyImageDefaultTimeout ConfigDeleteImageTimeout time.Duration = 5 * time.Minute ConfigEventProcessingTimeout time.Duration = 10 * time.Second ConfigBufferSize uint = ConfigGlobalTagLimit ConfigNumWorkers uint = 8 * uint(runtime.NumCPU()) ConfigNumParallelCopyJobs uint = 4 * uint(runtime.NumCPU()) ConfigMaxMemBytes uint64 = 6 * 1024 * 1024 * 1024 )
Functions ¶
func MirrorConfigFromFile ¶
func MirrorConfigFromFile(path string) (*cimapi.MirrorConfig, error)
func WrapStdLogger ¶
func WrapStdLogger(logger logr.InfoLogger) *log.Logger
WrapStdLogger wraps a github.com/go-logr/logr into a log.Logger from the golang standard library
Types ¶
type CounterType ¶
type CounterType string
const ( CounterTypeTotal CounterType = "Total" CounterTypeResolved CounterType = "Resolved" CounterTypeCopied CounterType = "Copied" CounterTypeDeleted CounterType = "Deleted" CounterTypeFailed CounterType = "Failed" )
type Event ¶
type Event struct { Type EventType Source interface{} Data interface{} }
func NewStatusEvent ¶
func NewStatusEvent(obj string, objType ObjectType, statusType StatusType, val bool) Event
type InterleaveBuffer ¶
type InterleaveBuffer struct {
// contains filtered or unexported fields
}
InterleaveBuffer assists interleaving the copyJob stream with the goal of avoiding (if possible) two tags of the same image being copied in parallel since locally restricted sequential copy would allow to use remote registry mounts for shared layers between tags of the same image
func NewInterleaveBuffer ¶
func NewInterleaveBuffer(interval uint) *InterleaveBuffer
NewInterleaveBuffer creates a new InterleaveBuffer that attempts to interleave multiple copyJobs while considering the <interval> between different tags of the same image Usually, interval should be set to the number of parallel go routines (aka size of the worker pool) in the COPY stage
func (*InterleaveBuffer) FlushBuffer ¶
func (i *InterleaveBuffer) FlushBuffer(out chan copyJob)
FlushBuffer handles ordered emptying of elements still in the buffer after all ticks are processed
func (*InterleaveBuffer) Tick ¶
func (i *InterleaveBuffer) Tick(in *copyJob) *copyJob
Tick represents one interleaved iteration Every tick the buffer checks if the tag should be interleaved and returns the same tag or a replacement tag for the current epoch
type ObjectType ¶
type ObjectType string
const ( ObjectTypeSourceDir ObjectType = "SourceDirectory" ObjectTypeImage ObjectType = "Image" ObjectTypeTag ObjectType = "Tag" )
type StatusEventData ¶
type StatusEventData struct { ObjType ObjectType StatusType StatusType Success bool }
type StatusType ¶
type StatusType string
const ( StatusTypeResolved StatusType = "Resolved" StatusTypeCopied StatusType = "Copied" StatusTypeDeleted StatusType = "Deleted" )
type StdLogWriter ¶
type StdLogWriter struct {
// contains filtered or unexported fields
}
StdLogger represents an abstraction to wrap a logr logger into a io.Writer. We use it to integrate golang std log.Logger logs from github.com/google/go-containerregistry