dependencies

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package dependencies defines and resolves runtime dependencies for the Podmin CLI.

Index

Constants

This section is empty.

Variables

View Source
var Catalog = []Dependency{
	{
		Key: "containerd", Major: 2,
		Releases:          "https://api.github.com/repos/containerd/containerd/releases",
		Architectures:     map[string]string{"amd64": "amd64", "arm64": "arm64"},
		AssetName:         "containerd-{version}-linux-{architecture}.tar.gz",
		AssetURL:          "https://github.com/containerd/containerd/releases/download/v{version}/{asset}",
		ChecksumURL:       "{url}.sha256sum",
		ChecksumName:      "{asset}",
		ChecksumAlgorithm: "sha256",
		ObjectName:        "containerd.tar.gz",
	},
	{
		Key: "gvisor", ReleaseStyle: gvisorRelease,
		Releases:          "https://api.github.com/repos/google/gvisor/tags?per_page=100",
		Architectures:     map[string]string{"amd64": "x86_64", "arm64": "aarch64"},
		AssetName:         "gvisor.tar.bz2",
		AssetURL:          "https://storage.googleapis.com/gvisor/releases/release/{version}/{architecture}/{asset}",
		ChecksumURL:       "{url}.sha512",
		ChecksumName:      "{asset}",
		ChecksumAlgorithm: "sha512",
		ObjectName:        "gvisor.tar.bz2",
	},
	{
		Key: "cni-plugins", Major: 1,
		Releases:          "https://api.github.com/repos/containernetworking/plugins/releases",
		Architectures:     map[string]string{"amd64": "amd64", "arm64": "arm64"},
		AssetName:         "cni-plugins-linux-{architecture}-v{version}.tgz",
		AssetURL:          "https://github.com/containernetworking/plugins/releases/download/v{version}/{asset}",
		ChecksumURL:       "{url}.sha256",
		ChecksumName:      "{asset}",
		ChecksumAlgorithm: "sha256",
		ObjectName:        "cni-plugins.tar.gz",
	},
	{
		Key: "kubelet", Major: 1, Minor: 36,
		Releases:          "https://api.github.com/repos/kubernetes/kubernetes/releases",
		Architectures:     map[string]string{"amd64": "amd64", "arm64": "arm64"},
		AssetName:         "kubelet",
		AssetURL:          "https://dl.k8s.io/release/v{version}/bin/linux/{architecture}/kubelet",
		ChecksumURL:       "{url}.sha512",
		ChecksumName:      "{asset}",
		ChecksumAlgorithm: "sha512",
		ObjectName:        "kubelet",
	},
	{
		Key: "coredns", Major: 1,
		Releases:          "https://api.github.com/repos/coredns/coredns/releases",
		Architectures:     map[string]string{"amd64": "amd64", "arm64": "arm64"},
		AssetName:         "coredns_{version}_linux_{architecture}.tgz",
		AssetURL:          "https://github.com/coredns/coredns/releases/download/v{version}/{asset}",
		ChecksumURL:       "{url}.sha256",
		ChecksumName:      "{asset}",
		ChecksumAlgorithm: "sha256",
		ObjectName:        "coredns.tar.gz",
	},
	{
		Key: "zot", Major: 2,
		Releases:          "https://api.github.com/repos/project-zot/zot/releases",
		Architectures:     map[string]string{"amd64": "amd64", "arm64": "arm64"},
		AssetName:         "zot-linux-{architecture}-minimal",
		AssetURL:          "https://github.com/project-zot/zot/releases/download/v{version}/{asset}",
		ChecksumURL:       "https://github.com/project-zot/zot/releases/download/v{version}/checksums.sha256.txt",
		ChecksumName:      "{asset}",
		ChecksumAlgorithm: "sha256",
		ObjectName:        "zot.tar.gz",
		WrapBinary:        "zot",
	},
	{
		Key: "podmin-agent", ReleaseStyle: agentRelease,
		Releases:          "https://api.github.com/repos/podmin-dev/podmin/releases",
		Architectures:     map[string]string{"amd64": "amd64", "arm64": "arm64"},
		AssetName:         "podmin-agent_{version}_linux_{architecture}.tar.gz",
		AssetURL:          "https://github.com/podmin-dev/podmin/releases/download/v{version}/{asset}",
		ChecksumURL:       "https://github.com/podmin-dev/podmin/releases/download/v{version}/podmin_{version}_checksums.txt",
		ChecksumName:      "{asset}",
		ChecksumAlgorithm: "sha512",
		ObjectName:        "podmin-agent.tar.gz",
	},
}

Catalog is the complete runtime dependency catalog. URL fields accept {version}, {architecture}, {asset}, and {url} substitutions.

Functions

func Resolve

func Resolve(ctx context.Context, client *http.Client, dependency Dependency) (string, error)

Resolve returns the greatest stable release satisfying the version constraint.

Types

type Artifact

type Artifact struct {
	Name, Version, Architecture, ObjectKey, Digest, Path string
}

Artifact is one verified architecture-specific bootstrap dependency.

type Dependency

type Dependency struct {
	Key               string
	Major             int
	Minor             int
	ReleaseStyle      releaseStyle
	Releases          string
	Architectures     map[string]string
	AssetName         string
	AssetURL          string
	ChecksumURL       string
	ChecksumName      string
	ChecksumAlgorithm string
	ObjectName        string
	WrapBinary        string
}

Dependency describes one version-constrained upstream artifact.

type Fetcher

type Fetcher struct {
	Client       *http.Client
	CacheDir     string
	SourceDir    string
	AgentVersion string
	// contains filtered or unexported fields
}

Fetcher resolves and caches the canonical bootstrap dependencies.

func (*Fetcher) Fetch

func (f *Fetcher) Fetch(ctx context.Context, architecture string) ([]Artifact, error)

Fetch downloads and verifies every dependency required by architecture.

type Object

type Object struct {
	Key, Group, Version string
	Modified            time.Time
}

Object is retention metadata for one uploaded dependency object.

func Expired

func Expired(objects []Object, now time.Time) []Object

Expired selects versions beyond the newest two when all their objects are 28 days old.

Jump to

Keyboard shortcuts

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