Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotImportable = errors.New("requested image cannot be imported")
Functions ¶
This section is empty.
Types ¶
type ImageStreamController ¶
type ImageStreamController struct {
// contains filtered or unexported fields
}
func NewImageStreamController ¶
func NewImageStreamController(client imagev1client.Interface, informer imagev1informer.ImageStreamInformer) *ImageStreamController
NewImageStreamController returns a new image stream import controller.
func (*ImageStreamController) Run ¶
func (c *ImageStreamController) Run(workers int, stopCh <-chan struct{})
Run begins watching and syncing.
func (*ImageStreamController) SetNotifier ¶
func (c *ImageStreamController) SetNotifier(n Notifier)
type ImportMetricCounter ¶
type ImportMetricCounter struct {
// contains filtered or unexported fields
}
ImportMetricCounter counts numbers of successful and failed imports for the purpose of metrics collection.
func NewImportMetricCounter ¶
func NewImportMetricCounter() *ImportMetricCounter
NewImportMetricCounter returns a new ImportMetricCounter
func (*ImportMetricCounter) Collect ¶
func (c *ImportMetricCounter) Collect() (metrics.ImportSuccessCounts, metrics.ImportErrorCounts, error)
Collect is supposed to be called by the metrics collector. It returns the actual state of counters.
func (*ImportMetricCounter) Increment ¶
func (c *ImportMetricCounter) Increment(isi *imagev1.ImageStreamImport, err error)
Increment processes the given image stream import object as a result of successful or failed import and increments the counters. The given error will be used to construct reason of the error_count metric unless any reason is found in the image stream import object. It's safe to call this method with any of the parameters nil.
type Notifier ¶ added in v1.1.2
type Notifier interface { // Importing is invoked when the controller is going to import an image stream Importing(stream *imagev1.ImageStream) }
Notifier provides information about when the controller makes a decision
type ScheduledImageStreamController ¶
type ScheduledImageStreamController struct {
// contains filtered or unexported fields
}
func NewScheduledImageStreamController ¶
func NewScheduledImageStreamController(client imagev1client.Interface, informer imagev1informer.ImageStreamInformer, opts ScheduledImageStreamControllerOptions) *ScheduledImageStreamController
NewScheduledImageStreamController returns a new scheduled image stream import controller.
func (*ScheduledImageStreamController) Importing ¶
func (s *ScheduledImageStreamController) Importing(stream *imagev1.ImageStream)
Importing is invoked when the controller decides to import a stream in order to push back the next schedule time.
func (*ScheduledImageStreamController) Run ¶
func (s *ScheduledImageStreamController) Run(stopCh <-chan struct{})
Run begins watching and syncing.
type ScheduledImageStreamControllerOptions ¶
type ScheduledImageStreamControllerOptions struct { Resync time.Duration // Enabled indicates that the scheduled imports for images are allowed. Enabled bool // DefaultBucketSize is the default bucket size used by QPS. DefaultBucketSize int // MaxImageImportsPerMinute sets the maximum number of simultaneous image imports per // minute. MaxImageImportsPerMinute int }
ImageStreamControllerOptions represents a configuration for the scheduled image stream import controller.
func (ScheduledImageStreamControllerOptions) Buckets ¶
func (opts ScheduledImageStreamControllerOptions) Buckets() int
Buckets returns the bucket size calculated based on the resync interval of the scheduled image import controller. For resync interval bigger than our the bucket size is doubled, for resync lower then 10 minutes bucket size is set to a half of the default size.
func (ScheduledImageStreamControllerOptions) BucketsToQPS ¶
func (opts ScheduledImageStreamControllerOptions) BucketsToQPS() float32
BucketsToQPS converts the bucket size to QPS
func (ScheduledImageStreamControllerOptions) GetRateLimiter ¶
func (opts ScheduledImageStreamControllerOptions) GetRateLimiter() flowcontrol.RateLimiter
GetRateLimiter returns a flowcontrol rate limiter based on the maximum number of imports (MaxImageImportsPerMinute) setting.