Documentation
¶
Index ¶
- Constants
- func DeserializeImageMetadata(data []byte) (*stream.Stream, map[string]*stream.Stream, error)
- func DeserializeImageStream(data []byte) (*imageapi.ImageStream, error)
- type CachedProvider
- type CincinnatiVersionResolver
- type ComponentVersion
- type ComponentVersions
- type Provider
- type ProviderWithOpenShiftImageRegistryOverrides
- type ProviderWithOpenShiftImageRegistryOverridesDecorator
- func (p *ProviderWithOpenShiftImageRegistryOverridesDecorator) GetMirroredReleaseImage() string
- func (p *ProviderWithOpenShiftImageRegistryOverridesDecorator) GetOpenShiftImageRegistryOverrides() map[string][]string
- func (p *ProviderWithOpenShiftImageRegistryOverridesDecorator) GetRegistryOverrides() map[string]string
- func (p *ProviderWithOpenShiftImageRegistryOverridesDecorator) Lookup(ctx context.Context, image string, pullSecret []byte) (*ReleaseImage, error)
- type ProviderWithRegistryOverrides
- type RegistryClientProvider
- type RegistryMirrorProviderDecorator
- type ReleaseImage
- type StaticProviderDecorator
- type VersionResolver
Constants ¶
const ( ReleaseImageStreamFile = "release-manifests/image-references" ReleaseImageMetadataFile = "release-manifests/0000_50_installer_coreos-bootimages.yaml" )
const ( StreamRHEL9 = "rhel-9" StreamRHEL10 = "rhel-10" )
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 CincinnatiVersionResolver ¶ added in v0.1.75
type CincinnatiVersionResolver struct {
// contains filtered or unexported fields
}
CincinnatiVersionResolver resolves OpenShift versions to release image pullspecs by querying the Cincinnati graph API (api.openshift.com).
func NewCincinnatiVersionResolver ¶ added in v0.1.75
func NewCincinnatiVersionResolver() *CincinnatiVersionResolver
NewCincinnatiVersionResolver creates a CincinnatiVersionResolver with default settings.
func (*CincinnatiVersionResolver) Resolve ¶ added in v0.1.75
func (r *CincinnatiVersionResolver) Resolve(ctx context.Context, version, channel string) (string, error)
Resolve resolves an OpenShift version (e.g., "4.20.1") to a fully qualified release image pullspec by querying the Cincinnati graph API with the given channel.
type ComponentVersion ¶
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 lexicographic 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 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 ProviderWithOpenShiftImageRegistryOverrides ¶ added in v0.1.10
type ProviderWithOpenShiftImageRegistryOverrides interface {
ProviderWithRegistryOverrides
GetOpenShiftImageRegistryOverrides() map[string][]string
GetMirroredReleaseImage() string
}
type ProviderWithOpenShiftImageRegistryOverridesDecorator ¶ added in v0.1.10
type ProviderWithOpenShiftImageRegistryOverridesDecorator struct {
Delegate ProviderWithRegistryOverrides
OpenShiftImageRegistryOverrides map[string][]string
// contains filtered or unexported fields
}
func (*ProviderWithOpenShiftImageRegistryOverridesDecorator) GetMirroredReleaseImage ¶ added in v0.1.13
func (p *ProviderWithOpenShiftImageRegistryOverridesDecorator) GetMirroredReleaseImage() string
func (*ProviderWithOpenShiftImageRegistryOverridesDecorator) GetOpenShiftImageRegistryOverrides ¶ added in v0.1.10
func (p *ProviderWithOpenShiftImageRegistryOverridesDecorator) GetOpenShiftImageRegistryOverrides() map[string][]string
func (*ProviderWithOpenShiftImageRegistryOverridesDecorator) GetRegistryOverrides ¶ added in v0.1.10
func (p *ProviderWithOpenShiftImageRegistryOverridesDecorator) GetRegistryOverrides() map[string]string
func (*ProviderWithOpenShiftImageRegistryOverridesDecorator) Lookup ¶ added in v0.1.10
func (p *ProviderWithOpenShiftImageRegistryOverridesDecorator) Lookup(ctx context.Context, image string, pullSecret []byte) (*ReleaseImage, error)
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 RegistryMirrorProviderDecorator ¶
type RegistryMirrorProviderDecorator struct {
Delegate Provider
// RegistryOverrides contains the source registry string as a key and the destination registry string as value.
// images before being applied are scanned for the source registry string and if found the string is replaced with
// the destination registry string. This allows hypershift to run in non-crio environments where mirroring is not
// applicable.
RegistryOverrides map[string]string
// contains filtered or unexported fields
}
RegistryMirrorProviderDecorator 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 (*RegistryMirrorProviderDecorator) GetRegistryOverrides ¶
func (p *RegistryMirrorProviderDecorator) GetRegistryOverrides() map[string]string
func (*RegistryMirrorProviderDecorator) Lookup ¶
func (p *RegistryMirrorProviderDecorator) Lookup(ctx context.Context, image string, pullSecret []byte) (*ReleaseImage, error)
type ReleaseImage ¶
type ReleaseImage struct {
*imageapi.ImageStream `json:",inline"`
StreamMetadata *stream.Stream `json:"streamMetadata"`
// OSStreams holds per-stream metadata parsed from the ConfigMap "streams" key.
// Nil for single-stream payloads (OCP < 5.0).
OSStreams map[string]*stream.Stream `json:"-"`
}
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) StreamForName ¶ added in v0.1.77
func (i *ReleaseImage) StreamForName(name string) (*stream.Stream, error)
StreamForName returns stream metadata by name. If name is empty, returns the default stream (StreamMetadata). If name is non-empty, looks up OSStreams and returns an error if the named stream is not found.
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)
type VersionResolver ¶ added in v0.1.75
type VersionResolver interface {
// Resolve resolves a version to a release image pullspec using the given Cincinnati channel.
// The channel should be the full Cincinnati channel string (e.g., "stable-4.20").
Resolve(ctx context.Context, version, channel string) (string, error)
}
VersionResolver resolves an OpenShift version string to a release image pullspec.