Documentation ¶
Index ¶
- Constants
- Variables
- func CalculateUpgrades(ctx context.Context, c Client, arch, sourceChannel, targetChannel string, ...) (Update, Update, []Update, error)
- func FindRelease(channels []v1alpha2.ReleaseChannel, min bool) (string, semver.Version, error)
- func GetChannelMinOrMax(ctx context.Context, c Client, arch string, channel string, min bool) (semver.Version, error)
- func GetChannels(ctx context.Context, c Client, channel string) (map[string]struct{}, error)
- func GetUpdates(ctx context.Context, c Client, arch string, channel string, ...) (Update, Update, []Update, error)
- func GetVersions(ctx context.Context, c Client, arch, channel string) ([]semver.Version, error)
- type CincinnatiInterface
- type CincinnatiSchema
- type Client
- type Collector
- type CollectorInterface
- type Error
- type LocalStorageCollector
- type SignatureInterface
- type SignatureSchema
- type Update
Constants ¶
const ( SignatureURL string = "https://mirror.openshift.com/pub/openshift-v4/signatures/openshift/release/" SignatureDir string = "/signatures/" ContentType string = "Content-Type" ApplicationJson string = "application/json" )
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 ¶
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 ¶
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.
Types ¶
type CincinnatiInterface ¶
type CincinnatiInterface interface { GetReleaseReferenceImages(context.Context) []v1alpha3.CopyImageSchema NewOCPClient(uuid.UUID) (Client, error) NewOKDClient(uuid.UUID) (Client, error) }
func NewCincinnati ¶
func NewCincinnati(log clog.PluggableLoggerInterface, config *v1alpha2.ImageSetConfiguration, opts *mirror.CopyOptions, c Client, b bool, sig SignatureInterface) CincinnatiInterface
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 ¶
NewOCPClient creates a new OCP Cincinnati client with the given client identifier.
type Collector ¶
type Collector struct { Log clog.PluggableLoggerInterface Mirror mirror.MirrorInterface Manifest manifest.ManifestInterface Config v1alpha2.ImageSetConfiguration Opts mirror.CopyOptions Cincinnati CincinnatiInterface }
func (*Collector) ReleaseImageCollector ¶
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)
}
func New ¶
func New(log clog.PluggableLoggerInterface, config v1alpha2.ImageSetConfiguration, opts mirror.CopyOptions, mirror mirror.MirrorInterface, manifest manifest.ManifestInterface, cincinnati CincinnatiInterface, ) CollectorInterface
func NewWithLocalStorage ¶
func NewWithLocalStorage(log clog.PluggableLoggerInterface, config v1alpha2.ImageSetConfiguration, opts mirror.CopyOptions, mirror mirror.MirrorInterface, manifest manifest.ManifestInterface, cincinnati CincinnatiInterface, localStorageFQDN string, ) CollectorInterface
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.
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)
}
func NewSignatureClient ¶
func NewSignatureClient(log clog.PluggableLoggerInterface, config *v1alpha2.ImageSetConfiguration, opts *mirror.CopyOptions) SignatureInterface
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