imagepolicy

package
v1.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

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

func Normalize(ref string) (string, error)

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.

func (Policy) Check

func (p Policy) Check(ref string) error

Check returns an error when the tenant may not use the image.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL