mirror of
https://github.com/siderolabs/image-factory.git
synced 2025-12-05 09:31:17 +01:00
Now Image Factory filters out pre-release versions for all releases but the last one. In the UI, now pre-release versions are shown. Return proper 404 not found when someone requests something for an unsupported version. Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
62 lines
1.9 KiB
Go
62 lines
1.9 KiB
Go
// This Source Code Form is subject to the terms of the Mozilla Public
|
|
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
// Package artifacts handles acquiring and caching source Talos artifacts.
|
|
package artifacts
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/blang/semver/v4"
|
|
"github.com/google/go-containerregistry/pkg/v1/remote"
|
|
"github.com/sigstore/cosign/v2/pkg/cosign"
|
|
)
|
|
|
|
// Options are the options for the artifacts manager.
|
|
type Options struct { //nolint:govet
|
|
// ImageRegistry is the registry which stores imager, extensions, etc..
|
|
//
|
|
// For official images, this is "ghcr.io".
|
|
ImageRegistry string
|
|
// Option to allow using an image registry without TLS.
|
|
InsecureImageRegistry bool
|
|
// MinVersion is the minimum version of Talos to use.
|
|
MinVersion semver.Version
|
|
// ImageVerifyOptions are the options for verifying the image signature.
|
|
ImageVerifyOptions cosign.CheckOpts
|
|
// TalosVersionRecheckInterval is the interval for rechecking Talos versions.
|
|
TalosVersionRecheckInterval time.Duration
|
|
// RemoteOptions is the list of remote options for the puller.
|
|
RemoteOptions []remote.Option
|
|
}
|
|
|
|
// Kind is the artifact kind.
|
|
type Kind string
|
|
|
|
// Supported artifact kinds.
|
|
const (
|
|
KindKernel Kind = "vmlinuz"
|
|
KindInitramfs Kind = "initramfs.xz"
|
|
KindSystemdBoot Kind = "systemd-boot.efi"
|
|
KindSystemdStub Kind = "systemd-stub.efi"
|
|
KindDTB Kind = "dtb"
|
|
KindUBoot Kind = "u-boot"
|
|
KindRPiFirmware Kind = "raspberrypi-firmware"
|
|
)
|
|
|
|
// FetchTimeout controls overall timeout for fetching artifacts for a release.
|
|
const FetchTimeout = 20 * time.Minute
|
|
|
|
// Various images.
|
|
const (
|
|
InstallerImage = "siderolabs/installer"
|
|
ImagerImage = "siderolabs/imager"
|
|
ExtensionManifestImage = "siderolabs/extensions"
|
|
)
|
|
|
|
const tmpSuffix = "-tmp"
|
|
|
|
// ErrNotFoundTag tags the errors when the artifact is not found.
|
|
type ErrNotFoundTag = struct{}
|