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 metadata is derived entirely from katalog.yaml:
- name, version, description, author, tags from metadata
- required providers from spec.providers
No separate pattern.yaml is required or allowed.
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" // 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 represents 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 fetches the pattern index from the registry index artifact. Returns an empty index (not an error) when no patterns have been pushed yet.
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"` // reserved for future use
}
PatternMeta holds metadata derived from the Katalog.
func LoadPatternMeta ¶
func LoadPatternMeta(dir string) (*PatternMeta, error)
LoadPatternMeta returns pattern metadata for a directory (convenience wrapper).
func ValidateDirectory ¶
func ValidateDirectory(dir string) (*PatternMeta, []string, error)
ValidateDirectory checks that dir contains a valid pattern. Returns metadata (from katalog.yaml) and the list of files to include.
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>/