/
artifacts.go
62 lines (52 loc) · 1.95 KB
/
artifacts.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// 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"
OverlayManifestImage = "siderolabs/overlays"
)
const tmpSuffix = "-tmp"
// ErrNotFoundTag tags the errors when the artifact is not found.
type ErrNotFoundTag = struct{}