release

package
v2.0.0-...-443e6bf Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SignatureURL    string = "https://mirror.openshift.com/pub/openshift-v4/signatures/openshift/release/"
	SignatureDir    string = "/signatures/"
	ContentType     string = "Content-Type"
	ApplicationJson string = "application/json"
)
View Source
const (
	// GraphMediaType is the media-type specified in the HTTP Accept header
	// of requests sent to the Cincinnati-v1 Graph API.
	GraphMediaType = "application/json"

	// UpdateURL is the Cincinnati endpoint for the OpenShift platform.
	UpdateURL = "https://api.openshift.com/api/upgrades_info/v1/graph"
	// OkdUpdateURL is the Cincinnati endpoint for the OKD platform.
	OkdUpdateURL = "https://origin-release.ci.openshift.org/graph"

	ChannelInfo = "channel %q: %v"
)

Variables

View Source
var ErrNoPreviousRelease = errors.New("no previous release downloads detected")

ErrNoPreviousRelease is returned when no releases can be found in the release channels.

Functions

func CalculateUpgrades

func CalculateUpgrades(ctx context.Context, c Client, arch, sourceChannel, targetChannel string, startVer, reqVer semver.Version) (Update, Update, []Update, error)

CalculateUpgrades fetches and calculates all the update payloads from the specified upstream Cincinnati stack given the current and target version and channel.

func FindRelease

func FindRelease(channels []v1alpha2.ReleaseChannel, min bool) (string, semver.Version, error)

FindRelease will find the minimum or maximum release for a set of ReleaseChannels

func GetChannelMinOrMax

func GetChannelMinOrMax(ctx context.Context, c Client, arch string, channel string, min bool) (semver.Version, error)

GetChannelMinOrMax fetches the minimum or maximum version from the specified upstream Cincinnati stack given architecture and channel.

func GetChannels

func GetChannels(ctx context.Context, c Client, channel string) (map[string]struct{}, error)

GetChannels fetches the channels containing update payloads from the specified upstream Cincinnati stack.

func GetUpdates

func GetUpdates(ctx context.Context, c Client, arch string, channel string, version semver.Version, reqVer semver.Version) (Update, Update, []Update, error)

GetUpdates fetches the requested update payload from the specified upstream Cincinnati stack given the current version, architecture, and channel. The shortest path is calculated between the current and requested version from the graph edge data.

func GetVersions

func GetVersions(ctx context.Context, c Client, arch, channel string) ([]semver.Version, error)

GetVersions will return all update payloads from the specified upstream Cincinnati stack given architecture and channel.

Types

type CincinnatiInterface

type CincinnatiInterface interface {
	GetReleaseReferenceImages(context.Context) []v1alpha3.CopyImageSchema
	NewOCPClient(uuid.UUID) (Client, error)
	NewOKDClient(uuid.UUID) (Client, error)
}

type CincinnatiSchema

type CincinnatiSchema struct {
	Log       clog.PluggableLoggerInterface
	Config    *v1alpha2.ImageSetConfiguration
	Opts      *mirror.CopyOptions
	Client    Client
	Signature SignatureInterface
	Fail      bool
}

func (*CincinnatiSchema) GetReleaseReferenceImages

func (o *CincinnatiSchema) GetReleaseReferenceImages(ctx context.Context) []v1alpha3.CopyImageSchema

func (*CincinnatiSchema) NewOCPClient

func (o *CincinnatiSchema) NewOCPClient(uuid uuid.UUID) (Client, error)

func (*CincinnatiSchema) NewOKDClient

func (o *CincinnatiSchema) NewOKDClient(uuid uuid.UUID) (Client, error)

type Client

type Client interface {
	GetURL() *url.URL
	SetQueryParams(arch, channel, version string)
	GetID() uuid.UUID
	GetTransport() *http.Transport
}

Client is a Cincinnati client which can be used to fetch update graphs from an upstream Cincinnati stack.

func NewOCPClient

func NewOCPClient(id uuid.UUID) (Client, error)

NewOCPClient creates a new OCP Cincinnati client with the given client identifier.

func NewOKDClient

func NewOKDClient(id uuid.UUID) (Client, error)

NewOKDClient creates a new OKD Cincinnati client with the given client identifier.

type Collector

func (*Collector) ReleaseImageCollector

func (o *Collector) ReleaseImageCollector(ctx context.Context) ([]v1alpha3.CopyImageSchema, error)

ReleaseImageCollector - this looks into the operator index image taking into account the mode we are in (mirrorToDisk, diskToMirror) the image is downloaded (preserve originator format could be dockckerv2 or oci) and the index.json is inspected once unmarshalled, the links to manifests are then inspected

type CollectorInterface

type CollectorInterface interface {
	ReleaseImageCollector(ctx context.Context) ([]v1alpha3.CopyImageSchema, error)
}

type Error

type Error struct {
	// Reason is the reason suggested for the Cincinnati calculation error.
	Reason string

	// Message is the message suggested for Cincinnati calculation error..
	Message string
	// contains filtered or unexported fields
}

Error is returned when are unable to get updates.

func (*Error) Error

func (err *Error) Error() string

Error serializes the error as a string, to satisfy the error interface.

type LocalStorageCollector

type LocalStorageCollector struct {
	Log              clog.PluggableLoggerInterface
	Mirror           mirror.MirrorInterface
	Manifest         manifest.ManifestInterface
	Config           v1alpha2.ImageSetConfiguration
	Opts             mirror.CopyOptions
	Cincinnati       CincinnatiInterface
	LocalStorageFQDN string
}

func (*LocalStorageCollector) ReleaseImageCollector

func (o *LocalStorageCollector) ReleaseImageCollector(ctx context.Context) ([]v1alpha3.CopyImageSchema, error)

type SignatureInterface

type SignatureInterface interface {
	GenerateReleaseSignatures(context.Context, []v1alpha3.CopyImageSchema) ([]v1alpha3.CopyImageSchema, error)
}

type SignatureSchema

type SignatureSchema struct {
	Log    clog.PluggableLoggerInterface
	Config *v1alpha2.ImageSetConfiguration
	Opts   *mirror.CopyOptions
}

func (*SignatureSchema) GenerateReleaseSignatures

func (o *SignatureSchema) GenerateReleaseSignatures(ctx context.Context, rd []v1alpha3.CopyImageSchema) ([]v1alpha3.CopyImageSchema, error)

GenerateReleaseSignatures

type Update

type Update node

Update is a single node from the update graph.

func GetUpdatesInRange

func GetUpdatesInRange(ctx context.Context, c Client, channel, arch string, updateRange semver.Range) ([]Update, error)

GetUpdatesInRange will return all update payload within a semver range for a specified channel and architecture.

Jump to

Keyboard shortcuts

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