Documentation
¶
Overview ¶
Package extension provides public interfaces that a private commercial module can implement to extend podman-api without modifying OSS internals.
Current extension points: BlobStore (backup artifact storage) and SidecarInjector (inject sidecar containers into rendered pod YAML). Future releases will add extension points for RBAC auth and custom ingress controllers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InstanceSecretName ¶ added in v1.0.10
InstanceSecretName returns the per-instance podman secret name the core creates for an InjectedSecret (and template-declared secret). Injectors must use this to build the secretKeyRef.name in the pod YAML they return.
Types ¶
type BlobStore ¶
type BlobStore interface {
Put(ctx context.Context, key string) (BlobWriter, error)
Get(ctx context.Context, key string) (io.ReadCloser, error)
// DeleteAll removes every blob under the directory-like key prefix.
// Removing an absent prefix is a no-op.
DeleteAll(ctx context.Context, prefix string) error
}
BlobStore is where backup artifacts rest. The OSS implementation is a local directory (internal/backup.LocalDir); the commercial S3 backend implements the same seam. Keys are slash-separated relative paths (fs.ValidPath); Get returns an error satisfying errors.Is(err, fs.ErrNotExist) for a missing blob.
type BlobWriter ¶
BlobWriter is one streamed blob write. Exactly one of Commit or Abort must be called; only Commit makes the blob visible to Get. This is the temp-file+rename contract: a failed backup never leaves a partial blob that looks complete.
type InjectedSecret ¶ added in v1.0.9
type InjectedSecret struct {
// Name is the short secret name (e.g. "litestream-s3-key"). The core
// namespaces it to the instance as it does for template-declared secrets.
Name string
// Key is the data key within the Kubernetes Secret. The injected sidecar's
// secretKeyRef.key references this value.
Key string
// Value is the plaintext secret value. The caller MUST NOT log or retain it.
Value string
}
InjectedSecret is a secret declared by a SidecarInjector. The core creates it as a podman secret (using the same SecretCreate / wrapAsKubeSecret path used for template-declared secrets) before PlayKube and reaps it on instance Delete, so the injected sidecar can reference it via secretKeyRef instead of inlining a plaintext value.
type SidecarInjection ¶ added in v1.0.9
type SidecarInjection struct {
// YAML is the (possibly modified) pod manifest. Return the input unchanged
// to pass through.
YAML string
// Secrets is an optional list of secrets the injector needs the core to
// create as podman secrets (referenced via secretKeyRef in YAML). Nil/empty
// means no extra secrets.
Secrets []InjectedSecret
}
SidecarInjection is the return type of SidecarInjector.InjectSidecars.
type SidecarInjector ¶ added in v1.0.8
type SidecarInjector interface {
InjectSidecars(ctx context.Context, renderedYAML string, meta TemplateMeta, params map[string]any, slug string) (SidecarInjection, error)
}
SidecarInjector is a commercial extension point that injects sidecar containers into an instance's pod YAML after the template body has been rendered but before it is applied.
The implementation receives the rendered pod YAML, the projected template metadata, the resolved template parameters, and the instance slug. It returns the (possibly modified) YAML plus any secrets the core must create before PlayKube and prune on delete. Return SidecarInjection{YAML: renderedYAML} to pass through without injection.
type TemplateMeta ¶ added in v1.0.8
type TemplateMeta struct {
// ID is the template identifier (render.Meta.ID).
ID string
// Volumes lists the template's declared volumes and their backup targets.
// The Backup marker is meta-only — it is not present in the rendered pod
// YAML — so a backup/PITR sidecar needs it from here.
Volumes []TemplateVolume
}
TemplateMeta is a read-only projection of a template's metadata, handed to a SidecarInjector. It is a public type so the commercial module can consume it: the internal render.Meta cannot cross the module boundary (it lives under internal/), so the OSS core projects the fields an injector needs into this stable struct. New fields are added here as injectors come to need them.
type TemplateVolume ¶ added in v1.0.8
type TemplateVolume struct {
Name string // volume name as referenced in the pod spec
Backup string // backup target/identifier; empty when not marked for backup
}
TemplateVolume is one volume declared by a template.