releaseinfo

package
v0.0.0-...-9e6982f Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2021 License: Apache-2.0 Imports: 21 Imported by: 7

Documentation

Index

Constants

View Source
const (
	ReleaseImageStreamFile   = "release-manifests/image-references"
	ReleaseImageMetadataFile = "release-manifests/0000_50_installer_coreos-bootimages.yaml"
)

Variables

This section is empty.

Functions

func DeserializeImageStream

func DeserializeImageStream(data []byte) (*imageapi.ImageStream, error)

Types

type CachedProvider

type CachedProvider struct {
	Cache map[string]*ReleaseImage
	Inner Provider
	// contains filtered or unexported fields
}

CachedProvider maintains a simple cache of release image info and only queries the embedded provider when there is no cache hit.

func (*CachedProvider) Lookup

func (p *CachedProvider) Lookup(ctx context.Context, image string, pullSecret []byte) (releaseImage *ReleaseImage, err error)

type ComponentVersion

type ComponentVersion struct {
	Version     string
	DisplayName string
}

ComponentVersion includes the version and optional display name.

func (ComponentVersion) String

func (v ComponentVersion) String() string

String returns the version of this component.

type ComponentVersions

type ComponentVersions map[string]ComponentVersion

ComponentVersions is a map of component names to semantic versions. Names are lowercase alphanumeric and dashes. Semantic versions will have all build labels removed, but prerelease segments are preserved.

func (ComponentVersions) DisplayNameLabel

func (v ComponentVersions) DisplayNameLabel() string

DisplayNameLabel formats the ComponentVersions into a valid display name label.

func (ComponentVersions) OrderedKeys

func (v ComponentVersions) OrderedKeys() []string

OrderedKeys returns the keys in this map in lexigraphic order.

func (ComponentVersions) String

func (v ComponentVersions) String() string

func (ComponentVersions) VersionLabel

func (v ComponentVersions) VersionLabel() string

VersionLabel formats the ComponentVersions into a valid versions label.

type CoreOSAWSImage

type CoreOSAWSImage struct {
	Release string `json:"release"`
	Image   string `json:"image"`
}

type CoreOSAWSImages

type CoreOSAWSImages struct {
	Regions map[string]CoreOSAWSImage `json:"regions"`
}

type CoreOSArchitecture

type CoreOSArchitecture struct {
	// Artifacts is a map of platform name to Artifacts
	Artifacts map[string]CoreOSArtifact `json:"artifacts"`
	Images    CoreOSImages              `json:"images"`
}

type CoreOSArtifact

type CoreOSArtifact struct {
	Release string                             `json:"release"`
	Formats map[string]map[string]CoreOSFormat `json:"formats"`
}

type CoreOSFormat

type CoreOSFormat struct {
	Location           string `json:"location"`
	Signature          string `json:"signature"`
	SHA256             string `json:"sha256"`
	UncompressedSHA256 string `json:"uncompressed-sha256"`
}

type CoreOSImages

type CoreOSImages struct {
	AWS CoreOSAWSImages `json:"aws"`
}

type CoreOSStreamMetadata

type CoreOSStreamMetadata struct {
	Stream        string                        `json:"stream"`
	Architectures map[string]CoreOSArchitecture `json:"architectures"`
}

func DeserializeImageMetadata

func DeserializeImageMetadata(data []byte) (*CoreOSStreamMetadata, error)

type PodProvider

type PodProvider struct {
	Pods    v1.PodInterface
	Secrets v1.SecretInterface
}

PodProvider finds the release image metadata for an image by launching a pod using the image and extracting the serialized ImageStream from the image filesystem assumed to be present at /release-manifests/image-references.

func (*PodProvider) Lookup

func (p *PodProvider) Lookup(ctx context.Context, image string, pullSecret []byte) (releaseImage *ReleaseImage, err error)

type Provider

type Provider interface {
	Lookup(ctx context.Context, image string, pullSecret []byte) (*ReleaseImage, error)
}

Provider knows how to find the release image metadata for an image referred to by its pullspec.

type RegistryClientProvider

type RegistryClientProvider struct {
}

RegistryClientProvider uses a registry client to directly stream image content and extract image metadata.

func (*RegistryClientProvider) Lookup

func (p *RegistryClientProvider) Lookup(ctx context.Context, image string, pullSecret []byte) (releaseImage *ReleaseImage, err error)

type ReleaseImage

type ReleaseImage struct {
	*imageapi.ImageStream `json:",inline"`
	StreamMetadata        *CoreOSStreamMetadata `json:"streamMetadata"`
}

ReleaseImage wraps an ImageStream with some utilities that help the user discover constituent component image information.

func (*ReleaseImage) ComponentImages

func (i *ReleaseImage) ComponentImages() map[string]string

func (*ReleaseImage) ComponentVersions

func (i *ReleaseImage) ComponentVersions() (map[string]string, error)

func (*ReleaseImage) Version

func (i *ReleaseImage) Version() string

type StaticProviderDecorator

type StaticProviderDecorator struct {
	Delegate        Provider
	ComponentImages map[string]string
	// contains filtered or unexported fields
}

StaticProviderDecorator decorates another Provider to add user-specified component name to image mappings. The Lookup implementation will first delegate to the given Delegate, and will then add additional TagReferences to the Delegate's results based on the ComponentImages.

func (*StaticProviderDecorator) Lookup

func (p *StaticProviderDecorator) Lookup(ctx context.Context, image string, pullSecret []byte) (*ReleaseImage, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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