Documentation ¶
Index ¶
- Constants
- func CliCommands() []*cli.Command
- type Artifact
- func (a *Artifact) BaseContainerName(registryAndOrg, id string) (string, error)
- func (a *Artifact) BaseTag() (string, error)
- func (a *Artifact) BootableName() (string, error)
- func (a *Artifact) ContainerName(registryAndOrg string) (string, error)
- func (a *Artifact) OSReleaseVariables(registryAndOrg, githubRepo, bugURL, homeURL string) (string, error)
- func (a *Artifact) Repository(registryAndOrg string) string
- func (a *Artifact) SoftwareVersionForTag() string
- func (a *Artifact) Tag() (string, error)
- func (a *Artifact) TagList(registryAndOrg string) (TagList, error)
- func (a *Artifact) Validate() error
- func (a *Artifact) ValidateBase() error
- func (a *Artifact) VersionForTag() string
- type DefaultRegistryInspector
- type RegistryInspector
- type TagList
- func (tl TagList) FullImages() ([]string, error)
- func (tl TagList) Images() TagList
- func (tl TagList) Len() int
- func (tl TagList) Less(i, j int) bool
- func (tl TagList) NewerAnyVersion() TagList
- func (tl TagList) NewerSofwareVersions() TagList
- func (tl TagList) NewerVersions() TagList
- func (tl TagList) NoPrereleases() TagList
- func (tl TagList) OtherAnyVersion() TagList
- func (tl TagList) OtherSoftwareVersions() TagList
- func (tl TagList) OtherVersions() TagList
- func (tl TagList) Print()
- func (tl TagList) PrintImages()
- func (tl TagList) RSorted() TagList
- func (tl TagList) Sorted() TagList
- func (tl TagList) Swap(i, j int)
Constants ¶
const ( // KAIROS_VERSION was already used in os-release and we avoided breaking it // for consumers by using a new variable KAIROS_RELEASE instead. But it's the // "Artifact.Version". EnvVarVersion = "RELEASE" EnvVarFlavor = "FLAVOR" EnvVarFlavorRelease = "FLAVOR_RELEASE" EnvVarVariant = "VARIANT" EnvVarModel = "MODEL" EnvVarArch = "TARGETARCH" EnvVarSoftwareVersion = "SOFTWARE_VERSION" EnvVarSoftwareVersionPrefix = "SOFTWARE_VERSION_PREFIX" EnvVarRegistryAndOrg = "REGISTRY_AND_ORG" EnvVarID = "ID" EnvVarGithubRepo = "GITHUB_REPO" EnvVarBugReportURL = "BUG_REPORT_URL" EnvVarHomeURL = "HOME_URL" EnvVarFamily = "FAMILY" )
Variables ¶
This section is empty.
Functions ¶
func CliCommands ¶
func CliCommands() []*cli.Command
Types ¶
type Artifact ¶
type Artifact struct { Flavor string Family string FlavorRelease string Variant string Model string Arch string Version string // The Kairos version. E.g. "v2.4.2" SoftwareVersion string // The k3s version. E.g. "v1.26.9+k3s1" SoftwareVersionPrefix string // E.g. k3s RegistryInspector RegistryInspector }
func NewArtifactFromJSON ¶
func NewArtifactFromOSRelease ¶
NewArtifactFromOSRelease generates an artifact by inpecting the variables in the /etc/os-release file of a Kairos image. The variable should be prefixed with "KAIROS_". E.g. KAIROS_VARIANT would be used to set the Variant field. The function optionally takes an argument to specify a different file path (for testing reasons).
func (*Artifact) BaseContainerName ¶
func (*Artifact) BootableName ¶
func (*Artifact) ContainerName ¶
func (*Artifact) OSReleaseVariables ¶
func (a *Artifact) OSReleaseVariables(registryAndOrg, githubRepo, bugURL, homeURL string) (string, error)
OSReleaseVariables returns a set of variables to be appended in /etc/os-release
func (*Artifact) Repository ¶ added in v0.0.19
func (*Artifact) SoftwareVersionForTag ¶ added in v0.0.19
SoftwareVersionForTag replaces and "+" symbols with "-" because in container image tags, "+" is not valid
func (*Artifact) ValidateBase ¶ added in v0.0.22
func (*Artifact) VersionForTag ¶ added in v0.0.19
VersionForTag replaces and "+" symbols with "-" because in container image tags, "+" is not valid
type DefaultRegistryInspector ¶
type DefaultRegistryInspector struct{}
type RegistryInspector ¶
type TagList ¶
func (TagList) FullImages ¶ added in v0.0.19
FullImages returns a slice of strings which has the tags converts to full image URLs (not just tags).
func (TagList) Images ¶
Images returns only tags that represent images, skipping tags representing: - sbom - att - sig - -img
func (TagList) NewerAnyVersion ¶
NewerAnyVersion returns tags with:
- a kairos version newer than the given artifact's
- a kairos version same as the given artifacts but a software version higher than the current artifact's
Splitting the 2 versions is done using the artifact's SoftwareVersionPrefix (first encountered, because our tags have a "k3s1" in the end too)
func (TagList) NewerSofwareVersions ¶
NewerSofwareVersions returns OtherSoftwareVersions filtered to only include tags with SoftwareVersion higher than the given artifact's.
func (TagList) NewerVersions ¶
NewerVersions returns OtherVersions filtered to only include tags with Version higher than the given artifact's.
func (TagList) NoPrereleases ¶ added in v0.0.19
NoPrereleases returns only tags in which Version is not a pre-release (as defined by semver). NOTE: We only filter out Kairos prereleases because the k3s version is not semver anyway. The upstream version is something like: v1.28.3+k3s2 The first part is semver and it's the Kubernetes version and the "+k3s2" part is the k3s version which has changes over "k3s1" (it's not just a new build of the same thing)(https://github.com/k3s-io/k3s/releases/tag/v1.28.3%2Bk3s2) To make things more complicated, when we create a container image tag, we convert "+" to "-" because tags don't allow "+" symbols. This makes every k3s version look like a pre-release according to semver.
func (TagList) OtherAnyVersion ¶
OtherAnyVersion returns tags that match all fields of the given Artifact, except the SoftwareVersion and/or Version. Should be used to return tags with newer versions (Kairos or "software") that one could upgrade to. This method returns all versions, not only newer ones. Use NewerAnyVersion to fetch only versions, newer than the one of the Artifact.
func (TagList) OtherSoftwareVersions ¶
OtherSoftwareVersions returns tags that match all fields of the given Artifact, except the SoftwareVersion. Should be used to return other possible software versions for the same Kairos image (e.g. that one could upgrade to). This method returns all versions, not only newer ones. Use NewerSofwareVersions to fetch only versions, newer than the one of the Artifact.
func (TagList) OtherVersions ¶
OtherVersions returns tags that match all fields of the given Artifact, except the Version. Should be used to return other possible versions for the same Kairos image (e.g. that one could upgrade to). This method returns all versions, not only newer ones. Use NewerVersions to fetch only versions, newer than the one of the Artifact.
func (TagList) PrintImages ¶ added in v0.0.19
func (tl TagList) PrintImages()
func (TagList) RSorted ¶
RSorted returns the TagList in the reverse order of Sorted This means higher versions come first.