Documentation
¶
Overview ¶
pkg/registry/client.go
ORAS-based OCI client for pushing and pulling Orkestra patterns.
Authentication uses ~/.docker/config.json via oras.land/oras-go/v2. No separate login step — docker login ghcr.io is sufficient.
Push: validates the directory, reads each file, pushes as OCI layers. Pull: fetches the manifest, extracts layers to the cache directory. Info: fetches the manifest only, reads annotations. List: fetches the index artifact from the registry root.
pkg/registry/pattern.go
Pattern is the atomic unit of the Orkestra Registry. A pattern directory contains:
katalog.yaml — operator declaration (required) crd.yaml — CRD schema (required) README.md — human documentation (optional) cr.yaml — example CR (optional) pattern.yaml — registry metadata (optional, overrides derived fields)
The pattern metadata is primarily derived from katalog.yaml (metadata.name, metadata.version, metadata.author, metadata.description, spec.providers). If pattern.yaml is present, its fields override the derived values.
pkg/registry/resolve.go
Reference resolution for ork registry commands.
A bare reference like "postgres:v14" is resolved to a full OCI reference using the following priority:
- Full OCI reference (starts with "oci://") — used as-is
- ORKESTRA_REGISTRY env var + "/name:version"
- Default: ghcr.io/orkspace/orkestra-registry/name:version
The "oci://" prefix is stripped before passing to ORAS — it is a user-facing convention to signal "this is an OCI reference", not part of the actual URL.
Index ¶
- Constants
- type ChangelogEntry
- type Client
- func (c *Client) Info(ctx context.Context, ref *Ref) (*PatternInfo, error)
- func (c *Client) List(ctx context.Context, registryURL string) (*PatternIndex, error)
- func (c *Client) Pull(ctx context.Context, ref *Ref, refresh bool) (string, error)
- func (c *Client) Push(ctx context.Context, ref *Ref, dir string, ...) (string, error)
- type PatternEntry
- type PatternIndex
- type PatternInfo
- type PatternMeta
- type PatternRequires
- type Ref
Constants ¶
const ( // MediaType is the OCI artifact media type for Orkestra patterns. MediaType = "application/vnd.orkestra.pattern.v1+tar+gzip" // FileKatalog is the required operator declaration file. FileKatalog = "katalog.yaml" // FileCRD is the required CRD schema file. FileCRD = "crd.yaml" // FilePattern is the optional registry metadata file. FilePattern = "pattern.yaml" // FileReadme is the human documentation file. FileReadme = "README.md" // FileCR is the example CR file. FileCR = "cr.yaml" )
const ( // DefaultRegistry is the official Orkestra pattern registry. DefaultRegistry = "ghcr.io/orkspace/orkestra-registry/patterns" // EnvRegistry is the environment variable for overriding the registry. EnvRegistry = "ORKESTRA_REGISTRY" // CacheDir is the local cache directory for pulled patterns. // Resolved relative to the user's home directory. CacheDir = ".orkestra/registry" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChangelogEntry ¶
ChangelogEntry is one version entry in the changelog.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps ORAS for Orkestra pattern operations.
func (*Client) List ¶
List enumerates patterns in the registry by walking its repository catalog. For each repository under the base namespace, it fetches the manifest annotations to build the pattern index on the fly.
type PatternEntry ¶
type PatternEntry struct {
Name string `json:"name"`
LatestVersion string `json:"latestVersion"`
Description string `json:"description"`
Tags []string `json:"tags"`
Author string `json:"author,omitempty"`
}
PatternEntry is one row in the pattern index.
type PatternIndex ¶
type PatternIndex struct {
UpdatedAt string `json:"updatedAt"`
Patterns []PatternEntry `json:"patterns"`
}
PatternIndex is the top-level index stored at registry/index:latest.
type PatternInfo ¶
PatternInfo holds the metadata returned by Info.
type PatternMeta ¶
type PatternMeta struct {
Name string `yaml:"name"`
Version string `yaml:"version"`
Description string `yaml:"description"`
Author string `yaml:"author,omitempty"`
License string `yaml:"license,omitempty"`
Tags []string `yaml:"tags,omitempty"`
Requires PatternRequires `yaml:"requires,omitempty"`
Changelog []ChangelogEntry `yaml:"changelog,omitempty"`
}
PatternMeta is the schema for pattern metadata. Derived from katalog.yaml (and optionally pattern.yaml/CRD).
func LoadPatternMeta ¶
func LoadPatternMeta(dir string) (*PatternMeta, error)
LoadPatternMeta reads pattern metadata from the given directory, following the same derivation rules as ValidateDirectory.
func ValidateDirectory ¶
func ValidateDirectory(dir string) (*PatternMeta, []string, error)
ValidateDirectory validates that dir contains a valid pattern. Returns the pattern metadata (derived from katalog.yaml, overridden by pattern.yaml if present), and the list of files to include in the OCI artifact.
func (*PatternMeta) Validate ¶
func (m *PatternMeta) Validate() error
Validate checks required fields.
type PatternRequires ¶
type PatternRequires struct {
Providers []string `yaml:"providers,omitempty"`
}
PatternRequires declares external dependencies.
type Ref ¶
type Ref struct {
// Registry is the hostname (e.g. "ghcr.io").
Registry string
// Repository is the full repository path without the registry
// (e.g. "orkspace/orkestra-registry/postgres").
Repository string
// Tag is the version tag (e.g. "v14").
Tag string
// Full is the complete reference without the oci:// prefix.
// Suitable for passing directly to ORAS.
Full string
}
Ref holds a resolved OCI reference.
func Resolve ¶
Resolve converts a user-supplied reference to a fully qualified OCI Ref.
"postgres:v14" → ghcr.io/orkspace/orkestra-registry/postgres:v14 "oci://ghcr.io/myorg/patterns/redis:v7" → ghcr.io/myorg/patterns/redis:v7 "myorg/redis:v7" (with ORKESTRA_REGISTRY set) → resolved against env
func (*Ref) CachePath ¶
CachePath returns the local filesystem path for this ref. Structure: ~/.orkestra/registry/<registry>/<repository>/<tag>/