Documentation
¶
Index ¶
- Constants
- Variables
- func ApplicationProjectName(namespace, application, environment string) string
- func CacheProjectEnvironment(project string, environment map[string]string)
- func CheckSharedProviderIdentity(dataDir, provider string) error
- func ClearControlPlaneCredentialRotation(files Files) error
- func ClearProjectEnvironment(project string)
- func ContainerMatchesProjectResource(kind ProviderKind, container RuntimeContainer, project string, ...) bool
- func ControlPlaneNetworkName(resourceProject string) string
- func ControlPlaneServiceAccessNeedsBootstrapRestart(files Files) (bool, error)
- func ControlPlaneStartupServices(ha bool) ([]string, error)
- func CorePostgresCA(files Files) string
- func DataDir(stateDir string) (string, error)
- func EnsureCoreSQLConsumer(ctx context.Context, executor SQLConsumerExecutor, files Files, ...) error
- func EnsureServiceAccess(ctx context.Context, issuer serviceaccess.Issuer, files Files) error
- func IsPortBindingConflict(err error) bool
- func ProtectedStateOwner(_ string, info os.FileInfo) bool
- func ReplaceControlPlaneCredentials(files Files, next ControlPlaneCredentials) error
- func RequireCapabilities(provider Provider, required ...RuntimeCapability) error
- func RetireControlPlaneServiceAccessOverlap(ctx context.Context, issuer serviceaccess.Issuer, files Files) error
- func RuntimeEnvironment(files Files) (map[string]string, error)
- func SaveControlPlaneCredentialRotation(files Files, state ControlPlaneCredentialRotationState) error
- func SharedProjectName(namespace string) string
- func SharedResourceProjectName(namespace string) string
- func StateDir(stateDir string) (string, error)
- func TakeProjectEnvironment(project string) map[string]string
- func WithDockerEngineSelection(ctx context.Context, selection DockerEngineSelection) context.Context
- type Compose
- func (c Compose) BuildProjectFilesSelectedProgress(ctx context.Context, project, workdir string, environment map[string]string, ...) error
- func (c Compose) CommandPath() string
- func (c Compose) Config(ctx context.Context, composeFile, envFile string) error
- func (c Compose) ConfigJSONProjectFilesEnv(ctx context.Context, project, workdir string, environment map[string]string, ...) (string, error)
- func (c Compose) ConfigProject(ctx context.Context, project, composeFile, envFile string) error
- func (c Compose) ConfigProjectFiles(ctx context.Context, project, workdir string, composeFiles ...string) error
- func (c Compose) ConfigProjectFilesEnv(ctx context.Context, project, workdir string, environment map[string]string, ...) error
- func (c Compose) ConnectManagedNetwork(ctx context.Context, network, container, alias string) error
- func (c Compose) ContainerExposedTCPPorts(ctx context.Context, container string) ([]int, error)
- func (c Compose) ContainerHealthStatus(ctx context.Context, container string) (string, error)
- func (c Compose) ContainerLogConfigProjectService(ctx context.Context, project, service string) (string, string, error)
- func (c Compose) ContainerNetworks(ctx context.Context, container string) ([]string, error)
- func (c Compose) ContainerTerminal(ctx context.Context, id string, argv []string, rows, columns int) (terminal.Session, error)
- func (c Compose) ContainerVolumeExists(ctx context.Context, name string) (bool, error)
- func (c Compose) DestroyOwnedProjectResources(ctx context.Context, project string, resources []ProjectResource) error
- func (c Compose) DestroyProject(ctx context.Context, project, composeFile, envFile string) error
- func (c Compose) DestroyProjectRemoveOrphans(ctx context.Context, project, composeFile, envFile string) error
- func (c Compose) DiagnosticsProject(ctx context.Context, project, composeFile, envFile string) string
- func (c Compose) DirectOutput(ctx context.Context, args ...string) (string, error)
- func (c Compose) DirectStream(ctx context.Context, args ...string) (io.ReadCloser, error)
- func (c Compose) DisconnectManagedNetwork(ctx context.Context, network, container string) error
- func (c Compose) DockerEngine() *DockerEngineObservation
- func (c Compose) Down(ctx context.Context, composeFile, envFile string) error
- func (c Compose) DownProject(ctx context.Context, project, composeFile, envFile string) error
- func (c Compose) DownProjectFiles(ctx context.Context, project, workdir string, composeFiles ...string) error
- func (c Compose) DownProjectFilesEnv(ctx context.Context, project, workdir string, environment map[string]string, ...) error
- func (c Compose) DownProjectRemoveOrphans(ctx context.Context, project, composeFile, envFile string) error
- func (c Compose) EnsureManagedNetwork(ctx context.Context, name string) error
- func (c Compose) EnsureOwnedVolume(ctx context.Context, project, volume string) error
- func (c Compose) ExecProject(ctx context.Context, project, composeFile, envFile, service string, ...) (string, error)
- func (c Compose) ExecProjectFiles(ctx context.Context, project, workdir, service string, composeFiles []string, ...) (string, error)
- func (c Compose) ExecProjectFilesInput(ctx context.Context, project, workdir, service string, composeFiles []string, ...) (string, error)
- func (c Compose) ExecProjectInput(ctx context.Context, project, composeFile, envFile string, input []byte, ...) (string, error)
- func (c Compose) ExportOwnedVolume(ctx context.Context, project, volume string) ([]byte, error)
- func (c Compose) InspectProjectResource(ctx context.Context, project string, resource ProjectResource) (bool, error)
- func (c Compose) InspectProjectResources(ctx context.Context, project string, resources []ProjectResource) ([]ProjectResource, error)
- func (c Compose) InventoryOwnedContainerVolumes(ctx context.Context, project string) ([]ContainerVolume, error)
- func (c Compose) InventoryRepositoryVolumes(ctx context.Context, project string, previouslyObserved ...string) ([]RepositoryVolume, error)
- func (c Compose) ListOwnedProjectResources(ctx context.Context, project string) ([]ProjectResource, error)
- func (c Compose) ListRuntimeContainers(ctx context.Context) ([]RuntimeContainer, error)
- func (Compose) LogCollectionMode() LogCollectionMode
- func (c Compose) LogsProject(ctx context.Context, project, composeFile, envFile string, services ...string) (string, error)
- func (c Compose) LogsProjectFilesEnv(ctx context.Context, project, workdir string, environment map[string]string, ...) (string, error)
- func (c Compose) NetworkProjectOwner(ctx context.Context, network string) (string, error)
- func (c Compose) ProjectServiceImageIdentity(ctx context.Context, project, service string) (ImageIdentity, error)
- func (c Compose) ProjectServiceLogDriver(ctx context.Context, project, service string) (string, error)
- func (c Compose) PullImage(ctx context.Context, image string) error
- func (c Compose) RemoveManagedNetwork(ctx context.Context, name string) error
- func (c Compose) RemoveProjectServices(ctx context.Context, project string, services ...string) error
- func (c Compose) RestoreOwnedVolume(ctx context.Context, project, volume string, archive []byte) error
- func (c Compose) RetireOwnedProjectContainers(ctx context.Context, project string, resources []ProjectResource) error
- func (c Compose) RunProjectFilesEnv(ctx context.Context, project, workdir string, environment map[string]string, ...) error
- func (c Compose) RunningServicesProject(ctx context.Context, project, composeFile, envFile string) ([]string, error)
- func (c Compose) RunningServicesProjectFiles(ctx context.Context, project, workdir string, composeFiles ...string) ([]string, error)
- func (c Compose) RunningServicesProjectFilesEnv(ctx context.Context, project, workdir string, environment map[string]string, ...) ([]string, error)
- func (c Compose) SeedOwnedVolume(ctx context.Context, project, volume, image, subdir, owner string, ...) error
- func (c Compose) ServiceStatesFromRuntimeLabels(ctx context.Context, project string) ([]ServiceState, error)
- func (c Compose) ServiceStatesProjectFilesEnv(ctx context.Context, project, workdir string, environment map[string]string, ...) ([]ServiceState, error)
- func (c Compose) ServicesProjectFiles(ctx context.Context, project, workdir string, composeFiles ...string) ([]string, error)
- func (c Compose) ServicesProjectFilesEnv(ctx context.Context, project, workdir string, environment map[string]string, ...) ([]string, error)
- func (c Compose) Status(ctx context.Context, composeFile, envFile string) (string, error)
- func (c Compose) StatusProject(ctx context.Context, project, composeFile, envFile string) (string, error)
- func (c Compose) StatusProjectFiles(ctx context.Context, project, workdir string, composeFiles ...string) (string, error)
- func (c Compose) StopOwnedProjectContainers(ctx context.Context, project string) error
- func (c Compose) StopProject(ctx context.Context, project, composeFile, envFile string) error
- func (c Compose) StopProjectFilesSelected(ctx context.Context, project, workdir string, environment map[string]string, ...) error
- func (c Compose) Up(ctx context.Context, composeFile, envFile string) error
- func (c Compose) UpProject(ctx context.Context, project, composeFile, envFile string) error
- func (c Compose) UpProjectFiles(ctx context.Context, project, workdir string, composeFiles ...string) error
- func (c Compose) UpProjectFilesSelected(ctx context.Context, project, workdir string, environment map[string]string, ...) error
- func (c Compose) UpProjectFilesSelectedForceRecreateNoBuild(ctx context.Context, project, workdir string, environment map[string]string, ...) error
- func (c Compose) UpProjectFilesSelectedNoBuildProgress(ctx context.Context, project, workdir string, environment map[string]string, ...) error
- func (c Compose) UpProjectFilesSelectedProgress(ctx context.Context, project, workdir string, environment map[string]string, ...) error
- func (c Compose) UpProjectProgress(ctx context.Context, project, composeFile, envFile string, ...) error
- func (c Compose) VerifyOwnedVolumeQuiesced(ctx context.Context, project, volume string) error
- func (c Compose) VerifyProjectServiceLogCollection(ctx context.Context, project, service, expectedTag string) error
- type Config
- type ContainerVolume
- type ControlPlaneCredentialRotationPhase
- type ControlPlaneCredentialRotationState
- type ControlPlaneCredentials
- type ControlPlaneRuntimeInventory
- type CoreDependencyProvider
- type DockerEngineObservation
- type DockerEngineSelection
- type Files
- func BindControlPlaneToExistingDefaultNetwork(files Files) (Files, error)
- func EnsureFiles(stateDir string) (Files, error)
- func EnsureFilesForProject(stateDir, project string, ports Ports) (Files, error)
- func EnsureFilesForProjectAndResources(stateDir, project, resourceProject string, ports Ports, ha bool) (Files, error)
- func EnsureFilesWithPorts(stateDir string, ports Ports) (Files, error)
- func ExistingFiles(stateDir string) (Files, error)
- func ExistingFilesForProject(stateDir, project string) (Files, error)
- type ImageIdentity
- type LogCollectionMode
- type LogSourceAdapter
- type Ports
- type ProjectResource
- type Provider
- type ProviderCapabilities
- type ProviderDescriptor
- type ProviderFactory
- type ProviderKind
- type ProviderRegistration
- type ProviderRegistry
- type PublishedPort
- type RepositoryVolume
- type RetainedRuntimeResource
- type RuntimeCapability
- type RuntimeContainer
- type RuntimeProvider
- type RuntimeRetirement
- type RuntimeRetirementProvider
- type RuntimeServiceRetirementProvider
- type RuntimeServiceStopProvider
- type RuntimeServiceStopResult
- type SQLConsumerExecutor
- type ServiceState
Constants ¶
const ( LogCollectionSyslog = runtimecontract.LogCollectionSyslog LogCollectionJournald = runtimecontract.LogCollectionJournald )
const ( ProviderDocker = runtimecontract.ProviderDocker ProviderPodman = runtimecontract.ProviderPodman ProviderKubernetes = runtimecontract.ProviderKubernetes ProviderOpenShift = runtimecontract.ProviderOpenShift )
const ( CapabilityWorkloadLifecycle = runtimecontract.CapabilityWorkloadLifecycle CapabilityServiceExec = runtimecontract.CapabilityServiceExec CapabilityPublishedPorts = runtimecontract.CapabilityPublishedPorts CapabilityResourceOwnership = runtimecontract.CapabilityResourceOwnership )
const ( DefaultPostgresPort = 5432 DefaultOpenBaoPort = 8200 )
const RuntimeProviderContractVersion = runtimecontract.RuntimeProviderContractVersion
Variables ¶
var ErrResourceOwnership = errors.New("runtime resource ownership does not match the application project")
var ErrRuntimeNotFound = errors.New("container runtime orchestration not found")
Functions ¶
func ApplicationProjectName ¶ added in v0.4.16
ApplicationProjectName returns the operator-visible Compose project for one application on a target. Empty namespace means the implicit local target.
func CacheProjectEnvironment ¶ added in v0.4.17
func CheckSharedProviderIdentity ¶ added in v0.4.24
CheckSharedProviderIdentity prevents new logical sharing boundaries from replacing retained, separately deployed physical providers. It is read-only.
func ClearControlPlaneCredentialRotation ¶ added in v0.4.21
func ClearProjectEnvironment ¶ added in v0.4.17
func ClearProjectEnvironment(project string)
func ContainerMatchesProjectResource ¶ added in v0.4.25
func ContainerMatchesProjectResource(kind ProviderKind, container RuntimeContainer, project string, resource ProjectResource) bool
ContainerMatchesProjectResource preserves the existing native naming conventions: Compose has ordinal -1; first-party Quadlet uses project-service. Both require the actual project and service labels, not a name prefix.
func ControlPlaneNetworkName ¶ added in v0.4.17
func ControlPlaneServiceAccessNeedsBootstrapRestart ¶ added in v0.4.17
func ControlPlaneStartupServices ¶ added in v0.4.22
ControlPlaneStartupServices reads the actual embedded startup topology, including transient admin/bootstrap services. Resource planning must not assume replicas.
func CorePostgresCA ¶ added in v0.4.24
func DataDir ¶ added in v0.4.2
DataDir resolves the BaseHarbor data root that owns runtime-global metadata. Explicit state-directory overrides remain self-contained. Without an override, metadata is stored beside runtime/ so creating it cannot change legacy/global runtime selection.
func EnsureCoreSQLConsumer ¶ added in v0.4.24
func EnsureCoreSQLConsumer(ctx context.Context, executor SQLConsumerExecutor, files Files, database, user, password, owner string) error
EnsureCoreSQLConsumer creates only a database and a restricted login inside the selected Core SQL provider. Existing unowned objects are never adopted. Secrets travel on stdin; diagnostics deliberately omit SQL and credentials.
func EnsureServiceAccess ¶ added in v0.4.15
func IsPortBindingConflict ¶
IsPortBindingConflict reports whether a Docker Compose or Podman runtime failure is a host-port allocation conflict. Runtime engines phrase the same condition differently, so keep the classifier deliberately narrow but multi-engine.
func ProtectedStateOwner ¶ added in v0.4.25
ProtectedStateOwner verifies native authority for a private state file or directory. It observes metadata only; it never acquires or repairs ownership.
func ReplaceControlPlaneCredentials ¶ added in v0.4.21
func ReplaceControlPlaneCredentials(files Files, next ControlPlaneCredentials) error
func RequireCapabilities ¶ added in v0.4.0
func RequireCapabilities(provider Provider, required ...RuntimeCapability) error
func RetireControlPlaneServiceAccessOverlap ¶ added in v0.4.21
func RuntimeEnvironment ¶ added in v0.4.21
func SaveControlPlaneCredentialRotation ¶ added in v0.4.21
func SaveControlPlaneCredentialRotation(files Files, state ControlPlaneCredentialRotationState) error
func SharedProjectName ¶ added in v0.4.16
SharedProjectName returns the operator-visible Compose project for target-wide BaseHarbor platform services. Empty namespace means the implicit local target.
func SharedResourceProjectName ¶ added in v0.4.16
SharedResourceProjectName returns the stable physical resource prefix for target-wide platform resources. It is intentionally independent from the operator-visible consolidated Compose project name.
func StateDir ¶ added in v0.4.2
StateDir resolves the authoritative BaseHarbor runtime state directory without mutating it.
func TakeProjectEnvironment ¶ added in v0.4.17
func WithDockerEngineSelection ¶ added in v0.4.24
func WithDockerEngineSelection(ctx context.Context, selection DockerEngineSelection) context.Context
Types ¶
type Compose ¶
type Compose struct {
// contains filtered or unexported fields
}
Compose provides the small lifecycle surface BaseHarbor needs from a container runtime. Application code should not shell out to Docker/Podman directly.
func NewCLIBackend ¶ added in v0.4.17
func NewDockerCLIBackend ¶ added in v0.4.24
func NewDockerCLIBackend(command string, engine DockerEngineObservation) Compose
func (Compose) BuildProjectFilesSelectedProgress ¶ added in v0.4.15
func (Compose) CommandPath ¶ added in v0.4.17
func (Compose) ConfigJSONProjectFilesEnv ¶
func (Compose) ConfigProject ¶
func (Compose) ConfigProjectFiles ¶
func (Compose) ConfigProjectFilesEnv ¶
func (Compose) ConnectManagedNetwork ¶ added in v0.4.8
func (Compose) ContainerExposedTCPPorts ¶ added in v0.4.8
func (Compose) ContainerHealthStatus ¶ added in v0.4.8
func (Compose) ContainerLogConfigProjectService ¶ added in v0.4.16
func (c Compose) ContainerLogConfigProjectService(ctx context.Context, project, service string) (string, string, error)
ContainerLogConfigProjectService returns the runtime logging driver and tag for the running container that belongs to an exact Compose project/service.
func (Compose) ContainerNetworks ¶ added in v0.4.8
func (Compose) ContainerTerminal ¶ added in v0.4.23
func (Compose) ContainerVolumeExists ¶ added in v0.4.22
func (Compose) DestroyOwnedProjectResources ¶ added in v0.4.11
func (Compose) DestroyProject ¶
func (Compose) DestroyProjectRemoveOrphans ¶ added in v0.4.4
func (Compose) DiagnosticsProject ¶ added in v0.4.9
func (c Compose) DiagnosticsProject(ctx context.Context, project, composeFile, envFile string) string
DiagnosticsProject captures stopped/restarting containers and recent logs before a fail-closed lifecycle rollback removes provider resources.
func (Compose) DirectOutput ¶ added in v0.4.17
func (Compose) DirectStream ¶ added in v0.4.22
func (Compose) DisconnectManagedNetwork ¶ added in v0.4.8
func (Compose) DockerEngine ¶ added in v0.4.24
func (c Compose) DockerEngine() *DockerEngineObservation
func (Compose) DownProject ¶
func (Compose) DownProjectFiles ¶
func (Compose) DownProjectFilesEnv ¶
func (Compose) DownProjectRemoveOrphans ¶ added in v0.4.4
func (Compose) EnsureManagedNetwork ¶ added in v0.4.8
func (Compose) EnsureOwnedVolume ¶ added in v0.4.16
func (Compose) ExecProject ¶
func (Compose) ExecProjectFiles ¶
func (Compose) ExecProjectFilesInput ¶ added in v0.4.15
func (Compose) ExecProjectInput ¶
func (c Compose) ExecProjectInput(ctx context.Context, project, composeFile, envFile string, input []byte, service string, args ...string) (string, error)
ExecProjectInput executes a command inside a Compose service while supplying stdin without placing that input in the host process argument list. It is intended for sensitive operator flows such as OpenBao unseal/authentication.
func (Compose) ExportOwnedVolume ¶ added in v0.4.16
func (Compose) InspectProjectResource ¶
func (c Compose) InspectProjectResource(ctx context.Context, project string, resource ProjectResource) (bool, error)
InspectProjectResource verifies an exact runtime resource name before a destructive operation. A resource with the expected name but a different Compose project label is an ownership conflict, never an implicit match.
func (Compose) InspectProjectResources ¶ added in v0.4.15
func (c Compose) InspectProjectResources(ctx context.Context, project string, resources []ProjectResource) ([]ProjectResource, error)
InspectProjectResources verifies runtime resource existence and ownership in batches by kind. This keeps ownership fail-closed while avoiding repeated list/inspect round-trips on Podman.
func (Compose) InventoryOwnedContainerVolumes ¶ added in v0.4.22
func (Compose) InventoryRepositoryVolumes ¶ added in v0.4.24
func (c Compose) InventoryRepositoryVolumes(ctx context.Context, project string, previouslyObserved ...string) ([]RepositoryVolume, error)
InventoryRepositoryVolumes includes mounted data and orphaned project-labelled volumes, so repeating destroy still reports data after containers disappear.
func (Compose) ListOwnedProjectResources ¶ added in v0.4.18
func (Compose) ListRuntimeContainers ¶ added in v0.4.17
func (c Compose) ListRuntimeContainers(ctx context.Context) ([]RuntimeContainer, error)
func (Compose) LogCollectionMode ¶ added in v0.4.17
func (Compose) LogCollectionMode() LogCollectionMode
func (Compose) LogsProject ¶ added in v0.4.9
func (Compose) LogsProjectFilesEnv ¶ added in v0.4.19
func (Compose) NetworkProjectOwner ¶ added in v0.4.8
func (Compose) ProjectServiceImageIdentity ¶ added in v0.4.15
func (Compose) ProjectServiceLogDriver ¶ added in v0.4.16
func (Compose) RemoveManagedNetwork ¶ added in v0.4.8
func (Compose) RemoveProjectServices ¶ added in v0.4.17
func (c Compose) RemoveProjectServices(ctx context.Context, project string, services ...string) error
RemoveProjectServices removes only containers whose runtime ownership labels match the exact project and one of the requested legacy service names. It is intentionally narrower than compose --remove-orphans so consolidated bh-* projects cannot prune sibling modules.
func (Compose) RestoreOwnedVolume ¶ added in v0.4.16
func (Compose) RetireOwnedProjectContainers ¶ added in v0.4.25
func (c Compose) RetireOwnedProjectContainers(ctx context.Context, project string, resources []ProjectResource) error
RetireOwnedProjectContainers never requests removal of anonymous or named volumes. Destructive cleanup remains a separate, explicitly authorized path.
func (Compose) RunProjectFilesEnv ¶ added in v0.3.0
func (c Compose) RunProjectFilesEnv(ctx context.Context, project, workdir string, environment map[string]string, stdin io.Reader, stdout, stderr io.Writer, composeFiles []string, args ...string) error
RunProjectFilesEnv runs a workload command with caller-owned streams through Docker Compose. Podman owns the equivalent operation in PodmanProvider.
func (Compose) RunningServicesProject ¶
func (Compose) RunningServicesProjectFiles ¶
func (Compose) RunningServicesProjectFilesEnv ¶
func (Compose) SeedOwnedVolume ¶ added in v0.4.24
func (c Compose) SeedOwnedVolume(ctx context.Context, project, volume, image, subdir, owner string, archive io.Reader) error
SeedOwnedVolume streams a verified native archive into an empty replacement volume. It never deletes data and refuses a partial or previously used volume. The caller supplies the inventoried, digest-pinned image containing GNU tar.
func (Compose) ServiceStatesFromRuntimeLabels ¶ added in v0.4.17
func (Compose) ServiceStatesProjectFilesEnv ¶ added in v0.3.0
func (c Compose) ServiceStatesProjectFilesEnv(ctx context.Context, project, workdir string, environment map[string]string, composeFiles ...string) ([]ServiceState, error)
ServiceStatesProjectFilesEnv returns Compose service state without exposing generated container names to application code. Modern Compose implementations expose JSON state including container health and published ports. Older compatible implementations fall back to the portable running-service query; in that case Health and Publishers remain empty rather than inventing state.
func (Compose) ServicesProjectFiles ¶
func (Compose) ServicesProjectFilesEnv ¶
func (Compose) StatusProject ¶
func (Compose) StatusProjectFiles ¶
func (Compose) StopOwnedProjectContainers ¶ added in v0.4.18
func (Compose) StopProject ¶ added in v0.4.8
func (Compose) StopProjectFilesSelected ¶
func (Compose) UpProjectFiles ¶
func (Compose) UpProjectFilesSelected ¶
func (Compose) UpProjectFilesSelectedForceRecreateNoBuild ¶ added in v0.4.15
func (Compose) UpProjectFilesSelectedNoBuildProgress ¶ added in v0.4.15
func (Compose) UpProjectFilesSelectedProgress ¶ added in v0.4.11
func (Compose) UpProjectProgress ¶ added in v0.4.11
func (Compose) VerifyOwnedVolumeQuiesced ¶ added in v0.4.24
VerifyOwnedVolumeQuiesced checks actual native mounts across all projects. Unrelated services may share a project label without sharing this datastore; a foreign container mounting the datastore still prevents recovery.
func (Compose) VerifyProjectServiceLogCollection ¶ added in v0.4.17
func (c Compose) VerifyProjectServiceLogCollection(ctx context.Context, project, service, expectedTag string) error
VerifyProjectServiceLogCollection keeps runtime-product verification behind the runtime provider boundary. Docker verifies the configured syslog driver and tag. Podman/Quadlet uses journald and has no equivalent Compose log-tag contract to assert here.
type Config ¶
type Config struct {
PostgresDB string
PostgresUser string
PostgresPassword string
PostgresInternalUser string
PostgresInternalPassword string
PostgresReplicationUser string
OpenBaoDBUser string
OpenBaoDBPassword string
PostgresPort int
OpenBaoPort int
}
func LoadConfig ¶
type ContainerVolume ¶ added in v0.4.22
ContainerVolume records mounted volume identities before containers disappear. Anonymous ownership comes from the engine, never a name or creation time.
type ControlPlaneCredentialRotationPhase ¶ added in v0.4.21
type ControlPlaneCredentialRotationPhase string
const ( ControlPlaneRotationPrepared ControlPlaneCredentialRotationPhase = "PREPARED" ControlPlaneRotationProjected ControlPlaneCredentialRotationPhase = "PROJECTED" ControlPlaneRotationVerified ControlPlaneCredentialRotationPhase = "VERIFIED" ControlPlaneRotationRetired ControlPlaneCredentialRotationPhase = "RETIRED" )
type ControlPlaneCredentialRotationState ¶ added in v0.4.21
type ControlPlaneCredentialRotationState struct {
Version int `json:"version"`
Phase ControlPlaneCredentialRotationPhase `json:"phase"`
Previous ControlPlaneCredentials `json:"previous"`
Next ControlPlaneCredentials `json:"next"`
}
func LoadControlPlaneCredentialRotation ¶ added in v0.4.21
func LoadControlPlaneCredentialRotation(files Files) (ControlPlaneCredentialRotationState, bool, error)
type ControlPlaneCredentials ¶ added in v0.4.21
type ControlPlaneCredentials struct {
PostgresUser string `json:"postgres_user"`
PostgresPassword string `json:"postgres_password"`
PostgresInternalUser string `json:"postgres_internal_user"`
PostgresInternalPassword string `json:"postgres_internal_password"`
PostgresReplicationUser string `json:"postgres_replication_user"`
PostgresReplicationPass string `json:"postgres_replication_password"`
OpenBaoDBUser string `json:"openbao_db_user"`
OpenBaoDBPassword string `json:"openbao_db_password"`
}
func LoadControlPlaneCredentials ¶ added in v0.4.21
func LoadControlPlaneCredentials(files Files) (ControlPlaneCredentials, error)
type ControlPlaneRuntimeInventory ¶ added in v0.4.25
type ControlPlaneRuntimeInventory struct {
Files Files
SQLServices []string
SecretsServices []string
Resources []ProjectResource
ProfiledServices []string
OneShotServices []string
}
ControlPlaneRuntimeInventory observes the existing native owner, including its bootstrap or secured renderer shape. It does not initialize credentials, issue certificates, change a profile or mutate runtime state.
func ExistingControlPlaneRuntimeInventory ¶ added in v0.4.25
func ExistingControlPlaneRuntimeInventory(stateDir, project string) (ControlPlaneRuntimeInventory, error)
func (ControlPlaneRuntimeInventory) ContinuousServices ¶ added in v0.4.25
func (inventory ControlPlaneRuntimeInventory) ContinuousServices(services []string) []string
ContinuousServices selects normal availability requirements without changing the complete module inventory used by stop, retirement and recovery owners.
type CoreDependencyProvider ¶ added in v0.4.24
CoreDependencyProvider binds consumers to the already selected installation. It supplies no operator credentials and must never provision another Core.
type DockerEngineObservation ¶ added in v0.4.24
type DockerEngineObservation struct {
Endpoint string `json:"endpoint"`
Context string `json:"context,omitempty"`
Mode string `json:"mode"`
DaemonID string `json:"daemon_id,omitempty"`
SelectionOrigin string `json:"selection_origin"`
Verified bool `json:"verified"`
}
func DockerEngineForProvider ¶ added in v0.4.24
func DockerEngineForProvider(provider any) *DockerEngineObservation
func ResolveDockerEngine ¶ added in v0.4.24
func ResolveDockerEngine(ctx context.Context, command string) (DockerEngineObservation, error)
ResolveDockerEngine resolves once and probes that exact socket. It never probes another engine as a fallback after a failed selection.
type DockerEngineSelection ¶ added in v0.4.24
type DockerEngineSelection struct{ Endpoint, Context, Mode string }
DockerEngineSelection is explicit Target intent, never application environment.
type Files ¶
type Files struct {
DefaultNetworkExternal bool `json:"default_network_external,omitempty"`
HA bool
Compose string
Env string
Project string
ResourceProject string
}
func BindControlPlaneToExistingDefaultNetwork ¶ added in v0.4.25
BindControlPlaneToExistingDefaultNetwork changes only this Core owner's reference. The caller must prove the existing shared owner AND native network authority under the Target lifecycle lock. It never edits/relabels a network, adopts another provider's data, changes credentials or claims its ownership.
func EnsureFiles ¶
func EnsureFilesForProject ¶ added in v0.4.15
func EnsureFilesForProjectAndResources ¶ added in v0.4.16
func ExistingFiles ¶
func ExistingFilesForProject ¶ added in v0.4.15
func (Files) OpenBaoMembers ¶ added in v0.4.22
func (Files) PostgresMembers ¶ added in v0.4.22
type ImageIdentity ¶ added in v0.4.15
type ImageIdentity = runtimecontract.ImageIdentity
type LogCollectionMode ¶ added in v0.4.17
type LogCollectionMode = runtimecontract.LogCollectionMode
type LogSourceAdapter ¶ added in v0.4.17
type LogSourceAdapter = runtimecontract.LogSourceAdapter
type ProjectResource ¶
type ProjectResource = runtimecontract.ProjectResource
func ExistingCanonicalProjectInventory ¶ added in v0.4.25
func ExistingCanonicalProjectInventory(project, compose, canonical string, protectedFiles ...string) ([]ProjectResource, error)
ExistingCanonicalProjectInventory derives native resources only AFTER an exact match with the provider's current canonical renderer. Arbitrary Compose content, labels or names never establish an independent ownership authority.
type Provider ¶ added in v0.4.0
type Provider = runtimecontract.Provider
type ProviderCapabilities ¶ added in v0.4.0
type ProviderCapabilities = runtimecontract.ProviderCapabilities
type ProviderDescriptor ¶ added in v0.4.17
type ProviderDescriptor = runtimecontract.ProviderDescriptor
type ProviderFactory ¶ added in v0.4.17
type ProviderFactory = runtimecontract.ProviderFactory
type ProviderKind ¶ added in v0.4.0
type ProviderKind = runtimecontract.ProviderKind
func ParseProviderKind ¶ added in v0.4.0
func ParseProviderKind(value string) (ProviderKind, error)
type ProviderRegistration ¶ added in v0.4.17
type ProviderRegistration = runtimecontract.ProviderRegistration
type ProviderRegistry ¶ added in v0.4.17
type ProviderRegistry = runtimecontract.ProviderRegistry
func NewProviderRegistry ¶ added in v0.4.17
func NewProviderRegistry(registrations ...ProviderRegistration) (*ProviderRegistry, error)
type PublishedPort ¶ added in v0.3.0
type PublishedPort = runtimecontract.PublishedPort
type RepositoryVolume ¶ added in v0.4.24
RepositoryVolume is observation only: Compose provenance never grants data deletion.
type RetainedRuntimeResource ¶ added in v0.4.25
type RetainedRuntimeResource struct {
Resource ProjectResource `json:"resource"`
Reason string `json:"reason"`
}
type RuntimeCapability ¶ added in v0.4.0
type RuntimeCapability = runtimecontract.RuntimeCapability
type RuntimeContainer ¶ added in v0.4.17
type RuntimeContainer = runtimecontract.RuntimeContainer
type RuntimeProvider ¶ added in v0.4.17
type RuntimeProvider = runtimecontract.RuntimeProvider
type RuntimeRetirement ¶ added in v0.4.25
type RuntimeRetirement struct {
Removed []ProjectResource `json:"removed"`
Retained []RetainedRuntimeResource `json:"retained"`
}
RuntimeRetirement is evidence, not another persisted ownership record. On failure callers keep their existing registry/deployment records for retry.
func RetireOwnedRuntime ¶ added in v0.4.25
func RetireOwnedRuntime(ctx context.Context, provider RuntimeRetirementProvider, files Files, expected []ProjectResource) (RuntimeRetirement, error)
RetireOwnedRuntime removes an unused runtime module without deleting data. All container, network and volume ownership is checked before any mutation. Existing DownProject implementations preserve volumes on Docker and Quadlet.
func RetireOwnedServices ¶ added in v0.4.25
func RetireOwnedServices(ctx context.Context, provider RuntimeServiceRetirementProvider, project string, expected, remove []ProjectResource) (RuntimeRetirement, error)
RetireOwnedServices accepts the canonical old resource set and exactly the containers released by the consumer plan. Volumes and networks are never deletion targets. Failed mutations still return observed partial disposition.
type RuntimeRetirementProvider ¶ added in v0.4.25
type RuntimeRetirementProvider interface {
InspectProjectResources(context.Context, string, []ProjectResource) ([]ProjectResource, error)
DownProject(context.Context, string, string, string) error
}
RuntimeRetirementProvider uses the existing runtime owner. The caller must prove from the authoritative consumer plan that this entire module is unused and supply its canonical resource inventory, never a discovered foreign file.
type RuntimeServiceRetirementProvider ¶ added in v0.4.25
type RuntimeServiceRetirementProvider interface {
InspectProjectResources(context.Context, string, []ProjectResource) ([]ProjectResource, error)
ListRuntimeContainers(context.Context) ([]RuntimeContainer, error)
RetireOwnedProjectContainers(context.Context, string, []ProjectResource) error
}
RuntimeServiceRetirementProvider retires a selected service set without bringing down sibling modules consolidated under the same Compose project.
type RuntimeServiceStopProvider ¶ added in v0.4.25
type RuntimeServiceStopProvider interface {
InspectProjectResources(context.Context, string, []ProjectResource) ([]ProjectResource, error)
ListRuntimeContainers(context.Context) ([]RuntimeContainer, error)
StopProjectFilesSelected(context.Context, string, string, map[string]string, []string, ...string) error
Kind() ProviderKind
}
type RuntimeServiceStopResult ¶ added in v0.4.25
type RuntimeServiceStopResult struct {
Stopped []ProjectResource `json:"stopped"`
Retained []ProjectResource `json:"retained"`
Removed []ProjectResource `json:"removed"`
Verified bool `json:"verified"`
VerificationFailures []string `json:"verification_failures,omitempty"`
}
func StopOwnedProjectServices ¶ added in v0.4.25
func StopOwnedProjectServices(ctx context.Context, provider RuntimeServiceStopProvider, project, workdir string, environment map[string]string, expected []ProjectResource, services []string, composeFiles ...string) (RuntimeServiceStopResult, error)
Stop only the caller's canonical module services. Consolidated projects may also contain other providers: neither project down nor project-wide stop is authority over those siblings. Persistent resources and process identities are inspected again even when the native command reports failure.
type SQLConsumerExecutor ¶ added in v0.4.24
type ServiceState ¶ added in v0.3.0
type ServiceState = runtimecontract.ServiceState
Source Files
¶
- bootstrap_etcd_tls.go
- bootstrap_postgres_tls.go
- canonical_inventory.go
- command_env.go
- compose.go
- compose_command.go
- compose_files.go
- compose_interactive.go
- compose_network.go
- compose_progress.go
- compose_resources.go
- compose_status.go
- compose_terminal.go
- config.go
- container_identity.go
- container_volumes.go
- contract.go
- control_plane_credentials.go
- control_plane_inventory.go
- control_plane_network_binding.go
- control_plane_profile.go
- docker_engine.go
- image_identity.go
- logging.go
- openbao_runtime_prepare.go
- openbao_storage.go
- port_conflict.go
- project_names.go
- projected_files.go
- protected_owner_unix.go
- provider.go
- repository_volume_inventory.go
- retirement.go
- service_access_transition.go
- service_retirement.go
- service_stop.go
- shared_core_sql.go
- shared_provider_identity.go
- stack.go
- topology.go
- volume_recovery.go