cincinnati

package
v0.1.1-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

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"

	// Update urls
	UpdateUrl    = "https://api.openshift.com/api/upgrades_info/v1/graph"
	OkdUpdateURL = "https://origin-release.ci.openshift.org/graph"
)

Variables

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

Functions

func FindLastRelease

func FindLastRelease(meta v1alpha1.Metadata, channel, url string, uuid uuid.UUID) (string, semver.Version, error)

FindLastRelease will find the latest release that has been recorded in the metadata

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

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

func NewClient

func NewClient(u string, id uuid.UUID) (Client, *url.URL, error)

NewClient creates a new Cincinnati client with the given client identifier.

func (Client) CalculateUpgrades

func (c Client) CalculateUpgrades(ctx context.Context, uri *url.URL, arch, sourceChannel, targetChannel string, version semver.Version, reqVer semver.Version) (Update, Update, []Update, error)

func (Client) GetChannelLatest

func (c Client) GetChannelLatest(ctx context.Context, uri *url.URL, arch string, channel string) (semver.Version, error)

func (Client) GetChannels

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

func (Client) GetUpdates

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

GetUpdates fetches the current and requested (if applicable) update payload from the specified upstream Cincinnati stack given the current version and channel. The next- applicable updates are determined by downloading the update graph, finding the current version within that graph (typically the root node), and then finding all of the children. These children are the available updates for the current version and their payloads indicate from where the actual update image can be downloaded.

func (Client) GetVersions

func (c Client) GetVersions(ctx context.Context, uri *url.URL, channel string) ([]semver.Version, error)

type Error

type Error struct {
	// Reason is the reason suggested for the ClusterOperator status condition.
	Reason string

	// Message is the message suggested for the ClusterOperator status condition.
	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 Update

type Update node

Update is a single node from the update graph.

Jump to

Keyboard shortcuts

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