Documentation ¶
Index ¶
Constants ¶
const ImageNotFoundError = errors.Sentinel("no images found matching the selection criteria")
ImageNotFoundError is returned by an ImageSelector when it cannot find an image matching the provided criteria.
const Version = "0.9.3"
Version is the currently supported PKE version.
Variables ¶
This section is empty.
Functions ¶
func GenerateNodePoolStackName ¶
TODO: this is temporary
Types ¶
type ImageSelectionCriteria ¶
type ImageSelectionCriteria struct { Region string InstanceType string PKEVersion string KubernetesVersion string OperatingSystem string ContainerRuntime string }
ImageSelectionCriteria contains all parameters for selecting an image.
type ImageSelector ¶
type ImageSelector interface {
SelectImage(ctx context.Context, criteria ImageSelectionCriteria) (string, error)
}
ImageSelector chooses an image based on the selection criteria. It returns an ImageNotFoundError when no images can be found matching the provided criteria.
func DefaultImages ¶
func DefaultImages() ImageSelector
DefaultImages returns an image selector that returns fallback images if no other images are found. These are plain images, so PKE will be installed during the node bootstrapping.
func GPUImages ¶
func GPUImages() ImageSelector
GPUImages returns an image selector that returns GPU accelerated images. These are plain images, so PKE will be installed during the node bootstrapping.
func NewGPUImageSelector ¶
func NewGPUImageSelector(imageSelector ImageSelector) ImageSelector
NewGPUImageSelector returns a new GPU image selector.
type ImageSelectorChain ¶
type ImageSelectorChain struct {
// contains filtered or unexported fields
}
ImageSelectorChain tries to select an image using a number of selectors. When one fails, it moves onto the next in the chain.
func NewImageSelectorChain ¶
func NewImageSelectorChain(logger Logger, errorHandler ErrorHandler) *ImageSelectorChain
NewImageSelectorChain returns a new ImageSelectorChain.
func (*ImageSelectorChain) AddSelector ¶
func (s *ImageSelectorChain) AddSelector(name string, selector ImageSelector)
AddSelector registers a new ImageSelector in the chain.
func (*ImageSelectorChain) SelectImage ¶
func (s *ImageSelectorChain) SelectImage(ctx context.Context, criteria ImageSelectionCriteria) (string, error)
type NoopErrorHandler ¶
type NoopErrorHandler = common.NoopErrorHandler
NoopErrorHandler is an error handler that discards every error.
type NoopLogger ¶
type NoopLogger = common.NoopLogger
NoopLogger is a logger that discards every log event.
type RegionMapImageSelector ¶
RegionMapImageSelector selects an image based on the region in the selection criteria.
func (RegionMapImageSelector) SelectImage ¶
func (r RegionMapImageSelector) SelectImage(_ context.Context, criteria ImageSelectionCriteria) (string, error)