platformimage

package
v1.6.5 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package platformimage is the deployment-config image catalog: the single source of truth for every container image the platform itself runs (database engines, backup tools, the gateway, internal helpers, the agent). Built-in defaults live in code; admins override them at runtime via the settings store (keys prefixed "image."), and an optional global registry mirror repoints all of them at a private registry.

Index

Constants

View Source
const (
	KeyPostgres = "db.postgres"
	KeyMySQL    = "db.mysql"
	KeyMariaDB  = "db.mariadb"
	KeyRedis    = "db.redis"
	KeyMongoDB  = "db.mongodb"
	KeyLibSQL   = "db.libsql"

	KeyBackupPostgres = "backup.postgres"
	KeyBackupMySQL    = "backup.mysql"
	KeyBackupMongoDB  = "backup.mongodb"
	KeyBackupLibSQL   = "backup.libsql"
	KeyBackupVolume   = "backup.volume"

	KeyGoma     = "gateway.goma"
	KeyRelay    = "util.relay"
	KeyHelper   = "util.helper"
	KeyAgent    = "agent"
	KeyRegistry = "util.registry"

	// KeyPack is the one-shot helper image that runs the `pack` CLI to build an
	// app from source with Cloud Native Buildpacks. KeyBuildpackBuilder is the
	// default builder image pack uses when an app does not override it.
	KeyPack             = "build.pack"
	KeyBuildpackBuilder = "build.buildpack-builder"
)

Image catalog keys.

Variables

This section is empty.

Functions

func MirrorSettingKey

func MirrorSettingKey() string

MirrorSettingKey is the settings-store key for the registry mirror.

func RepoTag

func RepoTag(ref string) (repo, tag string)

RepoTag splits an image ref into its repository and tag. A missing tag defaults to "latest". Handles a registry host:port (the colon before a port is not the tag separator).

func SettingKey

func SettingKey(key string) string

SettingKey is the settings-store key for a catalog key's override.

Types

type CatalogItem

type CatalogItem struct {
	Entry
	Override  string `json:"override"`  // raw admin override ("" = none)
	Effective string `json:"effective"` // what the platform will actually run
}

CatalogItem is a catalog entry resolved against the current settings, for the admin API.

type Entry

type Entry struct {
	Key         string `json:"key"`
	Label       string `json:"label"`
	Category    string `json:"category"`
	Default     string `json:"default"`
	Description string `json:"description"`
}

Entry describes a platform image: a stable key, a human label, a category, the built-in default ref, and what it's used for.

type Resolver

type Resolver struct {
	// contains filtered or unexported fields
}

Resolver resolves a catalog key to an effective image ref (admin override -> built-in default), applying the global registry mirror.

func New

func New(store Store, configDefaults map[string]string) *Resolver

New builds a resolver. configDefaults overrides built-in defaults for specific keys (e.g. the gateway/relay images from env config), so env-based config keeps acting as the default with admin overrides layered on top.

func (*Resolver) Catalog

func (r *Resolver) Catalog() []CatalogItem

Catalog returns every image with its default, override, and effective ref, ordered as defined.

func (*Resolver) Mirror

func (r *Resolver) Mirror() string

Mirror returns the configured registry mirror prefix (empty if unset).

func (*Resolver) Ref

func (r *Resolver) Ref(key string) string

Ref returns the effective image ref for a catalog key.

func (*Resolver) ValidKey

func (r *Resolver) ValidKey(key string) bool

ValidKey reports whether key is a known catalog key.

type Store

type Store interface {
	String(key, def string) string
}

Store reads string settings with a default. Satisfied by settings.Provider.

Jump to

Keyboard shortcuts

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