Help us shape the future of Go! Take the 2026 Go Developer Survey

providerbinding

package
v0.4.26 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package providerbinding connects reviewed provider adapters to the existing Core runtime and recovery seams. It does not schedule updates or own SQL migrations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dependencies

type Dependencies struct {
	Inventory              RuntimeInventory
	OpenBaoExecutor        nativebao.Executor
	OpenBaoFiles           bhruntime.Files
	OpenBaoHooks           openbao.RuntimeHooks
	KeycloakDataDir        string
	KeycloakNamespace      string
	KeycloakInstallationID string
	KeycloakIssuer         string
	KeycloakHooks          keycloak.CoreHooks
}

Dependencies are supplied by the existing Core installation/update engine. Snapshot, restore and pinned reconciliation always remain Core-owned.

type Failure

type Failure struct {
	Code             string
	Retryable        bool
	RecoveryRequired bool
}

Failure is the central journal-facing classification of a provider adapter failure. The caller must not infer safe retry solely from network errors.

func Classify

func Classify(err error, mutated bool) Failure

type ManagedSource

type ManagedSource struct {
	Project        string
	Service        string
	Compose        string
	OriginalImage  string
	OriginalDigest string
}

ManagedSource names only existing, installation-owned Core services. Names are configuration/evidence selectors, never user-supplied mutation targets.

type Registry

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

Registry exposes only known providers and does not perform any mutations.

func New

func New(deps Dependencies) (*Registry, error)

func NewFor

func NewFor(provider providerupgrade.Provider, deps Dependencies) (*Registry, error)

NewFor constructs only the selected installed provider. It does not require an unrelated provider to exist and never supplies fallback or fake Core hooks.

func (*Registry) Preflight

Preflight is the sole plan preparation entrypoint exposed to Session 1A. Every mutation must use the adapter returned by Resolve and the durable central journal; this package must never invoke Execute independently.

func (*Registry) Resolve

func (*Registry) ResolveRecovery

ResolveRecovery is only for a verified-backup recovery hook. It checks the fixed native adapter binding and retained protected source, without requiring the failed service to be healthy before it can be restored.

type RuntimeBinding

type RuntimeBinding struct {
	Reader  RuntimeReader
	Engine  string
	Sources map[providerupgrade.Provider]ManagedSource
}

RuntimeBinding verifies ownership from live project/service labels and resolves the actual image/digest through the selected BaseHarbor RuntimeProvider.

func (*RuntimeBinding) InspectManaged

func (*RuntimeBinding) InspectRecovery

InspectRecovery validates protected installation-owned source state when selected stop has legitimately removed a failed runtime container. Recovery still requires an exact original/target digest and a verified backup receipt.

type RuntimeIdentity

type RuntimeIdentity struct {
	Provider providerupgrade.Provider
	Project  string
	Service  string
	Engine   string
	Image    string
	Digest   string
	Owned    bool
}

RuntimeIdentity is evidence obtained from the selected RuntimeProvider, not from a user-supplied provider name. The Engine/project association must be verified by the runtime implementation before marking a service owned.

type RuntimeInventory

type RuntimeInventory interface {
	InspectManaged(context.Context, providerupgrade.Provider) (RuntimeIdentity, error)
}

RuntimeInventory must consult runtime resource labels and observed image identities; external or missing provider realizations fail closed.

type RuntimeReader

type RuntimeReader interface {
	ListRuntimeContainers(context.Context) ([]bhruntime.RuntimeContainer, error)
	ProjectServiceImageIdentity(context.Context, string, string) (bhruntime.ImageIdentity, error)
}

RuntimeReader is the read-only subset of the existing RuntimeProvider. No Docker/Podman command shell or independent control plane is introduced.

Jump to

Keyboard shortcuts

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