Documentation
¶
Index ¶
- func GetLatestChart(ctx context.Context, storageURL, app, appVersion string) (string, error)
- func GetLatestVersion(ctx context.Context, storageURL, app, appVersion string) (string, error)
- func IsNotFound(err error) bool
- func MatchesVersion(chartVersion, appVersion string) bool
- func NewTarballURL(baseURL string, appName string, version string) (string, error)
- type Entry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLatestChart ¶
GetLatestChart returns the latest chart tarball file for the specified storage URL and app and returns notFoundError when it can't find a specified app.
func GetLatestVersion ¶
GetLatestVersion returns the latest app version for the specified storage URL and app and returns notFoundError when it can't find a specified app.
func MatchesVersion ¶ added in v1.1.0
MatchesVersion reports whether a published chart version satisfies the requested appVersion.
It is exported because the same rule is needed outside chart resolution: apptest compares a deployed App CR's status version against the commit SHA under test with the very same suffix assumption, and would otherwise have to duplicate this logic.
architect used to publish charts as "<version>-<full 40 character SHA>", so a plain suffix test matched a caller passing CIRCLE_SHA1. Since architect orb 9.x the format is a gitsemver development version as shown above (v2 schema with architect, v3 schema with App Build Suite); both abbreviate the trailing SHA to seven characters -- a full SHA can never match that by suffix, and every lookup fails with notFoundError even though the chart was published correctly. Accept all formats so callers can keep passing the full SHA whichever tool published the chart.
appVersion is also legitimately a plain chart version: apptest passes App.Version when App.SHA is empty. The abbreviated comparison therefore only applies when appVersion actually looks like a git object name, leaving the version path exactly as it was.
Types ¶
type Entry ¶ added in v0.4.0
type Entry struct {
AppVersion string `json:"appVersion"`
Created time.Time `json:"created"`
Description string `json:"description"`
Home string `json:"home"`
Icon string `json:"icon"`
Keywords []string `json:"keywords"`
Name string `json:"name"`
Urls []string `json:"urls"`
Version string `json:"version"`
}