Documentation
¶
Overview ¶
Package imagepolicy decides whether a tenant may use an image: a per-tenant allow list and a platform deny list of "registry/repository-prefix" entries, and the refusal of references that already point at the platform's image cache.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Normalize ¶
Normalize returns "registry/repository" of an image reference in its canonical form: lowercase host without a trailing dot or default port, the Docker Hub spellings as docker.io, and docker.io defaults ("nginx" is "docker.io/library/nginx"); tag and digest are dropped. A reference with empty, "." or ".." path components or characters outside printable ASCII is refused.
Types ¶
type Policy ¶
type Policy struct {
// Allow: when not empty the image must lie under one of the entries.
Allow []string
// Deny: the image must lie under none of the entries (the platform's private repositories).
Deny []string
// CachePrefixes are the host:port addresses of the platform registry and image cache. A
// tenant names the original image; the operator routes it through the cache, so a
// reference that already points at the cache would reach what it holds for other users.
CachePrefixes []string
}
Policy is what one tenant's images are checked against.