Documentation ¶
Index ¶
- Constants
- func ParseImagesFromFile(filePath string) (registry.Images, error)
- func ParseImagesYAML(b []byte) (registry.Images, error)
- func ValidateDigest(digest image.Digest) error
- func ValidateTag(tag image.Tag) error
- func ValidateThinManifestDirectoryStructure(dir string) error
- type Manifest
- type ThinManifest
Constants ¶
const ( // ThinManifestDepth specifies the number of items in a path if we split the // path into its parts, starting from the "topmost" folder given as an // argument to -thin-manifest-dir. E.g., a well-formed path is something // like: // // ["", "manifests", "foo", "promoter-manifests.yaml"] // // . This is a result of some path handling/parsing logic in // ValidateThinManifestDirectoryStructure(). ThinManifestDepth = 4 )
Variables ¶
This section is empty.
Functions ¶
func ParseImagesFromFile ¶
ParseImagesFromFile parses an Images type from a file.
func ParseImagesYAML ¶
ParseImagesYAML parses Images from a byteslice.
func ValidateDigest ¶
ValidateDigest validates the digest.
func ValidateThinManifestDirectoryStructure ¶
ValidateThinManifestDirectoryStructure enforces a particular directory structure for thin manifests. Most importantly, it requires that if a file named "foo/manifests/bar/promoter-manifest.yaml" exists, that a corresponding file named "foo/images/bar/promoter-manifest.yaml" must also exist.
Types ¶
type Manifest ¶
type Manifest struct { // Registries contains the source and destination (Src/Dest) registry names. // There must be at least 2 registries: 1 source registry and 1 or more // destination registries. Registries []registry.Context `yaml:"registries,omitempty"` Images []registry.Image `yaml:"images,omitempty"` // Hidden fields; these are data structure optimizations that are populated // from the fields above. As they are redundant, there is no point in // storing this information in YAML. SrcRegistry *registry.Context Filepath string }
Manifest stores the information in a manifest file (describing the desired state of a Docker Registry).
func ParseManifestFromFile ¶
ParseManifestFromFile parses a Manifest from a filepath.
func ParseManifestYAML ¶
ParseManifestYAML parses a Manifest from a byteslice. This function is separate from ParseManifestFromFile() so that it can be tested independently.
func ParseThinManifestFromFile ¶
ParseThinManifestFromFile parses a ThinManifest from a filepath and generates a Manifest.
func ParseThinManifestsFromDir ¶
ParseThinManifestsFromDir parses all thin Manifest files within a directory. We effectively have to create a map of manifests, keyed by the source registry (there can only be 1 source registry).
func (*Manifest) ToRegInvImage ¶
func (m *Manifest) ToRegInvImage() registry.RegInvImage
ToRegInvImage converts a Manifest into a RegInvImage.
type ThinManifest ¶
type ThinManifest struct { Registries []registry.Context `yaml:"registries,omitempty"` ImagesPath string `yaml:"imagesPath,omitempty"` }
ThinManifest is a more secure Manifest because it does not define the Images[] directly, but moves it to a separate location. The idea is to define a ThinManifest type as a YAML in one folder, and to define the []Image in another folder, and to have far stricter ACLs for the ThinManifest type. Then, PRs modifying just the []Image YAML won't be able to modify the src/destination repos or the credentials tied to them.
func ParseThinManifestYAML ¶
func ParseThinManifestYAML(b []byte) (ThinManifest, error)
ParseThinManifestYAML parses a ThinManifest from a byteslice.