Documentation ¶
Index ¶
- Constants
- func GetImageStreamUsage(is *imageapi.ImageStream) corev1.ResourceList
- func NewImageLimitRangerPlugin(config io.Reader) (admission.Interface, error)
- func Register(plugins *admission.Plugins)
- type InternalImageReferenceHandler
- type LimitRangesForNamespaceFunc
- type LimitVerifier
- type NamespaceLimiter
Constants ¶
const (
PluginName = "image.openshift.io/ImageLimitRange"
)
Variables ¶
This section is empty.
Functions ¶
func GetImageStreamUsage ¶
func GetImageStreamUsage(is *imageapi.ImageStream) corev1.ResourceList
GetImageStreamUsage counts number of unique internally managed images occupying given image stream. It returns a number of unique image references found in the image stream spec not contained in processedSpecRefs and a number of unique image hashes contained in iS status not contained in processedStatusRefs. Given sets will be updated with new references found.
func NewImageLimitRangerPlugin ¶
NewImageLimitRangerPlugin provides a new imageLimitRangerPlugin.
Types ¶
type InternalImageReferenceHandler ¶
InternalImageReferenceHandler is a function passed to the computer when processing images that allows a caller to perform actions on image references. The handler is called on a unique image reference just once. Argument inSpec says whether the image reference is present in an image stream spec. The inStatus says the same for an image stream status.
The reference can either be:
- a docker image reference (e.g. 172.30.12.34:5000/test/is2:tag)
- an image stream tag (e.g. project/isname:latest)
- an image ID (e.g. sha256:2643199e5ed5047eeed22da854748ed88b3a63ba0497601ba75852f7b92d4640)
The first two a can be obtained only from IS spec. Processing of IS status can generate only the 3rd option.
The docker image reference will always be normalized such that registry url is always specified while a default docker namespace and tag are stripped.
type LimitRangesForNamespaceFunc ¶
type LimitRangesForNamespaceFunc func(namespace string) ([]*corev1.LimitRange, error)
func (LimitRangesForNamespaceFunc) LimitsForNamespace ¶
func (fn LimitRangesForNamespaceFunc) LimitsForNamespace(namespace string) (corev1.ResourceList, error)
type LimitVerifier ¶
type LimitVerifier interface {
VerifyLimits(namespace string, is *imageapi.ImageStream) error
}
func NewLimitVerifier ¶
func NewLimitVerifier(limiter NamespaceLimiter) LimitVerifier
NewLimitVerifier accepts a NamespaceLimiter
type NamespaceLimiter ¶
type NamespaceLimiter interface {
LimitsForNamespace(namespace string) (corev1.ResourceList, error)
}