fresh_container

package
v0.0.0-...-db4d901 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2021 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NextTag

func NextTag(curTag, constraint, tagPrefix string, tags []string) (string, error)

func NextVersion

func NextVersion(curVer semver.Version, constraintRange semver.Range, tagPrefix string, versions semver.Versions) semver.Version

func TagsToVersions

func TagsToVersions(tags []string, tagPrefix string, skipInvalid bool) (versions semver.Versions, err error)

Types

type Client

type Client struct {
	Server string
}

func NewClient

func NewClient(server string) Client

func (*Client) EvalUpgrade

func (c *Client) EvalUpgrade(image, constraint, tagPrefix string) (RemoteEvaluationResponse, error)

type Image

type Image struct {
	registry.Image
	TagVersion  semver.Version
	TagVersions semver.Versions
	TagPrefix   string
}

Image is an extended struct that represents an Image

func NewImage

func NewImage(image, tagPrefix string) (Image, error)

func (*Image) EvalUpgrade

func (image *Image) EvalUpgrade(constraint string) (ImageUpgradeEvaluationResponse, error)

func (*Image) FetchTags

func (image *Image) FetchTags(ctx context.Context, cfg *config.Config) error

FetchTags queries the registry that holds the image to assess the tags it has. The tags are automatically converted to semver.Version objects and stored into the `TagVersions` field. Note well: invalid tags are going to be ignored.

func (*Image) FullNameWithoutTag

func (image *Image) FullNameWithoutTag() string

func (*Image) SetTagVersions

func (image *Image) SetTagVersions(tags []string, skipInvalid bool) error

type ImageUpgradeEvaluationResponse

type ImageUpgradeEvaluationResponse struct {
	Image          string `json:"image"`
	Constraint     string `json:"constraint"`
	TagPrefix      string `json:"tagPrefix"`
	CurrentVersion string `json:"current_version"`
	NextVersion    string `json:"next_version"`
	Stale          bool   `json:"stale"`
}

type RemoteEvaluationResponse

type RemoteEvaluationResponse struct {
	Pending  bool
	Response ImageUpgradeEvaluationResponse
	// contains filtered or unexported fields
}

func (*RemoteEvaluationResponse) IsReady

func (re *RemoteEvaluationResponse) IsReady() (bool, error)

Jump to

Keyboard shortcuts

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